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

Corepack should not download package manager if binary is available #586

Open
trivikr opened this issue Dec 24, 2024 · 2 comments
Open

Corepack should not download package manager if binary is available #586

trivikr opened this issue Dec 24, 2024 · 2 comments

Comments

@trivikr
Copy link
Member

trivikr commented Dec 24, 2024

Is your feature request related to a problem? Please describe.

Yarn has a configuration called yarnPath which allows yarn binary to be added in the repository.

The latest version of yarn, i.e. v4, recommends using corepack instead of yarnPath. However, corepack users do get CI failures sometimes because of network issues when downloading package manager. Example:

In aws-sdk-js-v3, we attempted to use yarnPath to set yarn binary, but we noticed that corepack still attempts to download binary even if it's available. Details in aws/aws-sdk-js-v3#6757 (comment)

A minimal repro can be viewed in https://github.com/trivikr/test-corepack-local-version

Describe the solution you'd like

Corepack should not download package manager if binary is available in the project.

Describe alternatives you've considered

  • Following up on existing issues which discuss network failures shared above.
  • Use globally installed yarn classic instead of corepack for managing yarn version.
  • Switch to npm@^10.9.0, and use devEngines instead of corepack packageManager field.
@trivikr
Copy link
Member Author

trivikr commented Dec 26, 2024

This feature request can be closed based on the following response on OpenJS Slack from one of the maintainers

yarnPath is a Yarn-specific feature; I'm not convinced Corepack should be aware of it.

I agree with corepack maintainer that it shouldn't go through package manager specific configurations.

It's however, an opportunity for https://github.com/openjs-foundation/package-metadata-interoperability-collab-space to check if this configuration can be standardized across package managers.

@trivikr
Copy link
Member Author

trivikr commented Dec 26, 2024

In aws-sdk-js-v3, we decided to switch from corepack to globally installed yarn classic for using yarn modern local binary as we want to avoid a network call to install package manager.

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

No branches or pull requests

1 participant