Skip to content

Commit f3d613e

Browse files
sxa555mhdawson
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 eb122b1 commit f3d613e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ endif
6464
# to check for changes.
6565
.PHONY: $(NODE_EXE) $(NODE_G_EXE)
6666

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

7176
$(NODE_G_EXE): config.gypi out/Makefile
7277
$(MAKE) -C out BUILDTYPE=Debug V=$(V)
73-
ln -fs out/Debug/$(NODE_EXE) $@
78+
if [ ! -r $(NODE_EXE) -o ! -L $(node_EXE) ]; then ln -fs out/Debug/$(NODE_EXE) $@; fi
7479

7580
out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
7681
deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \

0 commit comments

Comments
 (0)