Module install

Source
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::LinkFileError;
pub use link::LinkMethod;
pub use unlink::empty_trash;

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_file for more information.
link_script
Functions for running link scripts (pre-unlink and post-link) for a package
unlink
Unlinking packages from an environment.

Structs§

DefaultProgressFormatter
A default implementation of a ProgressFormatter.
IndicatifReporter
A Reporter implementation to outputs progress bars using indicatif.
IndicatifReporterBuilder
A builder to construct an IndicatifReporter.
InstallDriver
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 InstallDriver helps 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.
InstallOptions
Additional options to pass to link_package to modify the installation process. Using InstallOptions::default works in most cases unless you want specific control over the installation process.
Installer
An installer that can install packages into a prefix.
LinkOptions
Defines which operations can be used to link files to disk.
PythonInfo
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§

InstallError
An error that might occur when installing a package.
InstallationResultRecord
Special kind of record that either can be either minimal or full.
InstallerError
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.
TransactionError
Error that occurred during creation of a Transaction
TransactionOperation
Describes an operation to perform

Traits§

ProgressFormatter
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 the target_dir.
link_package_sync
Given an extracted package archive (package_dir), installs its files to the target_dir.
python_entry_point_template
Returns Python code that, when placed in an executable file, invokes the specified [EntryPoint].