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

[Bug] Yarn 2 should run child processes with the same Node #502

Closed
segrey opened this issue Oct 1, 2019 · 4 comments
Closed

[Bug] Yarn 2 should run child processes with the same Node #502

segrey opened this issue Oct 1, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@segrey
Copy link
Contributor

segrey commented Oct 1, 2019

Describe the bug

In Yarn 2 child processes are run with Node.js interpreter from PATH, not with the Node that is running Yarn itself.

To Reproduce

Yarn 2 (yarn set version from sources)

$ yarn --version
2.0.0-rc.7
$ which node
/home/segrey/.nvm/versions/node/v12.11.1/bin/node
$ /home/segrey/.nvm/versions/node/v12.11.1/bin/node /usr/share/yarn/bin/yarn.js node -e "console.log(process.version)"
v12.11.1
$ /home/segrey/.nvm/versions/node/v10.8.0/bin/node /usr/share/yarn/bin/yarn.js node -e "console.log(process.version)"
v12.11.1

Works correctly in Yarn 1:

$ yarn --version
1.19.0
$ which node
/home/segrey/.nvm/versions/node/v12.11.1/bin/node
$ /home/segrey/.nvm/versions/node/v12.11.1/bin/node /usr/share/yarn/bin/yarn.js node -e "console.log(process.version)"
yarn node v1.19.0
v12.11.1
Done in 0.04s.
$ /home/segrey/.nvm/versions/node/v10.8.0/bin/node /usr/share/yarn/bin/yarn.js node -e "console.log(process.version)"
yarn node v1.19.0
v10.8.0
Done in 0.06s.

Environment if relevant (please complete the following information):

  • OS: Linux
  • Node version v12.11.1, v10.8.0
  • Yarn version 1.19.0, 2.0.0-rc7
@segrey segrey added the bug Something isn't working label Oct 1, 2019
@arcanis
Copy link
Member

arcanis commented Oct 2, 2019

Found the problem - the v1 has a bug where it spawns the file pointed by yarn-path as any other process (whereas the v2 always assumes it's a JS file, and uses process.execPath to spawn it).

That causes the checked-in v2 binary to be executed via the node binary available in the PATH instead of the one originally used to spawn the v1 binary. Will fix that on the v1 side.

@arcanis
Copy link
Member

arcanis commented Oct 2, 2019

Will be fixed by yarnpkg/yarn#7592

@arcanis
Copy link
Member

arcanis commented Oct 15, 2019

Closing, the fix got released in the 1.19.1 👍

@arcanis arcanis closed this as completed Oct 15, 2019
@segrey
Copy link
Contributor Author

segrey commented Oct 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants