Expand description
This module contains the logic to install a package into a prefix. The main
entry point is the link_package function.
The link_package function takes a package directory and a target
directory. The package directory is the directory that contains the
extracted package archive. The target directory is the directory into which
the package should be installed. The target directory is also called
the “prefix”.
The link_package function will read the paths.json file from the
package directory and link all files specified in that file into the target
directory. The paths.json file contains a list of files that should be
installed and how they should be installed. For example, the paths.json
file might contain a file that should be copied into the target directory.
Or it might contain a file that should be linked into the target directory.
The paths.json file also contains a SHA256 hash for each file. This hash
is used to verify that the file was not tampered with.
Re-exports§
pub use apple_codesign::AppleCodeSignBehavior;pub use link::link_file;pub use link::LinkFileError;pub use link::LinkMethod;pub use unlink::empty_trash;pub use unlink::unlink_package;
Modules§
- apple_
codesign - Code signing for Apple Silicon binaries
- link
- This module contains the logic to link a give file from the package cache into the target directory.
See
link_filefor more information. - link_
script - Functions for running link scripts (pre-unlink and post-link) for a package
- unlink
- Unlinking packages from an environment.
Structs§
- Default
Progress Formatter - A default implementation of a
ProgressFormatter. - Indicatif
Reporter - A
Reporterimplementation to outputs progress bars using indicatif. - Indicatif
Reporter Builder - A builder to construct an
IndicatifReporter. - Install
Driver - Packages can mostly be installed in isolation and therefore in parallel.
However, when installing a large number of packages at the same time the
different installation tasks start competing for resources. The
InstallDriverhelps to assist in making sure that tasks don’t starve each other from resource as well as making sure that due to the large number of requests the process doesn’t try to acquire more resources than the system has available. - Install
Options - Additional options to pass to
link_packageto modify the installation process. UsingInstallOptions::defaultworks in most cases unless you want specific control over the installation process. - Installer
- An installer that can install packages into a prefix.
- Link
Options - Defines which operations can be used to link files to disk.
- Python
Info - Information required for linking no-arch python packages. The struct contains information about a specific Python version that is installed in an environment.
- Transaction
- Describes the operations to perform to bring an environment from one state into another.
Enums§
- Install
Error - An error that might occur when installing a package.
- Installation
Result Record - Special kind of record that either can be either minimal or full.
- Installer
Error - An error returned by the installer
- Placement
- Defines how to place the progress bars. Note that the three progress bars of the reporter are always kept together in the same order. This placement refers to how the group of progress bars is placed.
- Transaction
Error - Error that occurred during creation of a Transaction
- Transaction
Operation - Describes an operation to perform
Traits§
- Progress
Formatter - A trait that can be used to customize the style of different progress bars
of a
IndicatifReporter. - Reporter
- A trait for reporting progress of the installation process.
Functions§
- get_
windows_ launcher - Get the bytes of the windows launcher executable.
- link_
package - Given an extracted package archive (
package_dir), installs its files to thetarget_dir. - link_
package_ sync - Given an extracted package archive (
package_dir), installs its files to thetarget_dir. - python_
entry_ point_ template - Returns Python code that, when placed in an executable file, invokes the specified
[
EntryPoint].