[Bug?]: Regression error for `yarn dedupe`.
Self-service
- [ ] I'd be willing to implement a fix
Describe the bug
yarn dedupe --check shows that there is a package that can be dedupe but running yarn dedupe has no effect.
This is a regression bug that worked fine in 3.1.1 but was broken in 3.2.0 until the current main branch.
PS F:\babel> yarn dedupe --check
➤ YN0000: ┌ Deduplication step
➤ YN0000: │ eslint@npm:eslint@^8.0.0 can be deduped from eslint@npm:8.0.0 to eslint@npm:8.9.0
➤ YN0000: │ One package can be deduped using the highest strategy
➤ YN0000: └ Completed
To reproduce
git clone https://github.com/babel/babel
cd babel
yarn set version stable
yarn dedupe
yarn dedupe --check
Environment
System:
OS: Windows 10 10.0.22000
CPU: (24) x64 AMD Ryzen Threadripper 1920X 12-Core Processor
Binaries:
Node: 18.3.0 - C:\Users\liuxingbaoyu\AppData\Local\Temp\xfs-fd8c095c\node.CMD
Yarn: 3.2.0 - C:\Users\liuxingbaoyu\AppData\Local\Temp\xfs-fd8c095c\yarn.CMD
npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
Additional context
No response
Bisected to b47fc327fca13c7ea48f23974ed44a31d7d1eb18 / https://github.com/yarnpkg/berry/pull/3631 @paul-soporan
Hey! Are there any updates?
I didn't triple check but it seems that when the resolution includes __archiveUrl=... then even the check does not work and just tells that everything is fine.
This issue reproduces on master:
Error: expect(received).resolves.toBeTruthy()
Received promise rejected instead of resolved
Rejected to value: [Error: Command failed: /usr/bin/node /github/workspace/scripts/actions/../run-yarn.js dedupe --check
➤ YN0000: ┌ Deduplication step
::group::Deduplication step
➤ YN0000: │ eslint@npm:eslint@^8.0.0 can be deduped from eslint@npm:8.0.0 to eslint@npm:8.25.0
➤ YN0000: │ One package can be deduped using the highest strategy
::endgroup::
➤ YN0000: └ Completed
]
at expect (/github/workspace/.yarn/cache/expect-npm-24.8.0-8c7640c562-44ff9ab1e7.zip/node_modules/expect/build/index.js:138:15)
at module.exports (evalmachine.<anonymous>:13:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:57:13
at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:18:16)
at async executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:25:12)
at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:26:38)
at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)
I've updated the issue with a more minimal sherlock repro that doesn't depend on the babel repo (where the issue doesn't even reproduce anymore).
@Knagis The original issue shouldn't be influenced by __archiveUrl. If you see a different behavior for packages with __archiveUrl, please open a different issue.