www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Phobos and older DMD versions

reply "qznc" <qznc web.de> writes:
My recent pull request [0] triggered some issue, which should get 
a bigger discussion:

Should Phobos version N also compile with DMD N-1?

In my opinion it should, because it makes Phobos development 
simpler. You don't need a self compiled dmd to fix bugs.

However, reality sometimes requires exceptions. I understand that 
sometimes Phobos uses a feature of dmd HEAD. That is why I said 
"should", but not "must". ;)


[0] 
https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514
Aug 06 2013
next sibling parent "Mr. Anonymous" <mailnew4ster gmail.com> writes:
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

On a related note, I think providing compiled daily/weekly master builds is a good idea. They are compiled by the auto tester anyway, right?
Aug 06 2013
prev sibling next sibling parent "JS" <js.mdnq gmail.com> writes:
On Tuesday, 6 August 2013 at 14:56:43 UTC, Mr. Anonymous wrote:
 On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

On a related note, I think providing compiled daily/weekly master builds is a good idea. They are compiled by the auto tester anyway, right?

This would definitely make life easier for me as I'm not in a position ATM to compile the latest D.
Aug 06 2013
prev sibling next sibling parent reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should 
 get a bigger discussion:

 Should Phobos version N also compile with DMD N-1?

 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

 However, reality sometimes requires exceptions. I understand 
 that sometimes Phobos uses a feature of dmd HEAD. That is why I 
 said "should", but not "must". ;)


 [0] 
 https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

This doesn't sound related to the problem discussed. Phobos N must compile with DMD N, that is a primary requirement. If Phobos N compiles with DMD N-1, great but it can't fail in DMD N. Now, if we step back from the principle of it. It would be good to require DMD N-1 to compile Phobos N because it would require careful thought in how to do translations. Instead of fixing the bug, prepare the compiler to accept the change that will be needed in Druntime. That is of course the armchair statement, I think is something to strive for and if we're trying to do the "do what you would do if you had a million users," this is probably something we would do; where we is a couple hundred of the million users (oh we don't have that:).
Aug 06 2013
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 2013-08-06 16:02:30 +0000, Jesse Phillips said:

 On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should get a 
 bigger discussion:
 
 Should Phobos version N also compile with DMD N-1?
 
 In my opinion it should, because it makes Phobos development simpler. 
 You don't need a self compiled dmd to fix bugs.
 
 However, reality sometimes requires exceptions. I understand that 
 sometimes Phobos uses a feature of dmd HEAD. That is why I said 
 "should", but not "must". ;)
 
 
 [0] https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

This doesn't sound related to the problem discussed. Phobos N must compile with DMD N, that is a primary requirement. If Phobos N compiles with DMD N-1, great but it can't fail in DMD N. Now, if we step back from the principle of it. It would be good to require DMD N-1 to compile Phobos N because it would require careful thought in how to do translations. Instead of fixing the bug, prepare the compiler to accept the change that will be needed in Druntime. That is of course the armchair statement, I think is something to strive for and if we're trying to do the "do what you would do if you had a million users," this is probably something we would do; where we is a couple hundred of the million users (oh we don't have that:).

I think it should be fair to require the new compiler with the new stdlib. They are released in unison. Andrei
Aug 06 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-08-07 21:13, Andre Artus wrote:

 You should be able to run side-by-side installations of dmd+phobos, at
 least that is how I do it. One latest stable, one built from GitHub source.

DVM is a great way to do that: https://github.com/jacob-carlborg/dvm -- /Jacob Carlborg
Aug 07 2013
prev sibling next sibling parent "Brad Anderson" <eco gnuk.net> writes:
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should 
 get a bigger discussion:

 Should Phobos version N also compile with DMD N-1?

 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

 However, reality sometimes requires exceptions. I understand 
 that sometimes Phobos uses a feature of dmd HEAD. That is why I 
 said "should", but not "must". ;)


 [0] 
 https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

