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

Fix SDKROOT ignore on macOS #130334

Merged
merged 1 commit into from
Sep 14, 2024
Merged

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Sep 14, 2024

rustc has code to detect when SDKROOT is obviously set for the wrong platform, so that it can choose to ignore it. This is a pretty important feature for Cargo build scripts and proc macros, since you will often have SDKROOT set to an iOS platform there.

However, the code was checking for an old SDK version name "macosx10.15" that was previously configured by add_apple_sdk, but nowadays configured to the correct "macosx". I think this error was introduced in part #77202 and in #100286.

Fixes part of #80817 (linking with -Clinker=ld now works), though more work is still needed in this area, see also #129432.

@rustbot label O-macos A-cross

@rustbot
Copy link
Collaborator

rustbot commented Sep 14, 2024

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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. A-cross Area: Cross compilation O-macos Operating system: macOS labels Sep 14, 2024
@jieyouxu jieyouxu assigned jieyouxu and unassigned TaKO8Ki Sep 14, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks, this seems reasonable, though I imagine we would want to mention this in relnotes.

@jieyouxu jieyouxu added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 14, 2024
@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 14, 2024

📌 Commit 56844c7 has been approved by jieyouxu

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 Sep 14, 2024
@madsmtm
Copy link
Contributor Author

madsmtm commented Sep 14, 2024

Thanks, this seems reasonable, though I imagine we would want to mention this in relnotes.

We might not want to do that before it's also fixed when linking with the default linker

Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 14, 2024
…eyouxu

Fix `SDKROOT` ignore on macOS

`rustc` has code to detect when `SDKROOT` is obviously set for the wrong platform, so that it can choose to ignore it. This is a pretty important feature for Cargo build scripts and proc macros, since you will often have `SDKROOT` set to an iOS platform there.

However, the code was checking for an old SDK version name `"macosx10.15"` that was previously configured by `add_apple_sdk`, but nowadays configured to the correct `"macosx"`. I think this error was introduced in part rust-lang#77202 and in rust-lang#100286.

Fixes part of rust-lang#80817 (linking with `-Clinker=ld` now works), though more work is still needed in this area, see also rust-lang#129432.

`@rustbot` label O-macos A-cross
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
Rollup of 3 pull requests

Successful merges:

 - rust-lang#130053 (fix doc comments for Peekable::next_if(_eq))
 - rust-lang#130268 (simd_shuffle: require index argument to be a vector)
 - rust-lang#130334 (Fix `SDKROOT` ignore on macOS)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#130053 (fix doc comments for Peekable::next_if(_eq))
 - rust-lang#130267 (small_data_threshold.rs: Adapt to LLVM head changes)
 - rust-lang#130311 ((fix) conflicting negative impl marker)
 - rust-lang#130334 (Fix `SDKROOT` ignore on macOS)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 73f684f into rust-lang:master Sep 14, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2024
Rollup merge of rust-lang#130334 - madsmtm:macos-sdkroot-ignore, r=jieyouxu

Fix `SDKROOT` ignore on macOS

`rustc` has code to detect when `SDKROOT` is obviously set for the wrong platform, so that it can choose to ignore it. This is a pretty important feature for Cargo build scripts and proc macros, since you will often have `SDKROOT` set to an iOS platform there.

However, the code was checking for an old SDK version name `"macosx10.15"` that was previously configured by `add_apple_sdk`, but nowadays configured to the correct `"macosx"`. I think this error was introduced in part rust-lang#77202 and in rust-lang#100286.

Fixes part of rust-lang#80817 (linking with `-Clinker=ld` now works), though more work is still needed in this area, see also rust-lang#129432.

``@rustbot`` label O-macos A-cross
@rustbot rustbot added this to the 1.83.0 milestone Sep 14, 2024
@madsmtm madsmtm deleted the macos-sdkroot-ignore branch September 14, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cross Area: Cross compilation O-macos Operating system: macOS relnotes Marks issues that should be documented in the release notes of the next release. 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.

5 participants