🐞 bug report
Affected Rule
yarn_install
Is this a regression?
No
Description
The docs mention that for vendored Yarn versions, the yarn attribute can just point to the js file when yarn_install is defined. This is not as easy in reality though because it means that the system Node versions would be used, and also it would break on Windows which does not necessarily know how to automatically resolve .js or .cjs from the path extensions.
https://github.com/bazelbuild/rules_nodejs/blob/7993296829c5ddaadb04a7d76ecc6b72eacdd01c/nodejs/yarn_repositories.bzl#L45-L48
Error in fail: yarn --version failed: (java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("C:\users\circleci\project\.yarn\releases\yarn-3.2.0.cjs" --version): %1 is not a valid Win32 application.
Ideally the wrapper (which leverages the nodejs_host) from yarn_repositories would be exposed somehow, or yarn_repositories would take in the regular JS file and set up the wrapper as it would do when downloading.
🔬 Minimal Reproduction
- Checkout angular/dev-infra@9604d04
- Run
bazel build //...
🔥 Exception or Error
Error in fail: yarn --version failed: (java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("C:\users\circleci\project\.yarn\releases\yarn-3.2.0.cjs" --version): %1 is not a valid Win32 application.
Rules_nodejs version:
5.2.0
🐞 bug report
Affected Rule
yarn_installIs this a regression?
No
Description
The docs mention that for vendored Yarn versions, the
yarnattribute can just point to thejsfile whenyarn_installis defined. This is not as easy in reality though because it means that the system Node versions would be used, and also it would break on Windows which does not necessarily know how to automatically resolve.jsor.cjsfrom the path extensions.https://github.com/bazelbuild/rules_nodejs/blob/7993296829c5ddaadb04a7d76ecc6b72eacdd01c/nodejs/yarn_repositories.bzl#L45-L48
Ideally the wrapper (which leverages the
nodejs_host) fromyarn_repositorieswould be exposed somehow, oryarn_repositorieswould take in the regular JS file and set up the wrapper as it would do when downloading.🔬 Minimal Reproduction
bazel build //...🔥 Exception or Error
Rules_nodejs version:
5.2.0