Removing a nonexistent dependency from a specific platform causes a panic
Checks
-
[X] I have checked that this issue has not already been reported.
-
[X] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.
Reproducible example
[project]
name = "bug"
channels = ["conda-forge"]
platforms = ["linux-64"]
pixi remove junk --platform linux-64
Issue description
I get the following panic:
thread 'main' panicked at crates/pixi_manifest/src/manifest.rs:581:14:
target should exist
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It also does not matter if this platform exists within platforms or not, for example changing linux-64 to osx-arm64 gives the same result.
Expected behavior
I would expect a more "graceful" error, rather than a panic.
I'm not going to your shortened URL and downloading something.
I'm not going to your shortened URL and downloading something.
Just in case @Ahajha's comment doesn't make sense, there was a spammy highly suspect reply from a user that appears to have been removed from Github. That comment is gone.
Ah, good, it's been removed. Yea I realize that looks kinda ridiculous out of context now.
Hey! Thanks for reporting, while the error is expected, you don't really need the --platform as the dependency is not platform specific per-se. Read this to learn more: https://pixi.sh/latest/reference/project_configuration/#the-target-table
I do agree that behavior with regards to the CLI is a bit confusion, I've at least made a PR that turns this into a proper error and a hint what is expected. See: https://github.com/prefix-dev/pixi/pull/1961. This will close this issue after that is merged.