Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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
  • Loading branch information
lance committed May 19, 2016
commit 32f2858c60f20337603cbb2f0d2a037936294fed
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ ADDONS_BINDING_GYPS := \
$(wildcard test/addons/*/binding.gyp))

# Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) \
# Depends on node-gyp package.json so that build-addons is (re)executed when
# node-gyp is updated as part of an npm update.
test/addons/.buildstamp: deps/npm/node_modules/node-gyp/package.json $(ADDONS_BINDING_GYPS) \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the Makefile doesn’t always adhere to it, but ideally, lines should be < 80 characters in all files. You can just add the new entry like the other ones here using trailing \

deps/uv/include/*.h deps/v8/include/*.h \
src/node.h src/node_buffer.h src/node_object_wrap.h \
test/addons/.docbuildstamp
Expand All @@ -163,7 +165,7 @@ test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) \
# if the subprocess touched anything so it pessimistically assumes that
# .buildstamp and .docbuildstamp are out of date and need a rebuild.
# Just goes to show that recursive make really is harmful...
# TODO(bnoordhuis) Force rebuild after gyp or node-gyp update.
# TODO(bnoordhuis) Force rebuild after gyp update.
build-addons: $(NODE_EXE) test/addons/.buildstamp

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