Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lockfile is invalidated when a channel is added #2474

Open
2 tasks done
benmoss opened this issue Nov 13, 2024 · 2 comments
Open
2 tasks done

Lockfile is invalidated when a channel is added #2474

benmoss opened this issue Nov 13, 2024 · 2 comments

Comments

@benmoss
Copy link

benmoss commented Nov 13, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

https://github.com/benmoss/lockfile_update_repro

Issue description

If you add channels to your pixi.toml file it invalidates the entire lockfile. I think the rationale behind this is that adding channels might completely change how the environment would resolve. I wonder if the logic that pixi uses can be more subtle than this.

The workaround today is to manually edit the lockfile to add the channel first, and then pixi will be tricked into thinking it was already present in the prior solve.

Expected behavior

In this repro I think the crane version should not change.

@benmoss benmoss changed the title Don't invalidate lockfile when adding a channel Lockfile is invalidated when a channel is added Nov 13, 2024
@baszalmstra
Copy link
Contributor

I can see how invalidating might not be the right approach. What did you have in mind for the more subtle approach?

@benmoss
Copy link
Author

benmoss commented Nov 13, 2024

I'm not entirely sure. I can try to think of some generalizable rules and maybe we can work backwards from there:

  1. if the new channel is lower in priority than a given packages channel, it will have no effect on that package
  2. if the new channel is lower in priority than all other channels, it will have no effect on an existing solved environment (corollary of 1)
  3. if the new channel is higher in priority than a given packages channel, that package (and its dependencies) need to be invalidated
  4. if the new channel is higher in priority than all other channels, the whole solved environment needs to be invalidated (corollary of 3)

I think we could probably come up with similar rules for deletes and reorderings too. Does this seem wildly complicated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants