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§

cuda
Provides functionality to detect the CUDA version present on the current system.
libc
Low-level functions to detect the LibC family and version. See libc_family_and_version.
linux
Low-level functions to detect the linux version on the system. See linux_version.
osx
Low-level functions to detect the OSX version of the system. See osx_version.
win
Low-level functions to detect the Windows version on the system. See windows_version.

Structs§

Cuda
Cuda virtual package description
LibC
LibC virtual package description
Linux
Linux virtual package description
Osx
OSX virtual package description
VirtualPackageOverrides
Configure the overrides used in this crate.
VirtualPackages
A struct that represents all virtual packages provided by this library.
Windows
Windows virtual package description

Enums§

Archspec
Archspec describes the CPU architecture
DetectVirtualPackageError
An error that might be returned by VirtualPackage::current.
Override
Configure the overrides used in in this crate.
VirtualPackage
An enum that represents all virtual package types provided by this library.

Traits§

EnvOverride
Traits for overridable virtual packages Use as Cuda::detect(override)