Skip to content

Rollup of 13 pull requests #133329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
44933b5
Print env var in --print=deployment-target
madsmtm Nov 14, 2024
0a619dd
Rename `parse_no_flag` to `parse_no_value`
Zalathar Nov 18, 2024
660246b
Don't allow `-Zunstable-options` to take a value
Zalathar Nov 18, 2024
030ddee
don't require const stability for const impls
fee1-dead Nov 20, 2024
3722481
re-export `is_loongarch_feature_detected`
heiher Nov 20, 2024
2487765
Detect const in pattern with typo
estebank Nov 5, 2024
666bcbd
aarch64 softfloat target: always pass floats in int registers
RalfJung Nov 16, 2024
0465f71
Stop being so bail-y in candidate assembly
compiler-errors Nov 21, 2024
5d30436
Re-delay a resolve `bug`
jieyouxu Nov 21, 2024
514ef18
constify `Add`
fee1-dead Nov 20, 2024
f74fdd2
Add code example for `wrapping_neg` method for signed integers
GuillaumeGomez Nov 21, 2024
9a30362
Update TRPL to latest, including new Chapter 17: Async and Await
chriskrycho Oct 17, 2024
34b4518
Update messages which reference book chs. 17-20
chriskrycho Oct 17, 2024
85c582c
Add support for `--library-path` to `rustbook test`
chriskrycho Oct 18, 2024
e0d7cf0
Update bootstrap tests to support book dependencies
chriskrycho Oct 18, 2024
99832cb
rustbook: fix two small typos
chriskrycho Oct 18, 2024
02f51ec
Change to pass "strip" options in an array of string slices and add o…
xingxue-ibm Nov 19, 2024
21dd59f
Update tests for new TRPL chapter order
chriskrycho Oct 30, 2024
30f9f60
Vendor `trpl` crate so The Book tests work offline
chriskrycho Nov 20, 2024
a4a06b3
Use arc4random of libc for RTEMS target
thesummer Nov 21, 2024
de741d2
distinguish overflow and unimplemented in Step::steps_between
michirakara Sep 26, 2024
6ddc947
Rollup merge of #130867 - michirakara:steps_between, r=dtolnay
jhpratt Nov 22, 2024
0e940f9
Rollup merge of #131859 - chriskrycho:update-trpl, r=onur-ozkan
jhpratt Nov 22, 2024
72cd074
Rollup merge of #132090 - compiler-errors:baily, r=lcnr
jhpratt Nov 22, 2024
f2d0388
Rollup merge of #132658 - estebank:const-in-pattern-typo, r=Nadrieril
jhpratt Nov 22, 2024
b0420b3
Rollup merge of #133041 - madsmtm:print-deployment-target-env-var, r=…
jhpratt Nov 22, 2024
8b6b85c
Rollup merge of #133102 - RalfJung:aarch64-softfloat, r=davidtwco,wes…
jhpratt Nov 22, 2024
b65035f
Rollup merge of #133159 - Zalathar:unstable-options-no-value, r=jieyouxu
jhpratt Nov 22, 2024
0c989b2
Rollup merge of #133217 - xingxue-ibm:fix-strip, r=compiler-errors
jhpratt Nov 22, 2024
17a440e
Rollup merge of #133237 - fee1-dead-contrib:constadd, r=compiler-errors
jhpratt Nov 22, 2024
9cf34d6
Rollup merge of #133238 - heiher:loong-stdarch-rexport, r=Amanieu
jhpratt Nov 22, 2024
7058646
Rollup merge of #133286 - jieyouxu:bug-ourselves, r=compiler-errors
jhpratt Nov 22, 2024
36dd052
Rollup merge of #133301 - GuillaumeGomez:add-example-wrapping-neg, r=…
jhpratt Nov 22, 2024
aac0327
Rollup merge of #133313 - thesummer:fix-arc4random, r=cuviper
jhpratt Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Print 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 environment variable.
  • Loading branch information
madsmtm committed Nov 14, 2024
commit 44933b528f9d67d850aaca92d57a0506e53e7b51
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/apple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn minimum_deployment_target(target: &Target) -> OSVersion {
}

/// Name of the environment variable used to fetch the deployment target on the given OS.
fn deployment_target_env_var(os: &str) -> &'static str {
pub fn deployment_target_env_var(os: &str) -> &'static str {
match os {
"macos" => "MACOSX_DEPLOYMENT_TARGET",
"ios" => "IPHONEOS_DEPLOYMENT_TARGET",
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,9 @@ fn print_crate_info(
DeploymentTarget => {
if sess.target.is_like_osx {
println_info!(
"deployment_target={}",
apple::pretty_version(apple::deployment_target(sess))
"{}={}",
apple::deployment_target_env_var(&sess.target.os),
apple::pretty_version(apple::deployment_target(sess)),
)
} else {
#[allow(rustc::diagnostic_outside_of_impl)]
Expand Down
34 changes: 22 additions & 12 deletions tests/run-make/apple-deployment-target/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,31 @@ fn minos(file: &str, version: &str) {

fn main() {
// These versions should generally be higher than the default versions
let (env_var, example_version, higher_example_version) = match apple_os() {
"macos" => ("MACOSX_DEPLOYMENT_TARGET", "12.0", "13.0"),
let (example_version, higher_example_version) = match apple_os() {
"macos" => ("12.0", "13.0"),
// armv7s-apple-ios and i386-apple-ios only supports iOS 10.0
"ios" if target() == "armv7s-apple-ios" || target() == "i386-apple-ios" => {
("IPHONEOS_DEPLOYMENT_TARGET", "10.0", "10.0")
}
"ios" => ("IPHONEOS_DEPLOYMENT_TARGET", "15.0", "16.0"),
"watchos" => ("WATCHOS_DEPLOYMENT_TARGET", "7.0", "9.0"),
"tvos" => ("TVOS_DEPLOYMENT_TARGET", "14.0", "15.0"),
"visionos" => ("XROS_DEPLOYMENT_TARGET", "1.1", "1.2"),
"ios" if target() == "armv7s-apple-ios" || target() == "i386-apple-ios" => ("10.0", "10.0"),
"ios" => ("15.0", "16.0"),
"watchos" => ("7.0", "9.0"),
"tvos" => ("14.0", "15.0"),
"visionos" => ("1.1", "1.2"),
_ => unreachable!(),
};
let default_version =
rustc().target(target()).env_remove(env_var).print("deployment-target").run().stdout_utf8();
let default_version = default_version.strip_prefix("deployment_target=").unwrap().trim();

// Remove env vars to get `rustc`'s default
let output = rustc()
.target(target())
.env_remove("MACOSX_DEPLOYMENT_TARGET")
.env_remove("IPHONEOS_DEPLOYMENT_TARGET")
.env_remove("WATCHOS_DEPLOYMENT_TARGET")
.env_remove("TVOS_DEPLOYMENT_TARGET")
.env_remove("XROS_DEPLOYMENT_TARGET")
.print("deployment-target")
.run()
.stdout_utf8();
let (env_var, default_version) = output.split_once('=').unwrap();
let env_var = env_var.trim();
let default_version = default_version.trim();

// Test that version makes it to the object file.
run_in_tmpdir(|| {
Expand Down
1 change: 1 addition & 0 deletions tests/ui/print-request/macos-target.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ only-apple
//@ compile-flags: --print deployment-target
//@ normalize-stdout-test: "\w*_DEPLOYMENT_TARGET" -> "$$OS_DEPLOYMENT_TARGET"
//@ normalize-stdout-test: "\d+\." -> "$$CURRENT_MAJOR_VERSION."
//@ normalize-stdout-test: "\d+" -> "$$CURRENT_MINOR_VERSION"
//@ check-pass
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/print-request/macos-target.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
deployment_target=$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION
$OS_DEPLOYMENT_TARGET=$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION
Loading