Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: prevent C++ linker from overwriting executable #22027

Closed
wants to merge 3 commits into from

Conversation

rubys
Copy link
Member

@rubys rubys commented Jul 30, 2018

Running make run-ci with multiple jobs, it is possible for the C++ linker
to be invoked while build-addons is running, this can result in intermittent
ENOENT failures when spawning nodeGyp. To prevent this, originally
provide a different name for the executable, and rename it to the correct
name only after the link completes successfully.

Fixes #22006. Kinda. Sorta.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Jul 30, 2018
@Trott
Copy link
Member

Trott commented Jul 30, 2018

@nodejs/build-files

@Fishrock123
Copy link
Contributor

@targos
Copy link
Member

targos commented Jul 30, 2018

Are we sure it's only a Mac thing? I think I saw something similar on Linux when I was working on canary. I fixed it with git clean - fdx

@refack
Copy link
Contributor

refack commented Jul 30, 2018

I'm -0 on this. IMHO it just adds complexity to workaround the crux of the issue.

@joyeecheung
Copy link
Member

joyeecheung commented Jul 31, 2018

IIRC, this is not mac-only but makefile-only - we have been seeing the executable being deleted back in the days when the addons were built in a loop in makefile instead of in the new JS scripts.

@Trott
Copy link
Member

Trott commented Jul 31, 2018

@Trott
Copy link
Member

Trott commented Jul 31, 2018

Oh, wait, we need an entire new CI since there were changes since the last one.

CI: https://ci.nodejs.org/job/node-test-pull-request/16096/

@addaleax addaleax added test Issues and PRs related to the tests. addons Issues and PRs related to native addons. labels Aug 2, 2018
@rubys rubys force-pushed the issue-22006-workaround branch from d8101b2 to cf4a07a Compare August 13, 2018 15:30
@rubys
Copy link
Member Author

rubys commented Aug 18, 2018

@Trott Trott force-pushed the issue-22006-workaround branch from 0eaaa03 to 0437cef Compare August 18, 2018 21:48
rubys added 3 commits August 18, 2018 14:49
Running `make run-ci` with multiple jobs, it is possible for the C++ linker
to be invoked while build-addons is running, this can result in intermittent
ENOENT failures when spawning `nodeGyp`.  To prevent this, originally
provide a different name for the executable, and rename it to the correct
name only after the link completes successfully.

Fixes 22006.  Kinda.  Sorta.
@Trott
Copy link
Member

Trott commented Aug 18, 2018

Rebased and force-pushed to fix the CI problem (unrelated to this PR).

CI: https://ci.nodejs.org/job/node-test-pull-request/16556/

@Trott
Copy link
Member

Trott commented Aug 18, 2018

@nodejs/gyp @nodejs/node-gyp Would be great to get a second review on this one.

Aside: Should we really have separate gyp and node-gyp teams or should that be merged into a single team?

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

I agree with @refack, this is more of a workaround than a fix.

@@ -925,6 +931,25 @@
},
],
} ],
# When building executable on Unix operating systems, in order to
# avoid overwriting the executable while it it running, build it with
Copy link
Member

Choose a reason for hiding this comment

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

typo: is

@BridgeAR
Copy link
Member

BridgeAR commented Sep 6, 2018

Even though this is clearly a workaround: is there any solution in sight for the actual issue? If not, I do not see any downside in doing this for now.

Any other options about that?

@rubys
Copy link
Member Author

rubys commented Sep 6, 2018

With two approvals, I will merge this (after fixing the typo) on, say, ... Friday? ...unless there are any objections.

@refack
Copy link
Contributor

refack commented Oct 19, 2018

I've found that #23733 will workaround this issue.
And that relanding #23255 #23156 will fix it, so I'm blocking this issue until we prove it's the only way.

@refack refack added the blocked PRs that are blocked by other issues or PRs. label Oct 19, 2018
@fhinkel
Copy link
Member

fhinkel commented Oct 26, 2019

Closing this due to inactivity. Pleas re-open if needed.

@fhinkel fhinkel closed this Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addons Issues and PRs related to native addons. blocked PRs that are blocked by other issues or PRs. build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: flakiness in building addons with make