Crate rattler_virtual_packages
source ·Expand description
A library to detect Conda virtual packages present on a system.
A virtual package represents a package that is injected into the solver to provide system information to packages. This allows packages to add dependencies on specific system features, like the platform version, the machines architecture, or the availability of a Cuda driver with a specific version.
This library provides both a low- and high level API to detect versions of virtual packages for the host system.
To detect all virtual packages for the host system use the
VirtualPackage::detect
method which will return a memoized slice of all
detected virtual packages. The VirtualPackage
enum represents all
available virtual package types. Using it provides some flexibility to the
user to not care about which exact virtual packages exist but still allows
users to override specific virtual package behavior. Say for instance you
just want to detect the capabilities of the host system but you still want
to restrict the targeted linux version. You can convert an instance of
VirtualPackage
to GenericVirtualPackage
which erases any typing for
specific virtual packages.
Each virtual package is also represented by a struct which can be used to
detect the specifics of one virtual package. For instance the
Linux::current
method returns an instance of Linux
which contains the
current Linux version. It also provides conversions to the higher level API.
Finally at the core of the library are detection functions to perform
specific capability detections that are not tied to anything related to
virtual packages. See cuda::detect_cuda_version_via_libcuda
as an
example.
Modules§
- Provides functionality to detect the CUDA version present on the current system.
- Low-level functions to detect the
LibC
family and version. Seelibc_family_and_version
. - Low-level functions to dect the linux version on the system. See
linux_version
. - Low-level functions to detect the OSX version of the system. See
osx_version
.
Structs§
- Archspec describes the CPU architecture
- Cuda virtual package description
LibC
virtual package description- Linux virtual package description
- OSX virtual package description
- Configure the overrides used in this crate.
Enums§
- An error that might be returned by
VirtualPackage::current
. - Configure the overrides used in in this crate.
- An enum that represents all virtual package types provided by this library.
Traits§
- Traits for overridable virtual packages Use as
Cuda::detect(override)