Skip to content

pnpm.fetchDeps: error if lockfile version has a mismatch - #317739

Merged
SuperSandro2000 merged 2 commits into
NixOS:masterfrom
SuperSandro2000:pnpm-fetch-deps
Jun 28, 2024
Merged

SuperSandro2000 merged 2 commits into
NixOS:masterfrom
SuperSandro2000:pnpm-fetch-deps

Conversation

@SuperSandro2000

@SuperSandro2000 SuperSandro2000 commented Jun 6, 2024 •

Copy link
Copy Markdown
Member

Description of changes

Tested while updating youtube-music

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@SuperSandro2000 SuperSandro2000 mentioned this pull request Jun 6, 2024
3 of 16 tasks
@SuperSandro2000
SuperSandro2000 requested a review from Scrumplex June 6, 2024 12:46
@lilyinstarlight lilyinstarlight added the 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment label Jun 6, 2024
@github-actions github-actions Bot removed the 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment label Jun 6, 2024
@SuperSandro2000 SuperSandro2000 changed the title pnpm.fetchDeps: error if lockfile version has a mismatch pnpm.fetchDeps: error if lockfile version has a mismatch, remove packageManager key from package.json Jun 6, 2024
Comment on lines 55 to 59

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a similar vein as Python relaxDepsHook, this should probably be a flag that's off by default.

@ofborg ofborg Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 6, 2024
@github-actions github-actions Bot added 8.has: documentation This PR adds or changes documentation 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment labels Jun 18, 2024
@github-actions github-actions Bot removed the 8.has: documentation This PR adds or changes documentation label Jun 18, 2024
@SuperSandro2000 SuperSandro2000 changed the title pnpm.fetchDeps: error if lockfile version has a mismatch, remove packageManager key from package.json pnpm.fetchDeps: error if lockfile version has a mismatch Jun 18, 2024
@SuperSandro2000

Copy link
Copy Markdown
Member Author

I've removed remove packageManager key from package.json for now because it didn't work like I envisioned it with the further testing I just did.

@doronbehar doronbehar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit besides the comment below: The first commit message should start with pnpm.fetchDeps,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started with some corrections and improvements, and continued with a suggested way to overcome this check.

Suggested change
echo "ERROR: lockfileVersion in pnpm-lock.yaml is to new for the provided pnpm version ${lib.versions.major pnpm.version}!"
echo "ERROR: lockfileVersion $lockfileVersion in pnpm-lock.yaml is" \
"too new for the provided pnpm version" \
"${lib.versions.major pnpm.version}! Set" \
"pnpmDontCheckLockfileVersion=true to avoid this error if you're" \
"sure it won't cause other issues" >&2

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't do anything, as pnpm will fail with a rather cryptic error message anyway.

@gepbird

gepbird commented Jun 18, 2024

Copy link
Copy Markdown
Contributor

I've removed remove packageManager key from package.json for now because it didn't work like I envisioned it with the further testing I just did.

Can you share more details about the issue that made you remove it?

@SuperSandro2000

Copy link
Copy Markdown
Member Author

Can you share more details about the issue that made you remove it?

It needed to be in mkDerivation and inside fetchDeps and got more complicated the more deeply I tested it.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 26, 2024
@SuperSandro2000
SuperSandro2000 merged commit 31efaed into NixOS:master Jun 28, 2024
@SuperSandro2000
SuperSandro2000 deleted the pnpm-fetch-deps branch June 28, 2024 21:11
@emilazy emilazy mentioned this pull request Aug 25, 2024
3 of 13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants