pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Using platform remove clears all platforms

Open Ahajha opened this issue 1 year ago • 1 comments

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", "linux-aarch64", "osx-arm64"]

[dependencies]
python = ">=3.9,<3.13"
pixi project platform remove linux-aarch64

Issue description

The above removes all platforms instead of just the one specified.

Expected behavior

I would expect the above example to only remove linux-aarch64, however it instead removes all platforms. (This isn't specific to linux-aarch64, it does it with any of the platforms).

Additionally, I would expect target.<platform>.<section> sections to be removed, otherwise as-is the project file is broken. This can be repro'd with the following:

[project]
name = "bug"
channels = ["conda-forge"]
platforms = []

[target.linux-64.dependencies]
python = ">=3.9,<3.13"

[target.linux-aarch64.dependencies]
python = ">=3.9,<3.13"

[target.osx-arm64.dependencies]
python = ">=3.9,<3.13"

Ahajha avatar Aug 27 '24 00:08 Ahajha

Smells and looks like a bug, thank you we should look into this!

tdejager avatar Sep 05 '24 07:09 tdejager