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

Add specifiers for virtual packages to the project toml file. #32

Closed
Tracked by #5
ruben-arts opened this issue May 30, 2023 · 8 comments · Fixed by #46
Closed
Tracked by #5

Add specifiers for virtual packages to the project toml file. #32

ruben-arts opened this issue May 30, 2023 · 8 comments · Fixed by #46
Assignees

Comments

@ruben-arts
Copy link
Contributor

Allow users to define virtual packages in the project configuration.

@ruben-arts ruben-arts self-assigned this May 30, 2023
@baszalmstra baszalmstra mentioned this issue May 31, 2023
2 tasks
@ruben-arts
Copy link
Contributor Author

Im having a hard disscussion with myself on how we shoudl specify the virtual packages.
But from a user perspective it could be as simple as adding them to the dependencies right?

[dependencies]
pytorch = "1.0"
__glibc = "2.17"
__aarchspec = { version = "1", build_string = "arm64"}

@wolfv
Copy link
Member

wolfv commented May 31, 2023

Hmm, well, the problem is that these virtual dependencies specify a lower boundary on the system. E.g. with __glibc==2.17 one would only be guaranteed to be able to use the environment with a Linux that has glibc >=2.17 installed.

For that reason I think they are different enough to have their own section.

We could also call the section [system-requirements] for example, and then say something like

[system-requirements.linux]
glibc = ">=2.17"

[system-requirements.osx-arm64]
macos = ">=12"

etc.

@baszalmstra
Copy link
Contributor

I like @wolfv s approach!

@ruben-arts
Copy link
Contributor Author

I like it too! will continue with that!

@baszalmstra
Copy link
Contributor

Although for the “selector” (e.g. linux) we need a seperate system still. Ill create an issue tomorrow so we can discuss.

@ruben-arts
Copy link
Contributor Author

Right now virtual packages in the solve are specified like:

pub virtual_packages: Vec<GenericVirtualPackage>

This expects a version, not a match spec. Should that be changed?

@baszalmstra
Copy link
Contributor

No that is correct. It describes the availabe virtual packages available on the system. So its an explicit version not a matchspec. You can see it as the “installed” virtual packages.

When we specify this in our project file it describes the minimum available virtual packages that should be present on the system for the lock file to be valid.

Packages (and thus also dependencies) can also specify dependencies on virtual packages. These should go in the normal dependencies section. (just like you mentioned earlier) However there they are no different from any other dependency and therefor dont need special treatment.

@baszalmstra
Copy link
Contributor

baszalmstra commented Jun 1, 2023

[system_requirements]
windows = true
unix = true
cuda = "12.2"
macos = "10.15"
libc = { family = "glibc", version = "2.12" }

[target.osx-arm64.system_requirements]
cuda = "12.1"

[target.'not(osx-arm64)'.system_requirements]
cuda = "12.3"

So depending on the key the value is specific..

@baszalmstra baszalmstra added this to the Add the multi platform magic milestone Jun 2, 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 a pull request may close this issue.

3 participants