Conversation
|
Thanks for diagnosing the problem, @shindere and sorry that my patch introduced them. However, it's not the right fix:
|
|
Hello David, many thanks for your prompt response!
David Allsopp (2019/04/18 05:25 -0700):
Thanks for diagnosing the problem, @shindere and sorry that my patch
introduced them.
Well as a reviewer I am responsible for that, too! :)
However, it's not the right fix:
- `TARGETHEADERPROGRAM` should be defined, and it should be being used
- - the `target_` programs are not correct at the moment (my mistake).
Do you mean that these target programs should be built even if the
TARGETBINDIR stuff is not enabled?
- It was intentional to add `Makefile` as a prerequisite, since
- `Makefile` contains the code to construct the programs (`echo`
- statements, etc.). The alternative is to put the generation
- instructions for the headers into a `Makefile` fragment (e.g.
- `Makefile.headers`) and expressly depend on that which would stop it
- from rebuilding them when another part of `Makefile` is updated.
Perhaps that would make more sense, yes.
In general, if you update the build system, you should invalidate most
of what you've already built...
Well but then it would mean that we should add quite a lot of
dependencies in a lot of places. We started to discuss this with
@damiendoligez and I think he was not very warm for doing that.
|
I believe that's correct, yes - or at least that's what the original version was doing. At the moment, I think it's building the
I agree that to do it for everything would be excessive, but it seems worth having it for the few things where the code really is the |
If you update the build system, you need to do |
|
David Allsopp (2019/04/18 05:51 -0700):
> - `TARGETHEADERPROGRAM` should be defined, and it should be being used
> - - the `target_` programs are not correct at the moment (my mistake).
> Do you mean that these target programs should be built even if the
> TARGETBINDIR stuff is not enabled?
I believe that's correct, yes - or at least that's what the original
version was doing. At the moment, I think it's building the `target_`
header files but using the wrong objects (so that'll have `BINDIR`
instead of `TARGET_BINDIR` embedded in them).
I'm sorry, but I'm unclear about how TARGETHEADERPROGRAM should be
defined, then?
> - It was intentional to add `Makefile` as a prerequisite, since
> - `Makefile` contains the code to construct the programs (`echo`
> - statements, etc.). The alternative is to put the generation
> - instructions for the headers into a `Makefile` fragment (e.g.
> - `Makefile.headers`) and expressly depend on that which would stop it
> - from rebuilding them when another part of `Makefile` is updated.
> Perhaps that would make more sense, yes.
> In general, if you update the build system, you should invalidate most
> of what you've already built...
> Well but then it would mean that we should add quite a lot of
> dependencies in a lot of places. We started to discuss this with
> @damiendoligez and I think he was not very warm for doing that.
I agree that to do it for everything would be excessive, but it seems
worth having it for the few things where the code really is the
`Makefile` (`utils/config.ml`, etc.)
I think you also added dependencies when the header programs are
compiled from C, in which case the code itself is not really in the
Makefile, right?
|
|
BTW, why define a And at line 227, shouldn't this be |
There were a few buggy rules in stdlib/Makefile, fix them.
4e35105 to
d4567a5
Compare
|
I just pushed a fix which I think is both correct and minimal.
|
I can have a look at this (once I'm done rehearsing)!
Yes - but the recipe is also non-trivial. My original question with this was as to what bug removing that dependency was fixing, and it still appears to be none (it's just a consequence of the faulty pattern rule). I must confess I'm rather weary of having to argue against a change which makes the build system worse, and not at all convinced that having the build system wrong in every place is somehow superior to it being right only in some places. I added that dependency while developing the original PR because I needed it (while changing the recipe), it was correct, and because it meant I didn't have to temporarily break other parts of the build system in order to see that @damiendoligez: |
|
@shindere - Bach got in the way of my writing that comment and posting it, and I see your fix commit! I agree that for now it can safely stay on the assumption that the target and host use the same kind of header program, even though that's likely to change soon (non-trivially - I expect that when cross-compiling correctly lands, it will be normal to want Cygwin or WSL-compiled ocamlc generating native binaries) |
|
AppVeyor is being strange today, which I don't think is related to this PR - but it needs to go through precheck for the code paths to be tested (since it's only Cygwin which builds this way) |
|
(@shindere - is it is possible for me to start a precheck, but also cause you to be emailed the logs for the build, as I know collecting them separately is awkward?) |
|
Hi again David,
David Allsopp (2019/04/18 07:37 -0700):
I can have a look at this (once I'm done rehearsing)!
I hope it's okay now.
Re:the dependency on Makefile, I removed my commit that got rid of it
from the PR. It's true that it was not removing a bug and I am fine with
the PR in its present state, if that's fine with you.
|
|
David Allsopp (2019/04/18 07:41 -0700):
AppVeyor is being strange today, which I don't think is related to
this PR - but it needs to go through precheck for the code paths to be
tested (since it's only Cygwin which builds this way)
Well we can do a precheck, sure. Just keep in mind that as far as the
bug reported by Xavier is concerned, it own't be exercised by precheck
so I don't know how important it is to do that since the change is
really small.
|
|
David Allsopp (2019/04/18 07:42 -0700):
***@***.*** - is it is possible for me to start a precheck, but also
cause you to be emailed the logs for the build, as I know collecting
them separately is awkward?)
I don't think that is possible, unfortunately.
Would you mind starting the precheck and receiving the e-mails?
If you don't want to I can do it.
|
|
@shindere - I more meant that CI here (i.e. AppVeyor) doesn't build Cygwin at all, so the build recipe isn't tested either, since the native Windows ports still just duplicate those target header files. However, I tested Cygwin myself, so I'll go ahead and merge this one now. |
|
Okay thanks a lot for having tested and merged!
|
PR#2267 and in particular commit 278e5ab has introduced the use
of the
TARGETHEADERPROGRAMvariable which is actually never defined.This confuses make on system where hashbbang scripts are not supported,
because it introduces a rule saying that each file whose name ends with
"o" (or "obj") (no matter whether there is a dot before or not)
can be build from either
header.corheadernt.c.Combined with make's implicit rules, this leads to make trying to
update files like
.depend,Makefile.commonandMakefile.configas soon as the source of the header program is more recent than they are.
Similarly, since
Makefileitself is declared as a prerequisite,make also tries to rebuild it whenever the source file for the header
program is newer.
This PR fixes this by removing
Makefileof the lists ofprerequisites and protecting the rule that uses
TARGETHEADERPROGRAMso that it is used only when the variable is non-empty.