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

pixi add only works on the project's supported platform #650

Closed
2 tasks done
konstantinjdobler opened this issue Jan 10, 2024 · 4 comments · Fixed by #668
Closed
2 tasks done

pixi add only works on the project's supported platform #650

konstantinjdobler opened this issue Jan 10, 2024 · 4 comments · Fixed by #668
Labels
🐞 bug Something isn't working

Comments

@konstantinjdobler
Copy link

konstantinjdobler commented Jan 10, 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

[project]
channels = ["conda-forge"]
platforms = [
"linux-64", 
# "osx-arm64"
]
name = "bug"

[dependencies]
python = "=3.11.*"

Output:

  × the project is not configured for your current platform
   ╭─[pixi.toml:2:1]
 2 │     channels = ["nvidia", "conda-forge", "pytorch-nightly"]
 3 │ ╭─▶ platforms = ["linux-64",
 4 │ │   #  "osx-arm64"
 5 │ ├─▶ ]
   · ╰──── add 'osx-arm64' here
 6 │     name = "nordwind"
   ╰────
  help: The project needs to be configured to support your platform (osx-arm64).

Issue description

E.g. when on M1 Macs, pixi add ruff would fail when "osx-arm64" is commented out. pixi add --no-install ruff also fails.

Expected behavior

I know pixi supported building lockfiles for another platform some time ago. Is this intended? I am using version 0.11.0.

@konstantinjdobler konstantinjdobler added the 🐞 bug Something isn't working label Jan 10, 2024
@konstantinjdobler konstantinjdobler changed the title pixi add only works on the projects platform pixi add only works on the project's supported platform Jan 10, 2024
@ruben-arts
Copy link
Contributor

Using the --no-install to avoid this error is a good idea!

I can't remember that we supported the adding of a package without also being on that platform but that might be something we want to get in there.

@baszalmstra
Copy link
Contributor

baszalmstra commented Jan 11, 2024

I think intially we didnt also install the environment during add. I think we could consider not installing the environment if the platform is not supported. Possibly with a warning? WDYT?

@konstantinjdobler
Copy link
Author

Just FYI: it worked for me in 0.6.1 (big jump I know, I just upgraded yesterday).

I think not installing with a warning would be great! The use case of creating lockfiles for another platform might be quite common if the actual code runs on a remote machine with a potentially different OS than the local one.

@tdejager
Copy link
Contributor

tdejager commented Jan 15, 2024

I think it would be better to make the --no-install flag function correctly i.e. it should work in this case, because the behavior is explicit when looking ath the CLI and the same regardless of the platform. But I can be convinced otherwise ;)

ruben-arts added a commit that referenced this issue Jan 16, 2024
…668)

fixes #650

reproducible case (on Linux):

```yaml
channels = ["conda-forge"]
platforms = [
  # "linux-64",
  "osx-arm64",
]
name = "bug"

[dependencies]
python = "=3.11.*"
```

Run:

```
$ pixi add --no-install ruff

 WARN pixi::environment: Adding dependency for unsupported platform (linux-64).
✔ Added ruff
```

`ruff = ">=0.1.13,<0.2"` added to `pixi.toml` 🎉

---------

Co-authored-by: Ruben Arts <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants