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

Move versioned Apple LLVM targets from rustc_target to rustc_codegen_ssa #131037

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Sep 29, 2024

Fully specified LLVM targets contain the OS version on macOS/iOS/tvOS/watchOS/visionOS, and this version depends on the deployment target environment variables like MACOSX_DEPLOYMENT_TARGET, IPHONEOS_DEPLOYMENT_TARGET etc.

We would like to move this to later in the compilation pipeline, both because it feels impure to access environment variables when fetching target information, but mostly because we need access to more information from #130883 to do #118204. See also #129342 (comment) for some discussion.

The first commit does the actual refactor, it should be a non-functional change, the second commit adds diagnostics for invalid deployment targets, which are now possible to do because we have access to the session.

Tested with the same commands as in #130435.

r? @petrochenkov

@rustbot rustbot added O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) 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 Sep 29, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 29, 2024

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

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 2, 2024

☔ The latest upstream changes (presumably #131158) made this pull request unmergeable. Please resolve the merge conflicts.

@madsmtm madsmtm force-pushed the move-llvm-target-versioning branch 3 times, most recently from 3bba2a8 to 190c9d9 Compare October 2, 2024 22:19
The OS version depends on the deployment target environment variables,
the access of which we want to move to later in the compilation pipeline
that has access to more information, for example `env_depinfo`.
@madsmtm madsmtm force-pushed the move-llvm-target-versioning branch from 190c9d9 to 7750660 Compare October 3, 2024 14:56
@madsmtm madsmtm mentioned this pull request Oct 10, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants