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

feat: simple platform specific dependencies #111

Merged
merged 14 commits into from
Jun 20, 2023

Conversation

baszalmstra
Copy link
Contributor

@baszalmstra baszalmstra commented Jun 19, 2023

Enables writing platform specific dependencies using:

[target.<platform>.dependencies]
foo = "3"

e.g.

[target.win-64.dependencies]
windows_specific = "3"

[target.osx-64.dependencies]
mac_specific = "3"

For now the key is just a platform. In the future we want to extend this to allow more generic expressions.

Fix #43

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.

Small improvements. Also, is there a good example we could test this with? I'm now just faking it.

@baszalmstra
Copy link
Contributor Author

Ok I elaborated a bit on error reporting:

error: failed to parse pixi.toml from E:\Developer\prefix\pixi\myproject

Caused by:
    TOML parse error at line 3, column 11
      |
    3 | version = 3
      |           ^
    invalid type: integer `3`, expected a string

is now:

Error: failed to parse project manifest
   ╭─[pixi.toml:3:11]
   │
 3 │ version = 3
   │           ┬
   │           ╰── invalid type: integer `3`, expected a string
───╯

and when using a platform that is not added to the platforms array you get:

Error: Targeting a platform that this project does not support
    ╭─[pixi.toml:17:9]
    │
 17 │ [target.osx-64.dependencies]
    │         ───┬──
    │            ╰──── 'osx-64' is not a supported platform
    │
    │ Help: Add 'osx-64' to the `project.platforms` array of the pixi.toml manifest.
────╯

@ruben-arts ruben-arts merged commit c140c71 into prefix-dev:main Jun 20, 2023
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

Successfully merging this pull request may close these issues.

Platform specific configuration
3 participants