-
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
rustup
-installed nightly compiler no longer works on MacOS Mojave
#104570
Comments
We might drop older versions (#104385), but even after that, Mojave should still be supported (Mojave is 10.14, we'd be increasing the requirement to 10.12). This is likely an unintentional regression from #103929, although I do not know for sure. It could also be related to CI changes, as you mention. |
Apparently we may have bumped the CI runners to macOS 12 around the same time, which is a CI change that is much more likely to be the root cause than that PR. |
I'll take a look at this one and see if the issue comes from my target cleanup PR. @rustbot claim |
I confirmed with a bisect that it started with #104091 which was the first PR to start using XCode 14. I'm wondering if it is necessary to start using something like |
For my own knowledge going forward, how'd you know that? The GA definition says we're using
Since you figured out what actually introduced it (so not any code changes) I'll look at that instead. |
I've been tracking the issue in #103044. I updated my system to xcode 14, and that test started failing. I also monitor the GitHub changelog blog which announces these changes. When GitHub starts changing the default for a As for determining which image is being used, you can look at the CI logs. For example, in the build for that PR here: https://github.com/rust-lang-ci/rust/actions/runs/3466400077/jobs/5790206511, at the top of the log is "Set up job" which has an entry "Runner image" which tells you which image is being used (and a link to what software is installed). I used that to verify that our CI had migrated to macos-12 when the builds started failing and someone reported it on Zulip. |
I think |
I think I found the issue and solution (though the fix is kinda obvious): As of XCode 14, the macOS SDK no longer supports any versions below 10.13 (High Sierra). While I've yet to test this conclusively my thinking is that even though we're telling the linker On a similar note, @thomcc tried running So given that we're only going to 10.12 in the ongoing-MCP, we're going to be stuck with XCode 13 for the time being to even support host tools on "older" macOS (deploying back should still work). We'll need to override that in any CI job that produces distributed artifacts. I'll test out the theory tomorrow and probably PR that a rough fix for this repo to "confirm"... |
Yes, I can confirm this. Although, cargo also doesn't support 10.7, so I had assumed it was due to that (and to be fair, it still might be!) |
Oh interesting, I missed the compatibility table on that xcode 14 page. We used to have the ability to switch xcode, but it was removed in #89849. I would just resurrect that diff. |
following on that hypothesis from the other day here's the dump from
and then stable's:
so seems like the "its just ignoring us and using the running on system default" is what's happening when you give it a minimum
and then stable's:
|
Reopening, as unfortunately #104650 did not solve the problem. I don't immediately see what else could be the problem, though. |
Bleh, that seems correct sadly. Here's the latest nightly. It seems the same as before with no change:
Maybe downgrading further to XCode 13.2 could at least tell us if the CI process is actually using our desired SDK because that has the 12.1 SDK (not 12.3 like above), so there would be a visible difference). |
Sorry bors, you're being too optimistic. |
I'm not having much luck locally with XCode 13.2 and the 12.1 SDK either :rip: I'll try again a bit later. |
I feel like the XCode version has been a mostly false lead. The most recent beta was built on macos-12 with xcode 14, and it works just fine on macOS 10.13. I confirmed that older versions of rustc don't generate code with LC_DYLD_CHAINED_FIXUPS. I went back to 96ddd32, which was still failing. Going all the way back 5e97720 seems to work. So there is some issue in between those two. If I find some time tomorrow, I might try bisecting doing local builds. That will probably take several hours, though. There's probably still the issue with 10.13 being the min deployment target in xcode 14, but I think that is a secondary issue. |
@BlackHoleFox I think I better understand what is going on. I bisected the change in behavior to #103929. I was a bit confused as there are two factors in play (that PR and the switch in XCode). From what I can tell, it's as-if the deployment target is being completely ignored. I'll keep poking a bit, but maybe you can spot the issue. I see some questionable things about |
I see several differences. apple_sdk_base had different settings from apple_base, but it looks like those were unified. x86_64-apple-darwin was using apple_base which had different settings from the sdk one. The Target option differences look like: --- b 2022-11-28 16:53:46.718160978 -0800
+++ a 2022-11-28 16:53:36.398616799 -0800
@@ -20,6 +20,7 @@
"ZERO_AR_DATE=1"
],
"link-env-remove": [
+ "MACOSX_DEPLOYMENT_TARGET",
"IPHONEOS_DEPLOYMENT_TARGET"
],
"linker-is-gnu": false,
@@ -33,6 +34,14 @@
"x86_64",
"-m64"
],
+ "ld": [
+ "-arch",
+ "x86_64",
+ "-platform_version",
+ "macos",
+ "10.7",
+ "10.7"
+ ],
"ld64.lld": [
"-arch",
"x86_64",
@@ -44,7 +53,12 @@
},
"split-debuginfo": "packed",
"stack-probes": {
- "kind": "call"
+ "kind": "inline-or-call",
+ "min-llvm-version-for-inline": [
+ 16,
+ 0,
+ 0
+ ]
},
"supported-sanitizers": [
"address", For example, @BlackHoleFox Will you have some time to look fixing that? |
I'm also curious about the supposed increase of the minimum deployment target to 10.13 in Xcode 14. rustc 1.66.0-beta.2, which was built with Xcode 14 seems to work just fine on 10.12. The LC_VERSION_MIN_MACOSX still reports 10.7. I wonder to what degree that change in minimum deployment target affects Rust's use case (which is essentially using clang as a linker). In other words, I'm wondering if #104650 is necessary. My instinct is that it's probably better to be on the safe side and use Xcode 13, but I'm curious what Apple means when they say they raised the minimum. |
@ehuss Thanks for bisecting that down. Checking my PR for issues was next on my list since the XCode route just kept going nowhere. I have the time today to look more at it (and hopefully fix it) but thank you again for the diff and quick findings.
Same here. I had originally interpreted this as what the whole SDK supported, let alone what <key>DEPLOYMENT_TARGET_SUGGESTED_VALUES</key>
<array>
<string>10.9</string>
<string>10.10</string>
<string>10.11</string>
<string>10.12</string>
<string>10.13</string>
<string>10.14</string>
<string>10.15</string>
<string>11.0</string>
<string>11.1</string>
<string>11.2</string>
<string>11.3</string>
<string>11.4</string>
<string>11.5</string>
<string>12.0</string>
<string>12.2</string>
<string>12.3</string>
</array> |
Looking at my other cleanup PR after seeing the target spec diff above, it was surprisingly obvious where the screwup happened around I couldn't grasp enough about how |
Yea, the different variants of
I don't know how many people use ld directly. #103929 did change its behavior in terms of what it links (previously it would pass |
That on the other hand seems like it would break stuff yea. Is there somewhere you saw that I missed looking at just the target specification? I didn't see any library linking arguments set. I diffed the target specifications on 3f11d39 (before I started touching aarch64: diff --git a/Users/fox/Downloads/before_cleanup_aarch64.json b/Users/fox/Downloads/after_cleanup_aarch64.json
index 865bfa43837..41854d7f020 100644
--- a/Users/fox/Downloads/before_cleanup_aarch64.json
+++ b/Users/fox/Downloads/after_cleanup_aarch64.json
@@ -29,6 +29,7 @@
"os": "macos",
"pre-link-args": {
"gcc": [
+ "-m64",
"-arch",
"arm64"
], i686: diff --git a/Users/fox/Downloads/before_cleanup_i686.json b/Users/fox/Downloads/after_cleanup_i686.json
index e39cb59d694..b4184032496 100644
--- a/Users/fox/Downloads/before_cleanup_i686.json
+++ b/Users/fox/Downloads/after_cleanup_i686.json
@@ -29,9 +29,9 @@
"os": "macos",
"pre-link-args": {
"gcc": [
+ "-m32",
"-arch",
- "i386",
- "-m32"
+ "i386"
],
"ld": [
"-arch", x86_64: diff --git a/Users/fox/Downloads/before_cleanup_x86_64.json b/Users/fox/Downloads/after_cleanup_x86_64.json
index f06bcb33e37..30c851ceeeb 100644
--- a/Users/fox/Downloads/before_cleanup_x86_64.json
+++ b/Users/fox/Downloads/after_cleanup_x86_64.json
@@ -29,9 +29,9 @@
"os": "macos",
"pre-link-args": {
"gcc": [
+ "-m64",
"-arch",
- "x86_64",
- "-m64"
+ "x86_64"
],
"ld": [
"-arch", |
@ehuss I compiled a combination of #105123 should actually fix this problem. It doesn't relate to the diff in my previous comment since that turned out to be unnecessary. |
This is nice to hear. Anxiously awaiting for this nightly bug to be fixed soon! |
Did a
Thank you all! |
Confirmed fixed here too. Thanks for what turned out to be a lot more hard work than I was expecting when I raised a "simple" bug report! |
…lacrum Build macOS distribution artifacts with XCode 13 After all of the `rust-lang/rust` Apple runners started using macOS 12, the builds created by CI began to use XCode 14.0.1. Due to this (as far as we can tell), XCode's build tools started to ignore the `MACOSX_DEPLOYMENT_TARGET` being defined by us for the distributed builds that let both `rustc` and `libstd` work on older versions. The current idea is that since XCode 14's macOS SDK doesn't support deployment targets before 10.13, it uses some default of its own. You can see the difference between stable's and the most recent nighty's supported versions [here](rust-lang/rust#104570 (comment)). I wasn't able to confirm my SDK versioning hypothesis locally since I think there's something jammed with my XCode installation, but hopefully this should still fix it for releases. Closes rust-lang/rust#104570 r? `@Mark-Simulacrum`
…lacrum Build macOS distribution artifacts with XCode 13 After all of the `rust-lang/rust` Apple runners started using macOS 12, the builds created by CI began to use XCode 14.0.1. Due to this (as far as we can tell), XCode's build tools started to ignore the `MACOSX_DEPLOYMENT_TARGET` being defined by us for the distributed builds that let both `rustc` and `libstd` work on older versions. The current idea is that since XCode 14's macOS SDK doesn't support deployment targets before 10.13, it uses some default of its own. You can see the difference between stable's and the most recent nighty's supported versions [here](rust-lang/rust#104570 (comment)). I wasn't able to confirm my SDK versioning hypothesis locally since I think there's something jammed with my XCode installation, but hopefully this should still fix it for releases. Closes rust-lang/rust#104570 r? `@Mark-Simulacrum`
Code
I tried this on the latest nightly compiler installed by
rustup
:I expected to see this happen: My project builds.
Instead, this happened:
rustc
crashed due to a dynamic library linkage problem.Version it worked on
It most recently worked on:
rustc 1.67.0-nightly (96ddd32c4 2022-11-14)
.Version with regression
rustc --version --verbose
:It crashes without giving the version, but so far it affects the
rustup
toolchainsnightly-2022-11-16
,nightly-2022-11-17
, andnightly
(which I assume is the same asnightly-2022-11-17
for now.)Backtrace
The
rustc
binary segfaults with the following output:Setting
RUST_BACKTRACE=1
does not get further diagnostics, probably because the compiler isn't even being run due to the linkage problem.Likely cause
I am running MacOS Mojave. Yes, this is quite an old OS release, and no, I'm not intending to upgrade any time soon. It seems likely that whoever is building binaries for the
x86_64-apple-darwin
target has upgraded their build environment and/or changed some settings, inadvertently causing it to produce binaries which require a newer version of MacOS. (Xcode is unhelpful like that.) I haven't seen any announcement of dropping of support for older MacOS versions.The text was updated successfully, but these errors were encountered: