build,test: make building addon tests less fragile#17407
build,test: make building addon tests less fragile#17407bnoordhuis wants to merge 6 commits intonodejs:masterfrom
Conversation
|
Awesome, I'll get that CI stuff working post-haste
Can you elaborate? Is the point that if nothing has changed it doesn't still do a load of stuff? |
There was a problem hiding this comment.
Should we float the gyp changes in a separate commit in case we lose them in a future gyp update?
There was a problem hiding this comment.
Good idea. I'll split it out before landing.
Yep. Right now it always does this: |
Makefile
Outdated
There was a problem hiding this comment.
cc @nodejs/build in case there are any jobs directly running the build-ci target.
Makefile
Outdated
There was a problem hiding this comment.
Does $(ALL_DEPS) include out/Makefile? Since this target recursively executes make it should have a dependency on the makefile.
Makefile
Outdated
There was a problem hiding this comment.
For some reason the CI is complaining
+ make run-ci -j 2
make -C out BUILDTYPE=Release V=1
make[1]: *** out: No such file or directory. Stop.
Makefile:91: *** Missing or stale config.gypi, please run ./configure. Stop.
Build step 'Execute shell' marked build as failure
|
Ping @bnoordhuis This seems pretty nice but since the Makefile is a place where things change often, I hope we can get this done fast and land it. |
I don't recall saying I was going to look at this. I'm happy to, but the CI we were talking about was a build with cmake. CI fails as this needs a rebase. https://ci.nodejs.org/job/node-test-commit/14743/console |
266bb7e to
3416edf
Compare
|
Rebased and I decided to check in the documentation add-ons. They don't change often enough to go through the trouble of generating them dynamically. Too race-y, too special.
|
fc07832 to
e496053
Compare
|
Glorious green! Please (re)review. The biggest change from the previous changeset:
|
Makefile
Outdated
There was a problem hiding this comment.
Is config.gypi intentionally dropped here?
There was a problem hiding this comment.
Yes, but it's no longer necessary. I've pushed up a commit that restores it.
There was a problem hiding this comment.
I take back what I wrote - it's still necessary because of the config.gypi: configure rule below. But since it's correct to depend on config.gypi here, I'll just remove the other rule.
e496053 to
05ca6c7
Compare
doc/api/addons.md
Outdated
There was a problem hiding this comment.
Is there a way we could validate this? Maybe a test that contains the shasum of everything inside a js code block in this file, that you have to update when it changes.
I guess tools/doc/addon-verify.js would be the place to do it.
There was a problem hiding this comment.
I've added a commit that adds a --check flag to addon-verify.js and calls that from make test.
05ca6c7 to
2151423
Compare
Makefile
Outdated
There was a problem hiding this comment.
This should be marked as phony.
2151423 to
39931b4
Compare
|
With the -bash-4.2$ git clean -fdX
-bash-4.2$ make
make: *** No rule to make target `config.gypi', needed by `out/Makefile'. Stop.
-bash-4.2$Is there a reason the makefile doesn't just run |
It used to and it was supremely annoying because it overwrote your settings. I removed it a few years ago. edit: to expand on that, you'd get situations like these: |
Is there a reason we can't have the config.gypi rule with these changes? I'm a fan of the more helpful error message.
How about only generating a new config.gypi if there isn't one there already? |
Ensure `common.tmpDir` exists before trying to chdir into it. Fixes a "ENOENT: no such file or directory, uv_chdir" error when the temporary directory is removed before running the test. PR-URL: #17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Ensure `common.tmpDir` exists before trying to chdir into it. Fixes a "ENOENT: no such file or directory, uv_chdir" error when the temporary directory is removed before running the test. PR-URL: #17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Ensure `common.tmpDir` exists before trying to chdir into it. Fixes a "ENOENT: no such file or directory, uv_chdir" error when the temporary directory is removed before running the test. PR-URL: #17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Make GYP write a .deps file in the top-level directory that we can use in the Makefile to get a proper dependency chain for the `node` target. Preparatory work for getting rid of recursive make invocations. PR-URL: nodejs#17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Make the script synchronous and clean it up. This is preparatory work for follow-ups commits. PR-URL: nodejs#17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
* Get rid of recursive `make` when building the node binary. An earlier commit makes GYP write out rules that we can use for proper dependency tracking. * Use module name 'binding' in addons.md and addons-napi/*/binding.gyp. This massively simplifies the logic for generating the build rules. * Check in auto-generated add-on tests from `doc/api/addons.md`. The files change rarely and generating them dynamically causes no end of race conditions and special-casing during the build. PR-URL: nodejs#17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Add a `--check` flag to `tools/doc/addon-verify.js` and use that in the `make test` target to determine if the generated files in `test/addons` are fresh or stale. PR-URL: nodejs#17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Ensure `common.tmpDir` exists before trying to chdir into it. Fixes a "ENOENT: no such file or directory, uv_chdir" error when the temporary directory is removed before running the test. PR-URL: nodejs#17407 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This reverts commit 2cb9e2a. Reverted along with d9b59de as this introduces freshness checks that are too stringent without the comprehensive dependency checking of introduced in d9b59de so `make test` won't work with this. Ref: nodejs#17407 PR-URL: nodejs#18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This reverts commit d9b59de. Breaks downloadable source tarball builds as we remove some files prior to creating a tarball but those files are included in the comprehensive list of dependencies listed in .deps. Ref: nodejs#17407 PR-URL: nodejs#18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This reverts commit c668263. Reverted along with d9b59de as this breaks compilation from downloadable source tarballs. Ref: nodejs#17407 PR-URL: nodejs#18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This reverts commit 920c132. Reverted along with d9b59de as this breaks compilation from downloadable source tarballs. Ref: nodejs#17407 PR-URL: nodejs#18287 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
makefor building the node binaryThis is prep work for a dusted off and super-powered version of #12231.
makefinally works as intended now:And
make -j8 test(finally!) builds add-ons in parallel.CI: https://ci.nodejs.org/job/node-test-pull-request/11830/CI: https://ci.nodejs.org/job/node-test-pull-request/11831/