-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: fix config.gypi target #9053
Conversation
The config.gypi target has a recipe that uses the control function error to report if the config.gypi file is missing or if it is stale (the configure file was updated which is a prerequisite of this rule). GNU make has two phases, immediate and deferred. During the first phase it will expand any variables or functions as the makefile is parsed. The recipe in this case is a shell if statement, which is a deferred construct. But the control function $(error) is an immediate construct which will cause the makefile processing to stop during the first phase of the Make process. If I understand this correctly the only possible outcome of this rule is the "Stale config.gypi, please re-run ./configure" message which will be done in the first phase and then exit. The shell condition will not be considered. So it will never report that the config.gypi is missing. I've updated the recipe to use the echo command and an exit status. The downside of this is that the error message is not as nice. Current error message: Makefile:81: *** Stale config.gypi, please re-run ./configure. Stop. "New error message": $ make config.gypi Stale config.gypi, please re-run ./configure make: *** [config.gypi] Error 1 To verify the stale config.gypi: $ touch configure $ make To verfify that config.gypi is missing: $ rm config.gypi $ make
You could simply change the message to "Missing or stale config.gypi, please run configure". :-) |
I'd like that :) Would that be acceptable? |
It's acceptable to me - but I may be biased. :-) |
@bnoordhuis :) I'm adding that as an option and let other decide what they prefer. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a suggestion.
else | ||
$(error No $@, please run ./configure first) | ||
fi | ||
$(error Missing or stale $@, please re-run ./$<) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiniest of nits: maybe s/re-run/run/ - in the 'missing' case, you probably haven't run configure before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks
The config.gypi target has a recipe that uses the control function error to report if the config.gypi file is missing or if it is stale (the configure file was updated which is a prerequisite of this rule). GNU make has two phases, immediate and deferred. During the first phase it will expand any variables or functions as the makefile is parsed. The recipe in this case is a shell if statement, which is a deferred construct. But the control function $(error) is an immediate construct which will cause the makefile processing to stop during the first phase of the Make process. If I understand this correctly the only possible outcome of this rule is the "Stale config.gypi, please re-run ./configure" message which will be done in the first phase and then exit. The shell condition will not be considered. So it will never report that the config.gypi is missing. bnoordhuis suggested that we simply change this into a single error message: "Missing or stale config.gypi, please run configure" PR-URL: nodejs#9053 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Landed in: 0ed6338 |
The config.gypi target has a recipe that uses the control function error to report if the config.gypi file is missing or if it is stale (the configure file was updated which is a prerequisite of this rule). GNU make has two phases, immediate and deferred. During the first phase it will expand any variables or functions as the makefile is parsed. The recipe in this case is a shell if statement, which is a deferred construct. But the control function $(error) is an immediate construct which will cause the makefile processing to stop during the first phase of the Make process. If I understand this correctly the only possible outcome of this rule is the "Stale config.gypi, please re-run ./configure" message which will be done in the first phase and then exit. The shell condition will not be considered. So it will never report that the config.gypi is missing. bnoordhuis suggested that we simply change this into a single error message: "Missing or stale config.gypi, please run configure" PR-URL: #9053 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
The config.gypi target has a recipe that uses the control function error to report if the config.gypi file is missing or if it is stale (the configure file was updated which is a prerequisite of this rule). GNU make has two phases, immediate and deferred. During the first phase it will expand any variables or functions as the makefile is parsed. The recipe in this case is a shell if statement, which is a deferred construct. But the control function $(error) is an immediate construct which will cause the makefile processing to stop during the first phase of the Make process. If I understand this correctly the only possible outcome of this rule is the "Stale config.gypi, please re-run ./configure" message which will be done in the first phase and then exit. The shell condition will not be considered. So it will never report that the config.gypi is missing. bnoordhuis suggested that we simply change this into a single error message: "Missing or stale config.gypi, please run configure" PR-URL: #9053 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
The config.gypi target has a recipe that uses the control function error to report if the config.gypi file is missing or if it is stale (the configure file was updated which is a prerequisite of this rule). GNU make has two phases, immediate and deferred. During the first phase it will expand any variables or functions as the makefile is parsed. The recipe in this case is a shell if statement, which is a deferred construct. But the control function $(error) is an immediate construct which will cause the makefile processing to stop during the first phase of the Make process. If I understand this correctly the only possible outcome of this rule is the "Stale config.gypi, please re-run ./configure" message which will be done in the first phase and then exit. The shell condition will not be considered. So it will never report that the config.gypi is missing. bnoordhuis suggested that we simply change this into a single error message: "Missing or stale config.gypi, please run configure" PR-URL: #9053 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
build
Description of change
The config.gypi target has a recipe that uses the control function error
to report if the config.gypi file is missing or if it is stale (the
configure file was updated which is a prerequisite of this rule).
GNU make has two phases, immediate and deferred. During the first phase
it will expand any variables or functions as the makefile is parsed.
The recipe in this case is a shell if statement, which is a deferred
construct. But the control function $(error) is an immediate construct
which will cause the makefile processing to stop during the first phase
of the Make process.
If I understand this correctly the only possible outcome of this rule is
the "Stale config.gypi, please re-run ./configure" message which will
be done in the first phase and then exit. The shell condition will not
be considered. So it will never report that the config.gypi is missing.
I've updated the recipe to use the echo command and an exit status. The
downside of this is that the error message is not as nice.
Current error message:
Makefile:81: *** Stale config.gypi, please re-run ./configure. Stop.
"New error message":
$ make config.gypi
Stale config.gypi, please re-run ./configure
make: *** [config.gypi] Error 1
To verify the stale config.gypi:
$ touch configure
$ make
To verfify that config.gypi is missing:
$ rm config.gypi
$ make