The contribution guide should probably say it must build with DMD master because that's really the only requirement and the only thing the autotester checks against. It seems unlikely that the code in a pull request will ever make it into a DMD N-1 release so while it would be nice if it built with the current DMD stable release it's not really vital that it does. Until fairly recently I'd just use the latest dmd release when making phobos pull requests because building dmd always seemed to give me trouble. There are new guides and tools to help with this though. On Windows you might add a blurb about using the new bootstrap-dmd.bat[1] file Nick Sabalausky created. The wiki also has a guide that might be worth linking to that shows that helps you setup the peculiar (in my opinion) directory structure needed to build dmd, druntime, and phobos from git master[2]. You might also want to incorporate stuff from from the Pull Requests page on the wiki or link to it.[3] 1. https://github.com/D-Programming-Language/installer/blob/master/bootstrap/bootstrap-dmd.bat 2. http://wiki.dlang.org/Building_DMD 3. http://wiki.dlang.org/Pull_Requests
Aug 06 2013
prev sibling next sibling parent "qznc" <qznc web.de> writes:
On Tuesday, 6 August 2013 at 16:02:31 UTC, Jesse Phillips wrote:
 On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should 
 get a bigger discussion:

 Should Phobos version N also compile with DMD N-1?

 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

 However, reality sometimes requires exceptions. I understand 
 that sometimes Phobos uses a feature of dmd HEAD. That is why 
 I said "should", but not "must". ;)


 [0] 
 https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

This doesn't sound related to the problem discussed. Phobos N must compile with DMD N, that is a primary requirement. If Phobos N compiles with DMD N-1, great but it can't fail in DMD N.

Correct, Phobos N with DMD N is a "must". The question is, whether Phobos N with DMD N-1 is a "should". For the pull request, the question is what goes into the guidelines. That should be discussed there, instead of here in the forums. ;)
Aug 06 2013
prev sibling next sibling parent "monarch_dodra" <monarchdodra gmail.com> writes:
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should 
 get a bigger discussion:

 Should Phobos version N also compile with DMD N-1?

 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

 However, reality sometimes requires exceptions. I understand 
 that sometimes Phobos uses a feature of dmd HEAD. That is why I 
 said "should", but not "must". ;)


 [0] 
 https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

One of the "big" problems is that a *lot* of bugs work this way: 1) Bug is discovered in Phobos 2) Fixing bug reveals a dmd bug 3) dmd is fixed 4) phobos is fixed If phobos N had to work with DMD N-1, then development in phobos would simply grind to a halt. It's not just about new features in DMD that phobos wants to use. dmd bugs are fixed for phobos, I'd say, on a twice by week basis (roughly).
Aug 07 2013
prev sibling next sibling parent "Dicebot" <public dicebot.lv> writes:
On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should 
 get a bigger discussion:

 Should Phobos version N also compile with DMD N-1?

 In my opinion it should, because it makes Phobos development 
 simpler. You don't need a self compiled dmd to fix bugs.

 However, reality sometimes requires exceptions. I understand 
 that sometimes Phobos uses a feature of dmd HEAD. That is why I 
 said "should", but not "must". ;)


 [0] 
 https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

Makes no sense to me. 1) DMD and Phobos are always released at the same time and share versioning. 2) It will require essentially doubling the load on pull request tester. As you need to be sure your fix works on current DMD head anyway, you should have full custom environment anyway (dmd + druntime + phobos). It is quite easy to keep such development environment separate from system-wide dmd installation anyway.
Aug 07 2013
prev sibling next sibling parent "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Tuesday, 6 August 2013 at 22:23:03 UTC, Andrei Alexandrescu 
wrote:
 I think it should be fair to require the new compiler with the 
 new stdlib. They are released in unison.

 Andrei

I agree, but there is at least potential benefits from choosing previous compiler version. If a change in compiler requires a change in Phobos/druntime it also means a change in user code (at least I don't see why it wouldn't). It would just be an extra layer to make upgrading from one compiler to another less likely to have unintended breaking changes. But this would be minor in comparison to the other steps which have been taken.
Aug 07 2013
prev sibling next sibling parent "Andre Artus" <andre.artus gmail.com> writes:
On Wednesday, 7 August 2013 at 18:37:22 UTC, Jesse Phillips wrote:
 On Tuesday, 6 August 2013 at 22:23:03 UTC, Andrei Alexandrescu 
 wrote:
 I think it should be fair to require the new compiler with the 
 new stdlib. They are released in unison.

 Andrei

I agree, but there is at least potential benefits from choosing previous compiler version. If a change in compiler requires a change in Phobos/druntime it also means a change in user code (at least I don't see why it wouldn't). It would just be an extra layer to make upgrading from one compiler to another less likely to have unintended breaking changes. But this would be minor in comparison to the other steps which have been taken.

You should be able to run side-by-side installations of dmd+phobos, at least that is how I do it. One latest stable, one built from GitHub source.
Aug 07 2013
prev sibling next sibling parent "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Wednesday, 7 August 2013 at 19:13:13 UTC, Andre Artus wrote:
 You should be able to run side-by-side installations of 
 dmd+phobos, at least that is how I do it. One latest stable, 
 one built from GitHub source.

