mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
55dfed83c0
514b00cf08
exposed another bug in the
existing wrapper logic: Darwin SDK variables are only exported by
the SDK package hook, so if those variables aren’t already exported
inside the wrappers, the modified versions are not passed down to the
compiler tools, breaking the fallback SDK logic. This was previously
partially masked by passing down a normally‐redundant `-isysroot`
to the compiler, but now we fix it at the source.
This broke e.g. running `clang(1)` without any environment, something
the GHC binary package `installCheckPhase` does indirectly to verify
that there’s nothing missing from the wrapped GHC `$PATH`. It may
also have caused issues building for the build platform inside a
Darwin‐to‐non‐Darwin cross‐compilation build.
17 lines
906 B
Bash
17 lines
906 B
Bash
accumulateRoles
|
|
|
|
# Only set up `DEVELOPER_DIR` if a default darwin min version is set,
|
|
# which is a signal that we're targetting darwin.
|
|
if [[ "@darwinMinVersion@" ]]; then
|
|
# `DEVELOPER_DIR` is used to dynamically locate libSystem (and the SDK frameworks) based on the SDK at that path.
|
|
mangleVarSingle DEVELOPER_DIR ${role_suffixes[@]+"${role_suffixes[@]}"}
|
|
|
|
# Allow wrapped compilers to do something useful when no `DEVELOPER_DIR` is set, which can happen when
|
|
# the compiler is run outside of a stdenv or intentionally in an environment with no environment variables set.
|
|
export DEVELOPER_DIR=${DEVELOPER_DIR_@suffixSalt@:-@fallback_sdk@}
|
|
|
|
# xcbuild needs `SDKROOT` to be the name of the SDK, which it sets in its own wrapper,
|
|
# but compilers expect it to point to the absolute path.
|
|
export SDKROOT="$DEVELOPER_DIR/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
|
|
fi
|