-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add deployment-target --print flag for Apple targets #105354
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
These commits modify compiler targets. |
e8476f8
to
2e85d23
Compare
@rustbot label O-macos O-ios |
So far I'm unsure of the flag name. |
2d1db73
to
149846e
Compare
r? compiler |
r? @oli-obk |
This adds a new insta-stable compiler flag. This seems like a good solution to the problem for me. @rfcbot fcp merge |
Team member @oli-obk has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
"ios" => ios_deployment_target(), | ||
"watchos" => watchos_deployment_target(), | ||
"tvos" => tvos_deployment_target(), | ||
_ => unreachable!("unknown Apple target OS"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This arm is reachable with custom target specs.
I suggest returning an Option
here, and relying on it in the driver instead of using sess.target.is_like_osx
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks, and good to know. Moved up to rustc_driver
. For the future, why is doing it there better? Do custom target specs go through a different codepath that wouldn't panic?
149846e
to
95075d9
Compare
This comment has been minimized.
This comment has been minimized.
95075d9
to
cb5927c
Compare
There's now also a test for valid use of the new flag. It isn't very picky about the output beyond requiring that it only contains |
…ter, r=oli-obk Add deployment-target --print flag for Apple targets This is very useful for crates that need to know what the Apple OS deployment target is for their build scripts or inside of a build environment. Right now, the defaults just get copy/pasted around the ecosystem since they've been stable for so long. But with rust-lang#104385 in progress, that won't be true anymore and everything will need to move. Ideally whenever it happens again, this could be less painful as everything can ask the compiler what its default is instead. To show examples of the copy/paste proliferation, here's some crates and/or apps that do: - [cc](https://github.com/rust-lang/cc-rs/pull/708/files), Soon - [mac-notification-sys](https://github.com/h4llow3En/mac-notification-sys/pull/46/files#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42R10-R12) - [PyO3](https://github.com/PyO3/maturin/blob/ccb02d1aa1cc41e82a3572a3c8b35cace15f3e78/src/target.rs#L755-L758) - [Anki](https://github.com/ankitects/anki/blob/613b5c1034cc9943f3f68d818ae22b2e0acec877/build/runner/src/bundle/artifacts.rs#L49-L54) - [jsc-rs](https://github.com/Brooooooklyn/jsc-rs/blob/37767267568fb2de62fc441473e7d158dd980520/xtask/src/build.rs#L402-L405) ... and probably more that a simple GitHub codesearch didn't see
…ter, r=oli-obk Add deployment-target --print flag for Apple targets This is very useful for crates that need to know what the Apple OS deployment target is for their build scripts or inside of a build environment. Right now, the defaults just get copy/pasted around the ecosystem since they've been stable for so long. But with rust-lang#104385 in progress, that won't be true anymore and everything will need to move. Ideally whenever it happens again, this could be less painful as everything can ask the compiler what its default is instead. To show examples of the copy/paste proliferation, here's some crates and/or apps that do: - [cc](https://github.com/rust-lang/cc-rs/pull/708/files), Soon - [mac-notification-sys](https://github.com/h4llow3En/mac-notification-sys/pull/46/files#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42R10-R12) - [PyO3](https://github.com/PyO3/maturin/blob/ccb02d1aa1cc41e82a3572a3c8b35cace15f3e78/src/target.rs#L755-L758) - [Anki](https://github.com/ankitects/anki/blob/613b5c1034cc9943f3f68d818ae22b2e0acec877/build/runner/src/bundle/artifacts.rs#L49-L54) - [jsc-rs](https://github.com/Brooooooklyn/jsc-rs/blob/37767267568fb2de62fc441473e7d158dd980520/xtask/src/build.rs#L402-L405) ... and probably more that a simple GitHub codesearch didn't see
Failed in rollup: #111219 (comment) |
1e45f08
to
a427d41
Compare
Should be ready again, the UI test wasn't flexible enough before to handle different deployment versions. I fixed that and tried it out locally with multiple @rustbot ready |
@bors r+ |
Rollup of 7 pull requests Successful merges: - rust-lang#105354 (Add deployment-target --print flag for Apple targets) - rust-lang#110377 (Update max_atomic_width of armv7r and armv7_sony_vita targets to 64.) - rust-lang#110638 (STD support for PSVita) - rust-lang#111211 (Don't compute trait super bounds unless they're positive) - rust-lang#111315 (Remove `identity_future` from stdlib) - rust-lang#111331 (Mark s390x condition code register as clobbered in inline assembly) - rust-lang#111332 (Improve inline asm for LoongArch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This is very useful for crates that need to know what the Apple OS deployment target is for their build scripts or inside of a build environment. Right now, the defaults just get copy/pasted around the ecosystem since they've been stable for so long. But with #104385 in progress, that won't be true anymore and everything will need to move. Ideally whenever it happens again, this could be less painful as everything can ask the compiler what its default is instead.
To show examples of the copy/paste proliferation, here's some crates and/or apps that do:
... and probably more that a simple GitHub codesearch didn't see