Skip to content

fix(builtin): yarn_install with vendored yarn .cjs file breaks - #3350

Merged
alexeagle merged 1 commit into
bazel-contrib:stablefrom
devversion:fix-yarn-vendored-cjs
Mar 1, 2022
Merged

fix(builtin): yarn_install with vendored yarn .cjs file breaks#3350
alexeagle merged 1 commit into
bazel-contrib:stablefrom
devversion:fix-yarn-vendored-cjs

Conversation

@devversion

Copy link
Copy Markdown
Contributor

yarn_install allows for a vendored/custom Yarn JavaScript file. To ensure
that Yarn runs with the proper Node version, yarn_install calls the JS file
with the host NodeJS version also installed through Bazel. Currently the detection
logic does not account for .cjs or .mjs. This is a little confusing as the
install continues to work but breaks surprisingly in Windows then, or when a engines
requirement is no longer satisifed (there are more reasons as well)

We should support cjs and mjs to avoid confusion, and especially cjs
since Yarn itself always vendors itself with that extension!

Fixes #3349

devversion added a commit to devversion/dev-infra that referenced this pull request Mar 1, 2022
More details here: bazel-contrib/rules_nodejs#3350.

This commit adds a little wrapper script as temporary workaround to fix
CI.
`yarn_install` allows for a vendored/custom Yarn JavaScript file. To ensure
that Yarn runs with the proper Node version, `yarn_install` calls the JS file
with the host NodeJS version also installed through Bazel. Currently the detection
logic does not account for `.cjs` or `.mjs`. This is a little confusing as the
install continues to work but breaks surprisingly in Windows then, or when a engines
requirement is no longer satisifed (there are more reasons as well)

We should support `cjs` and `mjs` to avoid confusion, and especially `cjs`
since Yarn itself always vendors itself with that extension!
@devversion
devversion force-pushed the fix-yarn-vendored-cjs branch from 51fed6b to 51e33fc Compare March 1, 2022 21:34
@devversion
devversion marked this pull request as ready for review March 1, 2022 21:35
devversion added a commit to angular/dev-infra that referenced this pull request Mar 1, 2022
More details here: bazel-contrib/rules_nodejs#3350.

This commit adds a little wrapper script as temporary workaround to fix
CI.
@alexeagle
alexeagle merged commit 4a025c0 into bazel-contrib:stable Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vendored Yarn support not compatible with Windows

2 participants