Open madsmtm opened 1 year ago
I know that a crate can emit cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET
in their build.rs
to opt in to this behaviour, but I'm not sure that's enough if there are other cached crates in the dependency graph that may have been built with a different deployment target?
This also affects other apple targets with their *_DEPLOYMENT_TARGET
s. Looks like the relevant code should somehow add the env var to sess.parse_sess.env_depinfo
. I'm not sure what the nicest way to ensure that would be.
cc @BlackHoleFox
I'll add that this also affects the environment variable SDKROOT
rustc
reads theMACOSX_DEPLOYMENT_TARGET
environment variable (and similar other*_DEPLOYMENT_TARGET
variables), and uses that value to determine (probably amongst other things) certain options for LLVM and the linker.However, it seems like this environment variable is not tracked as an external dependency, meaning that changing it does not cause
rustc
/cargo
to rebuild the target, as is otherwise expected when changing environment variables that modify compilation.E.g. running the following code:
I expected to see this happen: The project was built twice.
Instead, this happened: The project was built once, and then the cache was used the second time.
Meta
rustc --version --verbose
: