www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - <rant> D's makefiles... </rant>

reply "Atila Neves" <atila.neves gmail.com> writes:
I did a `git up` on dmd, druntime and phobos, but phobos wouldn't 
build. Weird, but I had to fork phobos anyway, let me do that. 
Still wouldn't build. I tried `make clean`, can't remember 
exactly what happened but that didn't work either.

In the end I `rm -rf`ed dmd and druntime, recloned them, rebuilt 
them and _then_ phobos could build.

Feels like when I wrote Makefiles by hand, I'd forgotten it could 
get this bad.

Atila
Apr 13 2015
next sibling parent reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Mon, 2015-04-13 at 13:12 +0000, Atila Neves via Digitalmars-d wrote:
 I did a `git up` on dmd, druntime and phobos, but phobos wouldn't=20
 build. Weird, but I had to fork phobos anyway, let me do that.=20
 Still wouldn't build. I tried `make clean`, can't remember=20
 exactly what happened but that didn't work either.
=20
 In the end I `rm -rf`ed dmd and druntime, recloned them, rebuilt=20
 them and _then_ phobos could build.
=20
 Feels like when I wrote Makefiles by hand, I'd forgotten it could=20
 get this bad.
Make was a revelation and a revolution, in 1977. Things have progressed in= =20 the last 37 years. Sadly a large number of C, C++, D, etc. programmers seem= =20 to be convinced that build technology reached a pinnacle in 1992 and=20 stopped progressing. =20 --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t:+44 20 7585 2200 voip:sip: russel.winder ekiga.net 41 Buckmaster Road m:+44 7770 465 077 xmpp:russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype:russel_winder
Apr 13 2015
parent reply "deadalnix" <deadalnix gmail.com> writes:
On Monday, 13 April 2015 at 13:56:17 UTC, Russel Winder wrote:
 On Mon, 2015-04-13 at 13:12 +0000, Atila Neves via 
 Digitalmars-d wrote:
 I did a `git up` on dmd, druntime and phobos, but phobos 
 wouldn't build. Weird, but I had to fork phobos anyway, let me 
 do that. Still wouldn't build. I tried `make clean`, can't 
 remember exactly what happened but that didn't work either.
 
 In the end I `rm -rf`ed dmd and druntime, recloned them, 
 rebuilt them and _then_ phobos could build.
 
 Feels like when I wrote Makefiles by hand, I'd forgotten it 
 could get this bad.
Make was a revelation and a revolution, in 1977. Things have progressed in the last 37 years. Sadly a large number of C, C++, D, etc. programmers seem to be convinced that build technology reached a pinnacle in 1992 and stopped progressing.
To be fair, I've seen a lot of new build systems, but not a lot of better build system. I keep coming back to makefile, not because it is good, but because it is not worse than most of the shit I tried, and at least it is available everywhere and you find documentation about it on the net easily for everyone of its obscure corners.
Apr 13 2015
next sibling parent reply "weaselcat" <weaselcat gmail.com> writes:
On Monday, 13 April 2015 at 21:27:47 UTC, deadalnix wrote:
 To be fair, I've seen a lot of new build systems, but not a lot 
 of better build system.

 I keep coming back to makefile, not because it is good, but 
 because it is not worse than most of the shit I tried, and at 
 least it is available everywhere and you find documentation 
 about it on the net easily for everyone of its obscure corners.
For the amount of complaining about make, there sure has been little process in making a better make.
Apr 13 2015
parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Mon, 2015-04-13 at 21:35 +0000, weaselcat via Digitalmars-d wrote:
 
[…]
 For the amount of complaining about make, there sure has been 
 little process in making a better make.
Isn't that the whole point, something better than make is not make, it is something else. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Apr 15 2015
prev sibling parent "Paulo Pinto" <pjmlp progtools.org> writes:
On Monday, 13 April 2015 at 21:27:47 UTC, deadalnix wrote:
 On Monday, 13 April 2015 at 13:56:17 UTC, Russel Winder wrote:
 On Mon, 2015-04-13 at 13:12 +0000, Atila Neves via 
 Digitalmars-d wrote:
 I did a `git up` on dmd, druntime and phobos, but phobos 
 wouldn't build. Weird, but I had to fork phobos anyway, let 
 me do that. Still wouldn't build. I tried `make clean`, can't 
 remember exactly what happened but that didn't work either.
 
 In the end I `rm -rf`ed dmd and druntime, recloned them, 
 rebuilt them and _then_ phobos could build.
 
 Feels like when I wrote Makefiles by hand, I'd forgotten it 
 could get this bad.
Make was a revelation and a revolution, in 1977. Things have progressed in the last 37 years. Sadly a large number of C, C++, D, etc. programmers seem to be convinced that build technology reached a pinnacle in 1992 and stopped progressing.
To be fair, I've seen a lot of new build systems, but not a lot of better build system. I keep coming back to makefile, not because it is good, but because it is not worse than most of the shit I tried, and at least it is available everywhere and you find documentation about it on the net easily for everyone of its obscure corners.
Except it is not, unless you are writing pure POSIX makefiles and constraining yourself only to POSIX external commands and their respective arguments. This is exactly why tools like Autoconf came into existence. -- Paulo
Apr 13 2015
prev sibling next sibling parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 14/04/2015 1:12 a.m., Atila Neves wrote:
 I did a `git up` on dmd, druntime and phobos, but phobos wouldn't build.
 Weird, but I had to fork phobos anyway, let me do that. Still wouldn't
 build. I tried `make clean`, can't remember exactly what happened but
 that didn't work either.

 In the end I `rm -rf`ed dmd and druntime, recloned them, rebuilt them
 and _then_ phobos could build.

 Feels like when I wrote Makefiles by hand, I'd forgotten it could get
 this bad.

 Atila
Unfortunately druntime has a few issues that means that we can't outright remake druntime + phobos as dub packages. Which is what we really need to happen. And sooner or later the only things that can't be transferred over are some c libs in phobos, a few assembly files in druntime and of course dmd's backend. Oh and don't forget documentation generation... That won't play nicely with dub egggg.
Apr 13 2015
prev sibling next sibling parent reply "Dicebot" <public dicebot.lv> writes:
I want to replace those with D scripts for a reason.
Apr 13 2015
next sibling parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Mon, Apr 13, 2015 at 02:24:57PM +0000, Dicebot via Digitalmars-d wrote:
 I want to replace those with D scripts for a reason.
Now that dmd is dependent on an existing version of dmd to build, it should be no problem to replace the makefiles with D code. Everytime something like this happens I just see all the flaws of makefiles all over again, but unfortunately some people just refuse the acknowledge that makefiles are going the way of the dinosaur and it's time to move on. T -- Why ask rhetorical questions? -- JC
Apr 13 2015
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 4/13/15 7:34 AM, H. S. Teoh via Digitalmars-d wrote:
 On Mon, Apr 13, 2015 at 02:24:57PM +0000, Dicebot via Digitalmars-d wrote:
 I want to replace those with D scripts for a reason.
Now that dmd is dependent on an existing version of dmd to build, it should be no problem to replace the makefiles with D code. Everytime something like this happens I just see all the flaws of makefiles all over again, but unfortunately some people just refuse the acknowledge that makefiles are going the way of the dinosaur and it's time to move on.
A thought: any makefile replacement should make sure there's an equivalent to "-j". My personal feeling: the build is really low on the priority list no matter how you sort it - except "least impact stuff first" :o) - and replacing makefiles with even the perfect solution won't improve anything measurably. Atila: "make clean" should work. Must have been something weird on your system. Andrei
Apr 13 2015
parent reply "Atila Neves" <atila.neves gmail.com> writes:
On Monday, 13 April 2015 at 20:41:20 UTC, Andrei Alexandrescu 
wrote:
 On 4/13/15 7:34 AM, H. S. Teoh via Digitalmars-d wrote:
 On Mon, Apr 13, 2015 at 02:24:57PM +0000, Dicebot via 
 Digitalmars-d wrote:
 I want to replace those with D scripts for a reason.
Now that dmd is dependent on an existing version of dmd to build, it should be no problem to replace the makefiles with D code. Everytime something like this happens I just see all the flaws of makefiles all over again, but unfortunately some people just refuse the acknowledge that makefiles are going the way of the dinosaur and it's time to move on.
A thought: any makefile replacement should make sure there's an equivalent to "-j".
The "-j" option should be there for tweaking only, by default I expect a modern tool to just use as many threads as I have cores. Which of course is exactly what Ninja does.
 Atila: "make clean" should work. Must have been something weird 
 on your system.
Maybe there was something weird, but said weirdness was caused by the existing build system. If "make clean" is ever needed, it's proof the build system is broken. CMake doesn't even generate a "clean" target. Of course, this is made a lot easier by the fact that CMake encourages and enables out-of-tree builds, so if a clean is needed just delete the build directory. Atila
Apr 14 2015
next sibling parent reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 2015-04-14 at 08:53 +0000, Atila Neves via Digitalmars-d wrote:
 
[…]
 The "-j" option should be there for tweaking only, by default I 
 expect a modern tool to just use as many threads as I have cores. 
 Which of course is exactly what Ninja does.
N-1 not N on a system you are using as a workstation. N on a compiler server, no problem. Waf chooses N and it makes the workstation unusable whilst the compilation is happening. […] -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Apr 14 2015
next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 14 April 2015 at 12:07:18 UTC, Russel Winder wrote:
 On Tue, 2015-04-14 at 08:53 +0000, Atila Neves via 
 Digitalmars-d wrote:
 
[…]
 The "-j" option should be there for tweaking only, by default 
 I expect a modern tool to just use as many threads as I have 
 cores. Which of course is exactly what Ninja does.
N-1 not N on a system you are using as a workstation. N on a compiler server, no problem. Waf chooses N and it makes the workstation unusable whilst the compilation is happening. […]
That really depends on how your process/thread scheduler is set up. I often work with all my cores maxed out, the UI all runs smooth enough, but that's on OS X. On linux I occasionally ran in to a bit of slowness with firefox, but terminals, vim, emacs etc. all worked fine, but then that's with xmonad as a WM, so perhaps my experience isn't typical. Also, I have often got faster compile-times using more more processes than cores, which I put down to disk latency hiding but I could be wrong.
Apr 14 2015
prev sibling next sibling parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Tuesday, 14 April 2015 at 12:07:18 UTC, Russel Winder wrote:
 On Tue, 2015-04-14 at 08:53 +0000, Atila Neves via 
 Digitalmars-d wrote:
 
[…]
 The "-j" option should be there for tweaking only, by default 
 I expect a modern tool to just use as many threads as I have 
 cores. Which of course is exactly what Ninja does.
N-1 not N on a system you are using as a workstation. N on a compiler server, no problem. Waf chooses N and it makes the workstation unusable whilst the compilation is happening.
That's the typical distinction between batch and interactive processes; today's schedulers shouldn't have trouble handling this. If they do, there's still process priorities/nice values to adjust.
Apr 14 2015
parent reply "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= writes:
On Tuesday, 14 April 2015 at 12:21:19 UTC, Marc Schütz wrote:
 That's the typical distinction between batch and interactive 
 processes; today's schedulers shouldn't have trouble handling 
 this.  If they do, there's still process priorities/nice values 
 to adjust.
RAM.
Apr 14 2015
parent "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Tuesday, 14 April 2015 at 13:58:31 UTC, Ola Fosheim Grøstad 
wrote:
 On Tuesday, 14 April 2015 at 12:21:19 UTC, Marc Schütz wrote:
 That's the typical distinction between batch and interactive 
 processes; today's schedulers shouldn't have trouble handling 
 this.  If they do, there's still process priorities/nice 
 values to adjust.
RAM.
Well, if RAM is the problem, it is pure coincidence that it should be ok with N-1 jobs, while N is already one too many.
Apr 14 2015
prev sibling next sibling parent Jacob Carlborg <doob me.com> writes:
On 2015-04-14 14:07, Russel Winder via Digitalmars-d wrote:

 Waf chooses N and it makes the workstation unusable whilst the
 compilation is happening.
 […]
I have four cores (if I recall correctly) and I always compile DMD with -j 16 without any problems. -- /Jacob Carlborg
Apr 14 2015
prev sibling parent "deadalnix" <deadalnix gmail.com> writes:
On Tuesday, 14 April 2015 at 12:07:18 UTC, Russel Winder wrote:
 On Tue, 2015-04-14 at 08:53 +0000, Atila Neves via 
 Digitalmars-d wrote:
 
[…]
 The "-j" option should be there for tweaking only, by default 
 I expect a modern tool to just use as many threads as I have 
 cores. Which of course is exactly what Ninja does.
N-1 not N on a system you are using as a workstation. N on a compiler server, no problem. Waf chooses N and it makes the workstation unusable whilst the compilation is happening. […]
Sounds like your scheduler is messing up. Compiling is CPU intensive when UI isn't. Meaning the compiling process should burns its CPU time while UI process is mostly idle. Meaning UI thread should take over when it needs to, as per most scheduler policies.
Apr 14 2015
prev sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 4/14/15 1:53 AM, Atila Neves wrote:
 On Monday, 13 April 2015 at 20:41:20 UTC, Andrei Alexandrescu wrote:
 On 4/13/15 7:34 AM, H. S. Teoh via Digitalmars-d wrote:
 On Mon, Apr 13, 2015 at 02:24:57PM +0000, Dicebot via Digitalmars-d
 wrote:
 I want to replace those with D scripts for a reason.
Now that dmd is dependent on an existing version of dmd to build, it should be no problem to replace the makefiles with D code. Everytime something like this happens I just see all the flaws of makefiles all over again, but unfortunately some people just refuse the acknowledge that makefiles are going the way of the dinosaur and it's time to move on.
A thought: any makefile replacement should make sure there's an equivalent to "-j".
The "-j" option should be there for tweaking only, by default I expect a modern tool to just use as many threads as I have cores. Which of course is exactly what Ninja does.
Cool. BTW threads should be more than cores there, you have more devices working in parallel than the cores.
 Atila: "make clean" should work. Must have been something weird on
 your system.
Maybe there was something weird, but said weirdness was caused by the existing build system. If "make clean" is ever needed, it's proof the build system is broken. CMake doesn't even generate a "clean" target. Of course, this is made a lot easier by the fact that CMake encourages and enables out-of-tree builds, so if a clean is needed just delete the build directory.
No need to argue against make's shortcomings with me :o). Andrei
Apr 14 2015
prev sibling parent "Atila Neves" <atila.neves gmail.com> writes:
On Monday, 13 April 2015 at 14:24:58 UTC, Dicebot wrote:
 I want to replace those with D scripts for a reason.
Me too. Let's see if we can actually agree on how they'd end up looking, huh? ;) Atila
Apr 13 2015
prev sibling parent "deadalnix" <deadalnix gmail.com> writes:
On Monday, 13 April 2015 at 13:12:23 UTC, Atila Neves wrote:
 I did a `git up` on dmd, druntime and phobos, but phobos 
 wouldn't build. Weird, but I had to fork phobos anyway, let me 
 do that. Still wouldn't build. I tried `make clean`, can't 
 remember exactly what happened but that didn't work either.

 In the end I `rm -rf`ed dmd and druntime, recloned them, 
 rebuilt them and _then_ phobos could build.

 Feels like when I wrote Makefiles by hand, I'd forgotten it 
 could get this bad.

 Atila
I'd bet you had a dmd.conf left somewhere. I have one, all my build are broken.
Apr 13 2015