Open sam-github opened 5 years ago
An additional issue:
An additional issue:
make
based buildThis is pretty painful on machines with slow link times while testing CI builds (so, not allowed to use ninja), because make test
does a relink every time.
I have been poking at this a bit, and it appears to be a bug in the V8 gyp files (@nodejs/v8-update), they seem to do some actions without considering whether deps have changed. Following is a rebuild (after just having done 5 clean builds). Is the root cause of this that Generating inspector protocol sources from protocol json
has no deps?
% make -C out -j1
make: Entering directory '/home/sam/w/core/lts/out'
TOUCH dc2a6a8f2bf222b5a02a9df3d748ab02b9f73ccf.intermediate
ACTION _home_sam_w_core_lts_tools_v8_gypfiles_v8_gyp_run_torque_target_run_torque_action dc2a6a8f2bf222b5a02a9df3d748ab02b9f73ccf.intermediate
TOUCH 8ce4ae39fa160c52d3938e994929629c6a3c704e.intermediate
ACTION Generating inspector protocol sources from protocol json 8ce4ae39fa160c52d3938e994929629c6a3c704e.intermediate
TOUCH f12aef6ca9be3b6903ccca9065c46321958e5d57.intermediate
ACTION generating: "/home/sam/w/core/lts/out/Release/obj.target/v8_version/geni/snapshot.cc" "/home/sam/w/core/lts/out/Release/obj.target/v8_version/geni/embedded.S" f12aef
6ca9be3b6903ccca9065c46321958e5d57.intermediate
CXX(target) /home/sam/w/core/lts/out/Release/obj.target/v8_snapshot/geni/snapshot.o
CC(target) /home/sam/w/core/lts/out/Release/obj.target/v8_snapshot/geni/embedded.o
AR(target) /home/sam/w/core/lts/out/Release/obj.target/tools/v8_gypfiles/libv8_snapshot.a
TOUCH /home/sam/w/core/lts/out/Release/obj.target/tools/v8_gypfiles/v8_maybe_snapshot.stamp
TOUCH d91d7401cc24d87f844dbc275fc67fb1cbbc9681.intermediate
ACTION Generating node protocol sources from protocol json d91d7401cc24d87f844dbc275fc67fb1cbbc9681.intermediate
LINK(target) /home/sam/w/core/lts/out/Release/cctest
LINK(target) /home/sam/w/core/lts/out/Release/mkcodecache
LINK(target) /home/sam/w/core/lts/out/Release/node_mksnapshot
ACTION _home_sam_w_core_lts_node_gyp_node_target_run_mkcodecache /home/sam/w/core/lts/out/Release/obj/gen/node_code_cache.cc
ACTION _home_sam_w_core_lts_node_gyp_node_target_node_mksnapshot /home/sam/w/core/lts/out/Release/obj/gen/node_snapshot.cc
CXX(target) /home/sam/w/core/lts/out/Release/obj.target/node/gen/node_code_cache.o
CXX(target) /home/sam/w/core/lts/out/Release/obj.target/node/gen/node_snapshot.o
LINK(target) /home/sam/w/core/lts/out/Release/node
rm f12aef6ca9be3b6903ccca9065c46321958e5d57.intermediate dc2a6a8f2bf222b5a02a9df3d748ab02b9f73ccf.intermediate 8ce4ae39fa160c52d3938e994929629c6a3c704e.intermediate d91d7401c
c24d87f844dbc275fc67fb1cbbc9681.intermediate
make: Leaving directory '/home/sam/w/core/lts/out'
The makefiles generated by gyp are not working for development (they work better for single-shot CI builds). Perhaps I'm missing something, please tell me if I am, but I've done some asking around to people who know the gyp system, and have some agreement on these points.
make node; make node
Make should do nothing if no source code has been changed, butmake node
relinks bothnode
andcctest
(!?) every time it is run.make -C out node
is faster, ~but~ and builds just node, not cctest, but it does it even if no source has changed. However, its build/dependency tree is incomplete! It doesn't run js2c so if any js source files are changed they will not be built-in with js2c. Fast and wrong is worse than slow.make -C out/Release node
as abovemake -j4 node; make -j1 test
often required. parallel make is not working for test. Various symptoms of brokenness occur (irc has some discussion). Sounds like this could be related to the dependency relationships not being correctly specified, causing build rules to run in parallel when they cannot, and thus be racy../configure --shared-openssl-includes
will cause openssl include paths to be passed to dependencies that don't use openssl. This might appear harmless, but it (for example) causes ccache to rebuild icu, even though icu doesn't use openssl. Possible fix: https://github.com/nodejs/node/blob/eef6504cf7b95ada170ec9878089ce57fde551d8/common.gypi#L549-L560, addOPENSSL_THREADS
to the else clause (I haven't tried yet).Ninja notes:
Ninja (
./configure --ninja
) doesn't have the above problems for building, its dependency tree is correct (it builds nothing when nothing has changed, and it reruns js2c when js files have changed).However, it is either incomplete or not integrated with the rest of the build (I'm not sure how its intended to work). It doesn't make the top-level
node
symlink (at leasttest-doc
relies on this), so aln -s out/Release/node node
is required formake test-doc
. As formake test
, it won't use the ninja build output, because it relies on .PHONY targets, so it always (effectively) does amake -C out all
.