chore(lock): make --check read-only - #7085
Merged
Merged
Conversation
--check now uses dry-run lockfile semantics so a missing or outdated pixi.lock fails the check without creating or rewriting the file.
--check stays read-only, but it now prints what would change before failing, as it did before, instead of exiting silently. The Python CLI test encoded the old write-on-check behaviour; it now asserts --check fails twice without creating pixi.lock, then a plain `pixi lock` recreates it. Also applies rustfmt to the new Rust test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pixi lock --check read-only (never create pixi.lock)pixi lock --check read-only (never create pixi.lock)
lucascolley
requested changes
Oct 1, 2026
Member
There was a problem hiding this comment.
thanks @00200200, this looks good to me. Please could we also update the docs to mention that --check implies --dry-run?
pixi lock --check read-only (never create pixi.lock)--check read-only
--check read-only--check read-only
Document that --check leaves pixi.lock and environments unchanged. Use Subdir in the added integration test to match the upstream migration and fix E0433 in the PR merge build.
Contributor
Author
|
Addressed the documentation request in 7dad5ef: the CLI documentation extender now explicitly states that --check implies --dry-run and does not create or modify pixi.lock. Also merged current upstream and updated the regression test for the Platform-to-Subdir migration. The focused missing-lock-file integration test and formatting checks pass. |
lucascolley
requested changes
Oct 5, 2026
Assisted-by: OpenAI Codex
lucascolley
approved these changes
Oct 5, 2026
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
lucascolley
enabled auto-merge (squash)
October 5, 2026 07:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #7081.
pixi lock --checkcurrently updates/createspixi.lockwhen missing or outdated, so a second--checkcan spuriously succeed after the first wrote the file.Fix
Treat
--checklike a dry-run for lockfile persistence: always useLockFileUsage::DryRunso the check reports drift without writingpixi.lock.How tested
Integration test: missing lockfile,
--checkfails twice,pixi.lockis never created.