Enum SdkSearchLocation

Source
pub enum SdkSearchLocation {
    SdkRootEnv,
    DeveloperDirEnv,
    SystemXcode,
    CommandLineTools,
    XcodeSelectPaths,
    XcodeSelect,
    SystemXcodes,
    Developer(DeveloperDirectory),
    Sdks(PathBuf),
    Sdk(PathBuf),
}
Expand description

Represents a location to search for SDKs.

Variants§

§

SdkRootEnv

Use the path specified by the SDKROOT environment variable.

If this environment variable is defined and the path is not valid, an error occurs.

An SDK yielded from this location skips search filtering. This is because the semantic intent of the SDKROOT environment variable is to force usage of a specific SDK.

If this location yields an SDK, the SDK search will be aborted and subsequent locations will not be searched. This effectively honors the intent of SDKROOT to force usage of a given SDK.

If this behavior is not desirable, construct an SdkSearch with a SdkSearchLocation::Sdk using the value of SDKROOT.

§

DeveloperDirEnv

Use the Developer Directory specified by the DEVELOPER_DIR environment variable.

If this environment variable is defined and the path is not valid, an error occurs.

If this location yields an SDK, the SDK search will be aborted and subsequent locations will not be searched. This effectively honors the intent of DEVELOPER_DIR to explicitly define a developer directory to use for SDK searching.

If this behavior is not desirable, construct an SdkSearch with a SdkSearchLocation::Developer using the value of DEVELOPER_DIR.

§

SystemXcode

Look for SDKs within the system installed Xcode application.

This effectively controls whether the Developer Directory resolved by DeveloperDirectory::default_xcode() will be searched, if available.

§

CommandLineTools

Look for SDKs within the system install Xcode Command Line Tools installation.

This effectively uses the directory returned by command_line_tools_sdks_directory(), if available.

§

XcodeSelectPaths

Check the paths configured by xcode-select --switch.

This effectively controls whether the Developer Directory resolved by DeveloperDirectory::from_xcode_select_paths() will be searched, if available.

§

XcodeSelect

Invoke xcode-select to find a Developer Directory to search.

This mechanism is intended as a fallback in case other (pure Rust) mechanisms for locating the default Developer Directory fail. If you find yourself needing this, it likely points to a gap in our feature coverage to locate the default Developer Directory without running external tools. Consider filing a bug against this crate to track closing the feature gap.

§

SystemXcodes

Look for SDKs within all system installed Xcode applications.

This effectively controls whether the paths resolved by DeveloperDirectory::find_system_xcodes() will be searched, if present.

Many macOS systems only have a single Xcode application at /Applications/Xcode.app. However, environments like CI workers and developers having beta versions of Xcode installed may have multiple versions of Xcode available. This option can enable multiple copies of Xcode to be used.

§

Developer(DeveloperDirectory)

Use an explicit Developer Directory.

This can be used to point a search at a non-standard location holding a Developer Directory. A common use case for this is when cross-compiling or using hermetic / chroot / container build environments that don’t resemble a common macOS system layout and therefore prohibit use of mechanisms for locating a Developer Directory in default locations.

§

Sdks(PathBuf)

Use an explicit directory holding SDKs.

This is similar to Self::Developer with regards to its intended use cases. The difference is the path is a directory holding *.sdk directories, not a Developer Directory.

§

Sdk(PathBuf)

Use an explicit directory holding an SDK.

Trait Implementations§

Source§

impl Clone for SdkSearchLocation

Source§

fn clone(&self) -> SdkSearchLocation

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SdkSearchLocation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SdkSearchLocation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.