FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: Don't regenerate node->out/*/node symlink if already there by sxa · Pull Request #9827 · nodejs/node · GitHub

/ node Public

build: Don't regenerate node->out/*/node symlink if already there - #9827

Closed
sxa wants to merge 1 commit into
nodejs:masterfrom
sxa:ln-sf-node-fix
Closed

build: Don't regenerate node->out/*/node symlink if already there#9827
sxa wants to merge 1 commit into
nodejs:masterfrom
sxa:ln-sf-node-fix

Conversation

sxa commented Nov 28, 2016

Copy link
Copy Markdown
Member
Description of change
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

Description of change

Ref: #9825

This PR will stop the "ln -sf out/Release node node" (and it's Debug equivalent) from occurring if it is already in place. This appears to be causing a problem when it is executed in parallel with the node-gyp execution for the build-addons target as it appears to be triggering a race condition (visible in the AIX CI as per the referenced issue although I haven't replicated it on my own system) whereby the deletion of the symlink (A result of the -f) is leaving a small window before it is recreated where the addons build runs, which requires the node symlink to be in place. I can see no obvious reason why this would have ONLY showed up on the v4 release as the same condition can occur on master as far as I can tell.

The disadvantage of the solution in this PR is that if "node" already existed and wasn't previously a symlink to out/Release node then it won't overwrite it. I'm open to alternative suggestions on this - checking the output from "diff node out/Release/node" before replacing would work for example. Tagging @bnoordhuis as he has made some comments in Makefile around thisagainst the build-addons target in the makefile. The problem also goes away if the $(NODE_EXE) target is not listed as ".PHONY" but since that was done for sensible reasons I assume we need to leave that in place, and this is really just a "workaround" for the fact it's not a true dependency.

nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Nov 28, 2016

bnoordhuis left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with a request and a suggestion.

Comment thread Makefile Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Wouldn't -L (symbolic link) make more sense?

Can you add a comment here and below explaining why the check is necessary? It's going to look superfluous to the casual reader.

sxa Nov 29, 2016
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yep I'll add a comment - that's a fair point.
Regarding -L, to be honest I wasn't certain it was standard sh syntax and also it would stop someone deliberately overriding it with an executable if they wanted to for any reason, although it appears to work on all the systems I've tried (AIX, Solaris, OS X, and of course linux) so I can add that in along with the -r (Since -L in itself will pass if it's a symlink that points to nothing which wouldn't be useful!)

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

Ref: nodejs#9825

sxa commented Nov 29, 2016

Copy link
Copy Markdown
Member Author

@bnoordhuis Done - have added both checks as per my comment on your review.
@mhdawson I believe this change will fix the AIX failures in V4 staging if you want to try and pull them in and test once this one's approved

gibfahn left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, it'd be nice to have something that checks that the symlink points to out/Release/node, but there doesn't seem to be a good POSIX way of doing it.

gibfahn commented Nov 29, 2016

Copy link
Copy Markdown
Member

@sxa555 Could we use the -ef test operator? I understand it's not POSIX, but if it works on dash, ksh, bash and zsh (see SO link, I haven't verified) then it might cover all the platforms we care about.

sxa commented Nov 30, 2016

Copy link
Copy Markdown
Member Author

We could do, and while I'm not 100% against it I'm somewhat reluctant to use something that could limit portability (it doesn't work on a pure bourne shell).

mhdawson left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

gibfahn commented Nov 30, 2016

Copy link
Copy Markdown
Member

@sxa555 Makes sense. In the future if not doing the check does cause issues for someone we can consider using something like -ef, but it's not currently a problem.

mhdawson commented Dec 5, 2016

Copy link
Copy Markdown
Member

Think this is ready to land. CI run here: https://ci.nodejs.org/job/node-test-pull-request/5206/

mhdawson self-assigned this Dec 5, 2016

mhdawson commented Dec 5, 2016

Copy link
Copy Markdown
Member

Only failure in CI is on ARM and it looks like the machine had a connection problem as opposed to any specific tests failing. Will land.

mhdawson commented Dec 5, 2016

Copy link
Copy Markdown
Member

Landed as f3d613e

mhdawson closed this Dec 5, 2016
mhdawson pushed a commit that referenced this pull request Dec 5, 2016
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>

addaleax commented Dec 6, 2016

Copy link
Copy Markdown
Member

This needs to land together with #10153 wherever it lands

addaleax pushed a commit that referenced this pull request Dec 7, 2016
Currently when running make node_g the following error is displayed:
if [ ! -r node -o ! -L  ]; then ln -fs out/Debug/node node_g; fi
/bin/sh: line 0: [: argument expected

It looks like there was a typo for the NODE_EXE where node became
lowercase instead of uppercase.

Ref: #9827
PR-URL: #10153
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
addaleax pushed a commit that referenced this pull request Dec 7, 2016
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>
addaleax pushed a commit that referenced this pull request Dec 7, 2016
Currently when running make node_g the following error is displayed:
if [ ! -r node -o ! -L  ]; then ln -fs out/Debug/node node_g; fi
/bin/sh: line 0: [: argument expected

It looks like there was a typo for the NODE_EXE where node became
lowercase instead of uppercase.

Ref: #9827
PR-URL: #10153
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
jmdarling pushed a commit to jmdarling/node that referenced this pull request Dec 8, 2016
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: nodejs#9825
PR-URL: nodejs#9827
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Michael Dawson <michael_dawson@ca.ibm.com>
italoacasas mentioned this pull request Dec 15, 2016
MylesBorins pushed a commit that referenced this pull request Mar 7, 2017
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>
MylesBorins pushed a commit that referenced this pull request Mar 7, 2017
Currently when running make node_g the following error is displayed:
if [ ! -r node -o ! -L  ]; then ln -fs out/Debug/node node_g; fi
/bin/sh: line 0: [: argument expected

It looks like there was a typo for the NODE_EXE where node became
lowercase instead of uppercase.

Ref: #9827
PR-URL: #10153
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
MylesBorins pushed a commit that referenced this pull request Mar 7, 2017
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>
MylesBorins pushed a commit that referenced this pull request Mar 7, 2017
Currently when running make node_g the following error is displayed:
if [ ! -r node -o ! -L  ]; then ln -fs out/Debug/node node_g; fi
/bin/sh: line 0: [: argument expected

It looks like there was a typo for the NODE_EXE where node became
lowercase instead of uppercase.

Ref: #9827
PR-URL: #10153
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
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>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
Currently when running make node_g the following error is displayed:
if [ ! -r node -o ! -L  ]; then ln -fs out/Debug/node node_g; fi
/bin/sh: line 0: [: argument expected

It looks like there was a typo for the NODE_EXE where node became
lowercase instead of uppercase.

Ref: #9827
PR-URL: #10153
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
MylesBorins mentioned this pull request Mar 9, 2017
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
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>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
Currently when running make node_g the following error is displayed:
if [ ! -r node -o ! -L  ]; then ln -fs out/Debug/node node_g; fi
/bin/sh: line 0: [: argument expected

It looks like there was a typo for the NODE_EXE where node became
lowercase instead of uppercase.

Ref: #9827
PR-URL: #10153
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Italo A. Casas <me@italoacasas.com>
MylesBorins mentioned this pull request Mar 9, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL