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?]: Specifying supportedArchitectures..current is incompatible with --immutable-cache #6481

Open
1 task
gbenson-oysterdata opened this issue Sep 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gbenson-oysterdata
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

When yarn install --immutable --immutable-cache is run on a project (e.g. in a CI environment), .yarn/cache is checked to see if there are any packages that would be marked for deletion. If the environment it's run in doesn't match the last (mutable) environment that yarn install was run on, then the packages that were added there will be marked for deletion, causing the --immutable-cache checks to fail. While technically correct behavior, this is a surprising result.

To reproduce

  1. Starting on a Mac, create or check out a Zero Install project that relies on packages that need to be built (e.g. rollup or esbuild)
  2. Edit the .yarnrc.yml file to add supportedArchitectures.os.current and supportedArchitectures.os.linux
  3. Run yarn install --immutable --immutable-cache and see that it runs cleanly
  4. Check in and push your changes
  5. On a Linux machine, check out the project
  6. Run yarn install --immutable --immutable-cache

Expected result:
yarn install --immutable --immutable-cache runs cleanly

Actual result:
yarn install --immutable --immutable-cache fails with an error because the packages for the darwin architecture become marked for deletion

Environment

System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M2 Pro
  Binaries:
    Node: 20.14.0 - /private/var/folders/xn/vw4zf9652s12bf3rlv1dv2jc0000gn/T/xfs-a202132a/node
    Yarn: 4.4.1 - /private/var/folders/xn/vw4zf9652s12bf3rlv1dv2jc0000gn/T/xfs-a202132a/yarn
    npm: 10.7.0 - ~/.local/state/fnm_multishells/15134_1725055459573/bin/npm

---
I don't have easy access to the Linux-based buildpack instance that I discovered this bug on, but I think it's safe to assume that this bug will present itself whenever "current" is not also listed in the relevant `supportedArchitectures` entry

Additional context

Workaround:
Do not use current anywhere inside of supportedArchitectures, and instead explicitly list all supported architectures.

@gbenson-oysterdata gbenson-oysterdata added the bug Something isn't working label Sep 2, 2024
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

1 participant