-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Regression: Xcode 15 cannot build correctly for macOS versions older than 10.15 #68163
Comments
|
Thank you for the report. Both reports, that is, and sorry we missed the earlier one. I believe there are two separate problems here. The dyld error on 10.13 is due to the runtime not being present on that OS. Xcode will copy the back-deployment runtime into a .app, but if you're building a bare executable, there's no place to put it. You can install this to allow bare Swift executables to work: https://support.apple.com/kb/DL1998?locale=en_US The crash on 10.14.6 looks like a codegen problem. I was able to reproduce it here with your example. I'm fairly ignorant of compiler matters but I'll be sure this gets attention from the right folks. I've filed a matching issue internally: rdar://114699006. |
|
This bug would also affect iOS 12, so you're presumably seeing the same problem. |
Unfortunately the linker errors occur on 10.13 even with an .app, although it is a little different. On 10.13 with an app, I get: I'm attaching the Xcode project for the test app, although there's nothing special about it—it's just a stock app built for 10.13. |
|
Thanks, I'm able to replicate that problem as well. Filed this internally, and I'll get it to the right people: rdar://114820860 |
|
As a workaround, you can add |
|
Thanks @mikeash. Always enjoyed those "Let's Build" articles back in the day :) |
|
Glad you liked them! And thanks again for the reports here. |
|
On top of that Xcode 15 will fail to weak link libraries prior to macOS 11, so if you have a library whose symbols were not available prior to macOS 11 and you used those symbols with or the Swift equivalent then those symbols were weakly linked and as a result, the entire library was weakly linked. To provide an example, |
I wonder how this workaround actually works. When I check Sometimes when making an Analyzer build, I get a warning that |
|
Now that you mention it, I'm also a little surprised the linker doesn't complain. I would expect it to only be a warning, at least, and be a no-op when targeting ARM. And it's OK for it to be a no-op on ARM, because ARM support only goes back to macOS 11. |
|
I do get a warning when linking the ARM binary: |
|
I can confirm that it still happens with Xcode 15.0. I got alerted after receiving a negative review for my App Store app after publishing an update built with Xcode 15.0, which I thought still supported macOS 10.13. Why does it take so long to fix this issue? |
This is a new issue in Xcode 15.0. |
I mean that it still happens after all the beta releases. |
|
The release notes of Xcode 15.1 beta do not address this issue at all. It's neither listed as solved issue nor as a known issue. The release notes of Xcode 15.0 at least list that as a known issue:
https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes Good news are that another issue is solved with 15.1:
https://developer.apple.com/documentation/xcode-release-notes/xcode-15_1-release-notes That is unless you use weak symbols with LTO, this can still fail and is still listed as a known issue:
Since other problems with Xcode 15 prevents me from making a testable release build at the moment, I cannot test myself if Xcode 15.1 might also address 114820860 already and it's just not in the release notes. I case it doesn't, at least there is hope that an upcoming beta might do so. |
Better than nothing. But if Xcode 15 officially supports macOS 10.13, then it shouldn't take so long to fix the issue. Since it was known from the beginning, Xcode 15 should have removed support for 10.13 at least as long as the issue wasn't fixed. Not everybody reads the release notes. |
|
Solved in Xcode 15.1 beta |
The Xcode 15.1 beta release notes don’t actually say that. |
|
@michaeljtsai the issue was finally confirmed with a workaround in the Xcode 15.1 Beta 2 release notes: https://forums.swift.org/t/regression-xcode-15-cant-build-swift-for-macos-earlier-than-10-15/66986/8 |
Just put it to the test ... and the answer is: Fixed! 🥳 Xcode 15.1 Beta 3 can make builds that run on macOS 10.13 and you neither have to explicitly use the legacy linker ( Now I only need to figure out, why those builds still crash on 10.14. They run fine on 10.13 and 10.15, but still crash on 10.14 as the dynamic linker still tries to load a symbol that apparently is not there. It fails in |
|
I repeated this bug with Xcode 15.1 built-in SDK (targeting macOS 10.13). It seems like an issue with Xcode itself. I am sending a DTS to Apple. |
Did you get any response from Apple? |
|
@nickasd No. However, I found a workaround. The workaround is: Disable "Generate asset symbols" for SwiftUI. |
|
Same bug here with Xcode 15.2/15.3 - The app uses AppKit, Obj-C, and Swift. The asset symbol workaround appears to work - so far… |
|
Please be aware that a similar Xcode bug like the one discussed above has surfaced recently: |
|
Thanks for your precious intel. My decision of keeping my mac at Xcode 15.3 is right. I do wonder why the bloody hell Xcode 15.4 got released without unit tests against macOS 10.13 target. // Not talking about runing Xcode on it but let the apps built by Xcode run on it. |




Description
According to the documentation, Xcode is supposed to be able to build for macOS 10.13 and up. However, this does not seem to be the case in practice; my testers on 10.14.6 have reported random crashes when trying to test my app when built with Xcode 15 beta. I've isolated the code that crashes to a simple test case, and posted it on GitHub Issues, but it seems to have attracted no attention:
#67614
I've reproduced the bug in Xcode 15 beta 5, beta 6, and beta 7.
What's more, I decided to spin up a macOS 10.13 VM in UTM to see what would happen there. On 10.13 it doesn't even launch:
It seems that Xcode 15 is not correctly including the embedded Swift libraries for use on macOS versions older than 10.15. On macOS 10.14.6, it seems there are embedded Swift libraries in
/usr/lib/swift, but they are apparently buggy and not compatible with modern Swift code. The net result is that although it claims to be able to build for 10.13, the effective minimum target is 10.15, and this should either be fixed before release, or the documentation should be updated to reflect the change.Steps to reproduce
Write this code to a file called
crashexample.swift:Then compile it with the following command:
swiftc -O -target x86_64-apple-macos10.13 crashexample.swiftNow copy the resulting binary to a Mac running an older macOS version. On 10.14.6 it will crash. On 10.13 it will not even start up.
Expected behavior
Code should work, and not crash, or Xcode should be updated to reflect that its actual minimum target is 10.15.
Environment
The text was updated successfully, but these errors were encountered: