RejectedSoftware Forums

Sign up

Compiler patch for complete dependencies output

Hi there!

I've patched dmd to output more complete dependency information, than it does now:

https://github.com/D-Programming-Language/dmd/pull/1839

Maybe you could have a look and comment whether you like it or what you don't like about it, so I can improve it. I hope that this pull won't rot like so many dmd pull requests, but will get merged soon. I think some discussion on the pull could help, because it signals to dmd maintainers that people care about this pull.

Thanks!

Best regards,
Robert

Re: Compiler patch for complete dependencies output

On Fri, 19 Apr 2013 12:26:04 GMT, Robert wrote:

Hi there!

I've patched dmd to output more complete dependency information, than it does now:

https://github.com/D-Programming-Language/dmd/pull/1839

Maybe you could have a look and comment whether you like it or what you don't like about it, so I can improve it. I hope that this pull won't rot like so many dmd pull requests, but will get merged soon. I think some discussion on the pull could help, because it signals to dmd maintainers that people care about this pull.

Yeah, it's really a pity how much work (at least seems to) get lost for DMD and its satellite projects because the response time sometimes is so high and things get out of date until the author is not willing to fix it up anymore...

My thoughts regarding the dependency output

  1. I like it and it seems to be the clean alternative to using the -v output, as rdmd does. Ideally, the format specification would appear at an official place so that other compilers can also adopt it.
  2. Isn't the "deps" prefix for each line redundant? (i.e. wouldn't "import", "file", etc. suffice?)
  3. I still very much favor the idea of letting dmd itself gather dependencies while it compiles, rather than performing an initial dummy build (but this is of course still useful for change tracking as soon as partial compilation works correctly - I've seen you and Dicebot have been quite busy to fix that...)

Hm... I just noticed that Andrej Mitrovic has already made a pull request for built-in recursive builds: https://github.com/D-Programming-Language/dmd/pull/1861

Re: Compiler patch for complete dependencies output

On Sat, 27 Apr 2013 17:46:41 GMT, Sönke Ludwig wrote:

On Fri, 19 Apr 2013 12:26:04 GMT, Robert wrote:

Hi there!

I've patched dmd to output more complete dependency information, than it does now:

https://github.com/D-Programming-Language/dmd/pull/1839

Maybe you could have a look and comment whether you like it or what you don't like about it, so I can improve it. I hope that this pull won't rot like so many dmd pull requests, but will get merged soon. I think some discussion on the pull could help, because it signals to dmd maintainers that people care about this pull.

Yeah, it's really a pity how much work (at least seems to) get lost for DMD and its satellite projects because the response time sometimes is so high and things get out of date until the author is not willing to fix it up anymore...

My thoughts regarding the dependency output

  1. I like it and it seems to be the clean alternative to using the -v output, as rdmd does. Ideally, the format specification would appear at an official place so that other compilers can also adopt it.

Would definitely be a good thing.

  1. Isn't the "deps" prefix for each line redundant? (i.e. wouldn't "import", "file", etc. suffice?)

Not really, because the output goes through stdout, depending on other switches (e.g. -v) there might be other output, with the "deps" prefix it is easy to filter the relevant information.

  1. I still very much favor the idea of letting dmd itself gather dependencies while it compiles, rather than performing an initial dummy build

I had the latter in mind, so dub initially just builds everything and tracks the dependencies while doing this, so on a change only relevant files would be recompiled.

(but this is of course still useful for change tracking as soon as partial compilation works correctly - I've seen you and Dicebot have been quite busy to fix that...)

Glad you noticed ;-), I just wanted to get the dependency output right for templates and patched the compiler so the needed information is available. Dicebot pointed out that with this information the linking errors due to incremental/all-at-once could also be fixed. The roadmap is to get the -deps switch in, then fix it together with the -deps=filename switch, then fix the linking errors, if Dicebot hasn't done it already. In the meantime, (the next 2 years or so :-( ), I'll hack on dub.

Hm... I just noticed that Andrej Mitrovic has already made a pull request for built-in recursive builds: https://github.com/D-Programming-Language/dmd/pull/1861

Yep, but the -deps output is still needed for avoiding needless builds.

Best regards,
Robert

P.S.: Sorry about no patches yet for library building, my girlfriend and I decided spontaneously to go on vacation for a few days, so I haven't done anything yet. I also have an exam to learn for, so it might take a while, but I am on it.

Re: Compiler patch for complete dependencies output

On Tue, 30 Apr 2013 20:09:14 GMT, Robert wrote:

  1. Isn't the "deps" prefix for each line redundant? (i.e. wouldn't "import", "file", etc. suffice?)

Not really, because the output goes through stdout, depending on other switches (e.g. -v) there might be other output, with the "deps" prefix it is easy to filter the relevant information.

I see.

(but this is of course still useful for change tracking as soon as partial compilation works correctly - I've seen you and Dicebot have been quite busy to fix that...)

Glad you noticed ;-), I just wanted to get the dependency output right for templates and patched the compiler so the needed information is available. Dicebot pointed out that with this information the linking errors due to incremental/all-at-once could also be fixed. The roadmap is to get the -deps switch in, then fix it together with the -deps=filename switch, then fix the linking errors, if Dicebot hasn't done it already. In the meantime, (the next 2 years or so :-( ), I'll hack on dub.

Sometimes wonders happen... who knows, maybe priorities change at some point and things faster than expected (got to stay optimistic ;)

Hm... I just noticed that Andrej Mitrovic has already made a pull request for built-in recursive builds: https://github.com/D-Programming-Language/dmd/pull/1861

Yep, but the -deps output is still needed for avoiding needless builds.

Agreed, the combination will finally provide a really nice day-to-day build experience.

P.S.: Sorry about no patches yet for library building, my girlfriend and I decided spontaneously to go on vacation for a few days, so I haven't done anything yet. I also have an exam to learn for, so it might take a while, but I am on it.

No problem at all, sorry also for the delayed answer. I didn't find your message for a while until I suddenly stumbled over it today. Also, at least the spontaneous vacation sounds like a very worthwhile alternative activity ;)

Re: Compiler patch for complete dependencies output

On Sat, 27 Apr 2013 17:46:41 GMT, Sönke Ludwig wrote:

  1. I still very much favor the idea of letting dmd itself gather dependencies while it compiles, rather than performing an initial dummy build (but this is of course still useful for change tracking as soon as partial compilation works correctly - I've seen you and Dicebot have been quite busy to fix that...)

It is a bit exaggerating :) There has been a hot discussion and with comments of Martin Nowak it now seems pretty clear what changes need to be done. But it means changing dmd AST model a bit and working with dmd sources is so unpleasant... Let's just say I am currently doing nothing about it but gathering courage to actually go and finish the job. Don't know how long it will take :)