Skip to content

Conversation

@nichmor
Copy link
Contributor

@nichmor nichmor commented Dec 29, 2025

Description

Another look at #5187

Fixes #5185

How Has This Been Tested?

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@nichmor nichmor marked this pull request as ready for review December 30, 2025 08:27
@ruben-arts
Copy link
Contributor

This will still not fix the lockfile if it's out of date:

[workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]

[dependencies]
python = ">=3.14.2,<3.15"

[pypi-dependencies]
svgdigitizer = {git = "https://github.com/echemdb/svgdigitizer.git"}
ec-tools = {git = "https://github.com/echemdb/ec-tools.git", branch = "main"}

Run pixi install, will create a proper lockfile

# Now remove main
ec-tools = {git = "https://github.com/echemdb/ec-tools.git"}

Run pixi install, will not update the lockfile
Run pixi update, will update the lockfile

# Now add main back
ec-tools = {git = "https://github.com/echemdb/ec-tools.git", branch = "main"}

Run pixi install, will not update the lockfile but does find it not satisfiable. This is the issue!
Run pixi update to update, this shouldn't be required

Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

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

It doesn't clean up when switching from without main to with main in the spec.


#[error(transparent)]
GitUrlParse(#[from] uv_git_types::GitUrlParseError),
// #[error("{0}")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove?

@lucascolley lucascolley added bug Something isn't working lock file labels Dec 31, 2025
@ruben-arts
Copy link
Contributor

Now it fixes the issue when switching the branch, but there is still some weird behavior when using rev

It always adds the rev for the default branch:

ec-tools = {git = "https://github.com/echemdb/ec-tools.git"}
      - pypi: git+https://github.com/echemdb/ec-tools.git?rev=693f4bef9243d06849cd807e866ed03562d30bb8#693f4bef9243d06849cd807e866ed03562d30bb8

If you change the rev to something else, it will lock that and it will never invalidate:

ec-tools = {git = "https://github.com/echemdb/ec-tools.git", rev = "main"}

pixi install results in:

      - pypi: git+https://github.com/echemdb/ec-tools.git?rev=main#693f4bef9243d06849cd807e866ed03562d30bb8

now removing the rev from the pixi.toml:

ec-tools = {git = "https://github.com/echemdb/ec-tools.git"}

pixi install again the rev=main stays in the lockfile.

      - pypi: git+https://github.com/echemdb/ec-tools.git?rev=main#693f4bef9243d06849cd807e866ed03562d30bb8

nichmor pushed a commit that referenced this pull request Jan 5, 2026
…om manifest

When a user specifies `rev = "main"` in pixi.toml and later removes it,
the lockfile should be invalidated and re-resolved. Previously, any
`Rev(_)` in the lockfile was treated as satisfiable when the manifest
had no explicit rev (DefaultBranch). This was incorrect because
`Rev("main")` is a named reference, not a specific commit hash.

Now the satisfiability check distinguishes between:
- `Rev(full_commit_hash)` → satisfiable (specific commit is still valid)
- `Rev(non_hash)` like "main" → NOT satisfiable, triggers re-resolve

Fixes the issue reported by Ruben in PR #5215.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lock file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pixi.lock always outdated with multiple git pypi dependency specifying branches

3 participants