pub struct InstallOptions {
pub target_prefix: Option<PathBuf>,
pub paths_json: Option<PathsJson>,
pub index_json: Option<IndexJson>,
pub link_json: Option<Option<LinkJson>>,
pub allow_symbolic_links: Option<bool>,
pub allow_hard_links: Option<bool>,
pub allow_ref_links: Option<bool>,
pub platform: Option<Platform>,
pub python_info: Option<PythonInfo>,
pub apple_codesign_behavior: AppleCodeSignBehavior,
}Expand description
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.
Fields§
§target_prefix: Option<PathBuf>When files are copied/linked to the target directory hardcoded paths in these files are “patched”. The hardcoded paths are replaced with the full path of the target directory, also called the “prefix”.
However, in exceptional cases you might want to use a different prefix than the one that is being installed to. This field allows you to do that. When its set this is used instead of the target directory.
paths_json: Option<PathsJson>Instead of reading the paths.json file from the package directory
itself, use the data specified here.
This is sometimes useful to avoid reading the file twice or when you want to modify installation process externally.
index_json: Option<IndexJson>Instead of reading the index.json file from the package directory
itself, use the data specified here.
This is sometimes useful to avoid reading the file twice or when you want to modify installation process externally.
link_json: Option<Option<LinkJson>>Instead of reading the link.json file from the package directory
itself, use the data specified here.
This is sometimes useful to avoid reading the file twice or when you want to modify installation process externally.
Because the the link.json file is optional this fields is using a
doubly wrapped Option. The first Option is to indicate whether or
not this value is set. The second Option is the [LinkJson] to use
or None if you want to force that there is no [LinkJson].
This struct is only used if the package to be linked is a noarch Python package.
allow_symbolic_links: Option<bool>Whether or not to use symbolic links where possible. If this is set to
Some(false) symlinks are disabled, if set to Some(true) symbolic
links are always used when specified in the [info/paths.json] file
even if this is not supported. If the value is set to None
symbolic links are only used if they are supported.
Windows only supports symbolic links in specific cases.
allow_hard_links: Option<bool>Whether or not to use hard links where possible. If this is set to
Some(false) the use of hard links is disabled, if set to
Some(true) hard links are always used when specified
in the [info/paths.json] file even if this is not supported. If the
value is set to None hard links are only used if they are
supported. A dummy hardlink is created to determine support.
Hard links are supported by most OSes but often require that the hard link and its content are on the same filesystem.
allow_ref_links: Option<bool>Whether or not to use ref links where possible. If this is set to
Some(false) the use of hard links is disabled, if set to
Some(true) ref links are always used when hard links are specified
in the [info/paths.json] file even if this is not supported. If the
value is set to None ref links are only used if they are
supported.
Ref links are only support by a small number of OSes and filesystems. If reflinking fails for whatever reason the files are hardlinked instead (if allowed).
platform: Option<Platform>The platform for which the package is installed. Some operations like
signing require different behavior depending on the platform. If the
field is set to None the current platform is used.
python_info: Option<PythonInfo>Python version information of the python distribution installed within the environment. This is only used when installing noarch Python packages. Noarch python packages are python packages that contain python source code that has to be installed in the correct site-packages directory based on the version of python. This site-packages directory depends on the version of python, therefor it must be provided when linking.
If you’re installing a noarch python package and do not provide this
field, the link_package function will return
InstallError::MissingPythonInfo.
apple_codesign_behavior: AppleCodeSignBehaviorFor binaries on macOS (both Intel and Apple Silicon), binaries need to be signed
with an ad-hoc certificate to properly work when their signature has been invalidated
by prefix replacement (modifying binary content). This field controls whether or not to do that.
Code signing is executed when the target platform is macOS. By default, codesigning
will fail the installation if it fails. This behavior can be changed by setting
this field to AppleCodeSignBehavior::Ignore or
AppleCodeSignBehavior::DoNothing.
To sign the binaries, the /usr/bin/codesign executable is called with
--force, --sign -, and --preserve-metadata=entitlements arguments.
The --force argument is used to overwrite existing signatures, the --sign -
argument is used to sign with an ad-hoc certificate (which does not use an identity
at all), and --preserve-metadata=entitlements preserves the original entitlements
from the binary (required for programs that need specific permissions like virtualization).
Trait Implementations§
Source§impl Clone for InstallOptions
impl Clone for InstallOptions
Source§fn clone(&self) -> InstallOptions
fn clone(&self) -> InstallOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for InstallOptions
impl Default for InstallOptions
Source§fn default() -> InstallOptions
fn default() -> InstallOptions
Auto Trait Implementations§
impl Freeze for InstallOptions
impl RefUnwindSafe for InstallOptions
impl Send for InstallOptions
impl Sync for InstallOptions
impl Unpin for InstallOptions
impl UnwindSafe for InstallOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more