yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.45k stars 1.11k forks source link

[Bug?]: When resolving conflicts in `yarn.lock`, `--mode=update-lockfile` adds `checksum: undefined` fields #6029

Open ipanasenko opened 11 months ago

ipanasenko commented 11 months ago

Self-service

Describe the bug

When resolving conflicts in yarn.lock, yarn --mode=update-lockfile adds checksum: undefined fields. Simply running yarn to resolve conflicts doesn't produce these fields. Subsequent run of yarn removes these fields as well.

To reproduce

Reproduction repo: https://github.com/ipanasenko/yarn-bug-demo

git clone https://github.com/ipanasenko/yarn-bug-demo
cd yarn-bug-demo
git cherry-pick origin/react-17
# fix conflicts ONLY in package.json, accept react ^18.0.0
yarn --mode=update-lockfile
git diff

You will see following diff:

image

Running simple yarn instead of yarn --mode=update-lockfile doesn't produce checksum: undefined field

Environment

System:
    OS: macOS 14.2.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 18.19.0 - /private/var/folders/w9/0qrtk4z55rx0tmxxz9rzbnc00000gn/T/xfs-2a2eca29/node
    Yarn: 4.0.2 - /private/var/folders/w9/0qrtk4z55rx0tmxxz9rzbnc00000gn/T/xfs-2a2eca29/yarn
    npm: 10.2.3 - ~/Library/Caches/fnm_multishells/63411_1703092512356/bin/npm
    pnpm: 8.11.0 - /usr/local/bin/pnpm
    bun: 0.3.0 - ~/.bun/bin/bun

Additional context

No response

ipanasenko commented 9 months ago

Still reproduces in 4.1.0

ipanasenko commented 2 months ago

Still reproduces in 4.5.0

ipanasenko commented 2 months ago

I've tried to make tests in packages/acceptance-tests/pkg-tests-specs/sources/features/mergeConflictResolution.test.ts fail to reproduce this bug, but could not figure it out