-
Notifications
You must be signed in to change notification settings - Fork 206
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
Platform specific configuration #43
Comments
In light of the recent work on conda/ceps#54 maybe we can adopt a similar style [dependencies]
bla = { matchspec = "3.1.*", if = "win or osx" } |
I think I like this. It would only work for single dependencies, though. Should we come up with something for a list? |
Ah this method: [dependencies]
bla = { matchspec = "3.1.*", if = "win or osx" } falls apart if you would want to have different matchspecs based on the os: [dependencies]
bla = { matchspec = "3.1.*", if = "win" }
bla = { matchspec = "4.1.*", if = "osx" } The key However, using the cargo method this is possible: [target.'if(win)'.dependencies]
bla = "3.1.*"
[target.'if(osx)'.dependencies]
bla = "4.1.*" Alternatively, we could also accept minijinja syntax in the dependencies list but it makes parsing a lot harder (because we have to post-process the expressions: [dependencies]
bla = '${{ "3.1.*" if win else "4.1.*" }}' its also a bit weird with the to types of quotes.. |
Target specific dependencies have been implemented in: With that you can provide per platform specific dependencies but you cannot easily add a dependency for an architecture or os. We could add a simple expression language to do that. E.g. |
Multi-platform packages will require the need to have platform-specific dependencies or configurations.
Cargo supports this through the
[target]
section.How to format them in TOML?
or cargos approach:
I like the latter the most because its clearer that this is an exception that only applies in a certain scenario.
Selectors or platforms?
Cargo uses the
cfg(..)
syntax in its selectors. I think this is pretty cool because it allows you to do more complex things like selecting for two platforms or for specific architectures (arm vs x86).We could also simplify things a little bit and only use platform names as selectors e.g.
osx-arm64
vssel(osx)
. Cargo also supports specifying the target directly.I would opt to go for the full selector experience because it provides a lot of flexibility.
Todo
The text was updated successfully, but these errors were encountered: