-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: make doc-only -> fallback to user binary #6906
doc: make doc-only -> fallback to user binary #6906
Conversation
out/doc/api/%.json: doc/api/%.md | ||
$(NODE) tools/doc/generate.js --format=json $< > $@ | ||
[ $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json) |
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.
This won’t really work like you want it to, [ $(foobar) ]
only checks that foobar
is nonempty, not that it corresponds . It should probably be something like [ -x "$(NODE)" ]
to make sure that the file is there + executable.
Or you just leave the check out, ||
takes care of a failure in the first version anyway…
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.
Didn't know about -x. Thought -n, -z or nothing at all would be appropriate . amended
@addaleax output is ugly though.
Do you think having it in |
@eljefedelrodeodeljefe Makefile output is never truly beautiful. :) It works, so LGTM. |
cc @nodejs/build extending #3888 a little to fallback to user binary. |
This seems reasonable enough. Works on my machine. If we are going to be doing this we may want to give some sort of better error if node doesn't exist on the system. LGTM either way. |
Landed in c111cf2. I have some work for error handling in mind. For now I think something like "node not found" is okay and better than "./node not found" |
After the nodejs#3888 it was not possible to "make doc-only" in some situations. This now fallsback to any installed node version and throws "node not found" in error case. Ref: nodejs#3888 PR-URL: nodejs#6906 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
After the nodejs#3888 it was not possible to "make doc-only" in some situations. This now fallsback to any installed node version and throws "node not found" in error case. Ref: nodejs#3888 PR-URL: nodejs#6906 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
Affected core subsystem(s)
build
,doc
Description of change
Fixes:
When checking out a fresh clone or
rm -rf out/
orrm ./node
make doc-only was not working (Mac OS), failing to find./node
. I think this has slipped, because likely contributors have at least some binary, from e.g. a build of another branch still inout/
.This then would check if
$(NODE)
was set correctly take it or fallback to a user pre-installednode
binary.Bash syntax and implementation is a little too clever unfortunately, but I guess that won't hurt anyone there.