rust/tests
Matthias Krüger 3ec21070e2
Rollup merge of #133041 - madsmtm:print-deployment-target-env-var, r=davidtwco
Print name of env var in `--print=deployment-target`

The deployment target environment variable is OS-specific, and if you're in a place where you're asking `rustc` for the deployment target, you're likely to also wanna know the name of the environment variable. I myself wanted this for some code I'm working on in bootstrap, for example.

Behaviour before this PR:
```console
$ rustc --print=deployment-target --target=aarch64-apple-darwin
deployment_target=11.0
$ rustc --print=deployment-target --target=aarch64-apple-visionos
deployment_target=1.0
```

Behaviour after this PR:
```console
$ rustc --print=deployment-target --target=aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=11.0
$ rustc --print=deployment-target --target=aarch64-apple-visionos
XROS_DEPLOYMENT_TARGET=1.0
```

My _belief_ is that this option is extremely rarely used in general, and a GitHub search for "rustc print deployment-target" seems to confirm this, it revealed only the following actual pieces of code using this:
- b292ef6934/src/build_context.rs (L1199-L1220)
- daab9244b0/src/lib.rs (L3422-L3426)

`maturin` does `.split('=').last()`, so it will continue to work after this change, but `cc v1.0.84` did `.strip_prefix("deployment_target=")` since [this PR](https://github.com/rust-lang/cc-rs/pull/848), so it would break. That's _probably_ fine though, it was broken in a lot of scenarios anyway, and [got](https://github.com/rust-lang/cc-rs/pull/901) [reverted](https://github.com/rust-lang/cc-rs/pull/943) in `v1.0.85`.

So while this is _technically_ a breaking change, I really doubt that anyone is going to observe it, so it's probably fine.

``@BlackHoleFox`` wdyt?

``@rustbot`` label O-apple
r? compiler
2024-12-03 07:48:31 +01:00
..
assembly Rollup merge of #133674 - scottmcm:chain-carrying-add, r=Amanieu 2024-12-01 14:30:11 +01:00
auxiliary Support input/output in vector registers of s390x inline assembly 2024-11-22 04:18:14 +09:00
codegen Rollup merge of #131551 - taiki-e:ppc-asm-vreg-inout, r=Amanieu 2024-11-30 12:57:32 +08:00
codegen-units Share inline(never) generics across crates 2024-11-28 13:43:05 -05:00
coverage coverage: Use a query to identify which counter/expression IDs are used 2024-11-30 00:58:48 +11:00
coverage-run-rustdoc
crashes Rollup merge of #133704 - RalfJung:promoted-size-overflow-ice, r=compiler-errors 2024-12-02 23:08:55 +01:00
debuginfo
incremental Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
mir-opt Add test for -Zdump-mir-dataflow. 2024-12-02 16:19:17 +11:00
pretty Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
run-make Rollup merge of #133041 - madsmtm:print-deployment-target-env-var, r=davidtwco 2024-12-03 07:48:31 +01:00
rustdoc Add regression test for prelude types 2024-11-25 17:25:25 +01:00
rustdoc-gui
rustdoc-js
rustdoc-js-std
rustdoc-json Rollup merge of #133721 - aDotInTheVoid:rdj-dyn-link, r=GuillaumeGomez 2024-12-02 17:36:05 +01:00
rustdoc-ui Rollup merge of #133595 - GuillaumeGomez:missing_doc_code_examples, r=notriddle 2024-12-01 14:30:09 +01:00
ui Rollup merge of #133041 - madsmtm:print-deployment-target-env-var, r=davidtwco 2024-12-03 07:48:31 +01:00
ui-fulldeps Add pretty-printer parenthesis insertion test 2024-12-01 21:31:02 -08:00
COMPILER_TESTS.md