Skip to content

Commit 87db4f7

Browse files
sxa555MylesBorins
sxa555
authored andcommitted
build: Don't regenerate node symlink
The node -> out/*/node symlink is getting recreated in parallel with other targets in the makefile which require it (e.g. test-ci) and this seems to be causing a race condition which is showing up on AIX Fixes: #9825 PR-URL: #9827 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-by: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 5367336 commit 87db4f7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,18 @@ endif
6060
# to check for changes.
6161
.PHONY: $(NODE_EXE) $(NODE_G_EXE)
6262

63+
# The -r/-L check stops it recreating the link if it is already in place,
64+
# otherwise $(NODE_EXE) being a .PHONY target means it is always re-run.
65+
# Without the check there is a race condition between the link being deleted
66+
# and recreated which can break the addons build when running test-ci
67+
# See comments on the build-addons target for some more info
6368
$(NODE_EXE): config.gypi out/Makefile
6469
$(MAKE) -C out BUILDTYPE=Release V=$(V)
65-
ln -fs out/Release/$(NODE_EXE) $@
70+
if [ ! -r $(NODE_EXE) -o ! -L $(NODE_EXE) ]; then ln -fs out/Release/$(NODE_EXE) $@; fi
6671

6772
$(NODE_G_EXE): config.gypi out/Makefile
6873
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
69-
ln -fs out/Debug/$(NODE_EXE) $@
74+
if [ ! -r $(NODE_EXE) -o ! -L $(node_EXE) ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
7075

7176
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi
7277
$(PYTHON) tools/gyp_node.py -f make

0 commit comments

Comments
 (0)