Skip to content

Commit 0025934

Browse files
lanceFishrock123
authored andcommitted
build: update build-addons when node-gyp changes
We can tell when `node-gyp` is changed by creating a prerequisite on `deps/npm/node_modules/node-gyp/package.json`. The prerequisite is added to the `test/addons/.buildstamp` since `build-addons` is .PHONY. Testing for this change was entirely manual. $ make clean test-build # Initial build $ make test-build # Make sure build-addons doesn't rebuild $ touch deps/npm/node_modules/node-gyp/package.json # simulate change $ make test-build # Ensure build-addons rebuilds PR-URL: #6787 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 5faf60b commit 0025934

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ ADDONS_BINDING_GYPS := \
144144
$(wildcard test/addons/*/binding.gyp))
145145

146146
# Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
147-
test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) \
147+
# Depends on node-gyp package.json so that build-addons is (re)executed when
148+
# node-gyp is updated as part of an npm update.
149+
test/addons/.buildstamp: deps/npm/node_modules/node-gyp/package.json \
150+
$(ADDONS_BINDING_GYPS) \
148151
deps/uv/include/*.h deps/v8/include/*.h \
149152
src/node.h src/node_buffer.h src/node_object_wrap.h \
150153
test/addons/.docbuildstamp
@@ -163,7 +166,7 @@ test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) \
163166
# if the subprocess touched anything so it pessimistically assumes that
164167
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
165168
# Just goes to show that recursive make really is harmful...
166-
# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
169+
# TODO(bnoordhuis) Force rebuild after gyp update.
167170
build-addons: $(NODE_EXE) test/addons/.buildstamp
168171

169172
test-gc: all test/gc/node_modules/weak/build/Release/weakref.node

0 commit comments

Comments
 (0)