Skip to content
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

Cleanup Apple-related code in rustc_target #103929

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

BlackHoleFox
Copy link
Contributor

While working on #103455, the consistency of the rustc_target code for Apple's platforms was "kind of bad." There were two "base" files (apple_base.rs and apple_sdk_base.rs) that the targets each pulled some parts out of, each and all of them were written slightly differently, and sometimes missed comments other implementations had.

So to hopefully make future maintenance, like implementing rust-lang/compiler-team#556, easier, this makes all of them use similar patterns and the same target base logic everywhere instead of picking bits from both. This also has some other smaller upsides like less stringly-typed functions.

@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2022

r? @fee1-dead

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 3, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 3, 2022

These commits modify compiler targets.
(See the Target Tier Policy.)

@fee1-dead
Copy link
Member

I am not familiar with rustc_target and apple, so rerolling to another reviewer

r? compiler

@rustbot rustbot assigned petrochenkov and unassigned fee1-dead Nov 3, 2022
Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The apple-specific aspects look good to me. Not a compiler reviewer, though.

compiler/rustc_target/src/spec/apple_base.rs Outdated Show resolved Hide resolved
compiler/rustc_target/src/spec/apple_base.rs Show resolved Hide resolved
compiler/rustc_target/src/spec/apple_base.rs Outdated Show resolved Hide resolved
compiler/rustc_target/src/spec/apple_base.rs Outdated Show resolved Hide resolved
compiler/rustc_target/src/spec/aarch64_apple_darwin.rs Outdated Show resolved Hide resolved
compiler/rustc_target/src/spec/apple_base.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2022
@BlackHoleFox
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 5, 2022
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 6, 2022

📌 Commit ae948c6 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 9, 2022
…, r=petrochenkov

Cleanup Apple-related code in rustc_target

While working on rust-lang#103455, the consistency of the `rustc_target` code for Apple's platforms was "kind of bad." There were two "base" files (`apple_base.rs` and `apple_sdk_base.rs`) that the targets each pulled some parts out of, each and all of them were written slightly differently, and sometimes missed comments other implementations had.

So to hopefully make future maintenance, like implementing rust-lang/compiler-team#556, easier, this makes all of them use similar patterns and the same target base logic everywhere instead of picking bits from both. This also has some other smaller upsides like less stringly-typed functions.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 9, 2022
…earth

Rollup of 9 pull requests

Successful merges:

 - rust-lang#101005 (Migrate rustc_codegen_llvm to SessionDiagnostics)
 - rust-lang#103307 (Add context to compiler error message)
 - rust-lang#103464 (Add support for custom mir)
 - rust-lang#103929 (Cleanup Apple-related code in rustc_target)
 - rust-lang#104015 (Remove linuxkernel targets)
 - rust-lang#104020 (Limit efiapi calling convention to supported arches)
 - rust-lang#104156 (Cleanups in autoderef impl)
 - rust-lang#104171 (Update books)
 - rust-lang#104184 (Fix `rustdoc --version` when used with download-rustc)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 017c9aa into rust-lang:master Nov 10, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 10, 2022
@BlackHoleFox BlackHoleFox deleted the apple-targets-cleanup branch November 12, 2022 22:37
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 4, 2022
…oyment, r=oli-obk

Fix passing MACOSX_DEPLOYMENT_TARGET to the linker

I messed up in rust-lang#103929 when merging the two base files together and as a result, started ignoring `MACOSX_DEPLOYMENT_TARGET` at the linker level. This ended up being the cause of nighty builds not running on older macOS versions.

My original hope with the previous PR was that CI would have caught something like that but there were only tests checking the compiler target definitions in codegen tests. Because of how badly this sucks to break, I put together a new test via `run-make` that actually confirms the deployment target set makes it to the linker instead of just LLVM.

Closes rust-lang#104570 (for real this time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants