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?]: frozen-lockfiles for file dependencies #6484

Open
1 task done
furstenheim-goodnotes opened this issue Sep 5, 2024 · 0 comments
Open
1 task done

[Bug?]: frozen-lockfiles for file dependencies #6484

furstenheim-goodnotes opened this issue Sep 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@furstenheim-goodnotes
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

I have a project that has some file dependencies:

something like:

"dependencies": {
   "my-package": "../../some-other-package"
}

This is very handy to work in the monorepo.

In yarn v1 when using --frozen-lockfiles the changes in this repo were not marked as a failure and it just work.

In yarn v4, with --immutable the package is shaed and compared. Meaning that any change in my mono repo will make yarn --immutable fail.

Is there any way for me to get the old behavior?

To reproduce

## create a
mkdir a
cd a
touch a.js
cat << EOF > a.js
console.log(1)
EOF
yarn init
cd ..

## create b
mkdir b
yarn init
touch yarn.lock
cat << EOF > package.json
{
  "name": "b",
  "packageManager": "[email protected]",
  "dependencies": {
    "a": "../a"
  }
}
EOF
yarn
cd ..

## modify a
cd a
cat << EOF > a.js
console.log(2)
EOF
cd ..


## try to do yarn --immutable
cd b
yarn --immutable

Output

➤ YN0000: · Yarn 4.4.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + a@file:../a#../a::hash=7ce741&locator=b%40workspace%3A.
➤ YN0085: │ - a@file:../a#../a::hash=e591a1&locator=b%40workspace%3A.
➤ YN0000: └ Completed

➤ YN0000: ┌ Post-resolution validation
➤ YN0000: │ @@ -6,10 +6,9 @@
➤ YN0000: │    cacheKey: 10c0
➤ YN0000: │  
➤ YN0000: │  "a@file:../a::locator=b%40workspace%3A.":
➤ YN0000: │    version: 0.0.0
➤ YN0028: │ -  resolution: "a@file:../a#../a::hash=e591a1&locator=b%40workspace%3A."
➤ YN0028: │ -  checksum: 10c0/4d22b6c39c81689f935221938e4485fe0b762e95309636b31a41e48a0572ee7e1e6685201210b8508e0b2c3eea3c257a3435253399828cb5580f99726d5b9998
➤ YN0028: │ +  resolution: "a@file:../a#../a::hash=7ce741&locator=b%40workspace%3A."
➤ YN0000: │    languageName: node
➤ YN0000: │    linkType: hard
➤ YN0000: │  
➤ YN0000: │  "b@workspace:.":
➤ YN0000: │ 
➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
➤ YN0000: └ Completed
➤ YN0000: · Failed with errors in 0s 42ms

Environment

System:
    OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-1260P
  Binaries:
    Node: 18.16.1 - /tmp/xfs-522f04d6/node
    Yarn: 4.4.0 - /tmp/xfs-522f04d6/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm

Additional context

No response

@furstenheim-goodnotes furstenheim-goodnotes added the bug Something isn't working label Sep 5, 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