That isn't related to what I'm trying to describe. dmd2.063 program.d dmd2.064-head program.d If Phobos2.064-head does not compile with dmd2.063, it increases how likely program.d will not compile with the new dmd. This is a very loose relation making its value very minimal. Another positive of this working is that after updating your code for the new compiler one could keep the updates in the source and switch to the previous release if it doesn't work out.
Aug 07 2013
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Tue, Aug 06, 2013 at 04:51:33PM +0200, qznc wrote:
 My recent pull request [0] triggered some issue, which should get a
 bigger discussion:
 
 Should Phobos version N also compile with DMD N-1?
 
 In my opinion it should, because it makes Phobos development
 simpler. You don't need a self compiled dmd to fix bugs.
 
 However, reality sometimes requires exceptions. I understand that
 sometimes Phobos uses a feature of dmd HEAD. That is why I said
 "should", but not "must". ;)

The problem is that D is still undergoing rapid development, and often new Phobos additions require the latest compiler features / bugfixes. Jonathan pointed out the use of package.d to help break std.datetime into more manageable pieces. That's an example of a change that couldn't possibly compile with an earlier version of DMD. Other examples include compiler bugfixes that require corresponding changes in druntime/phobos. It's not possible to isolate Phobos from DMD git HEAD in this case, since the changes must be applied to both, otherwise it would result in Phobos being uncompilable / horribly broken. There *are* ways of working around this, of course. We could use static if (__VERSION__ < 2064L) to keep Phobos compilable with dmd 2.063, for example. But it would result in basically maintaining two versions of Phobos within the same code, which deteriorates into the equivalent of C/C++ #ifdef hell pretty quickly. T -- Life is unfair. Ask too much from it, and it may decide you don't deserve what you have now either.
Aug 06 2013
prev sibling next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Tuesday, August 06, 2013 20:34:24 qznc wrote:
 On Tuesday, 6 August 2013 at 16:02:31 UTC, Jesse Phillips wrote:
 On Tuesday, 6 August 2013 at 14:51:35 UTC, qznc wrote:
 My recent pull request [0] triggered some issue, which should
 get a bigger discussion:
 
 Should Phobos version N also compile with DMD N-1?
 
 In my opinion it should, because it makes Phobos development
 simpler. You don't need a self compiled dmd to fix bugs.
 
 However, reality sometimes requires exceptions. I understand
 that sometimes Phobos uses a feature of dmd HEAD. That is why
 I said "should", but not "must". ;)
 
 
 [0]
 https://github.com/D-Programming-Language/phobos/pull/1454/files#r5601514

This doesn't sound related to the problem discussed. Phobos N must compile with DMD N, that is a primary requirement. If Phobos N compiles with DMD N-1, great but it can't fail in DMD N.

Correct, Phobos N with DMD N is a "must". The question is, whether Phobos N with DMD N-1 is a "should". For the pull request, the question is what goes into the guidelines. That should be discussed there, instead of here in the forums. ;)

We're really not worrying about whether Phobos N compiles with DMD N-1. What matters is that the current Phobos compiles with the current dmd. And I really don't see much reason to do otherwise. Phobos is always released together with dmd, so you're never going to be using an older dmd with a newer Phobos unless you're building the yourself and don't keep them in sync. The autotester tests the latest master only, and it would just be extra overhead for little to no gain to make it test against the previous release as well, especially when we do make changes that are not expected to work with the previous release, and I don't expect that to change. It's likely to become less frequent overtime (and is already less frequent than it used to be), but there is no requirement that the current druntime or Phobos compile with the previous release of dmd, and I don't expect that there will ever be such a requirement. Anyone submitting pull requests to druntime or Phobos should be using the latest dmd, because that's what we're testing. If they happen to be able to get away with using the previous release, that's fine, but we make no guarantee that that will work and are not likely to put forth any effort to make it work. - Jonathan M Davis
Aug 06 2013
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 8/7/13, monarch_dodra <monarchdodra gmail.com> wrote:
 It's not just about new features in DMD that phobos wants to use.
 dmd bugs are fixed for phobos, I'd say, on a twice by week basis
 (roughly).

Yep. Backwards compatibility would be nice but currently we just can't afford it. But as far as I know isn't this the same for C++? E.g. I don't know whether a newer GCC version necessarily compiles an older C++ stdlib?
Aug 07 2013