-
Notifications
You must be signed in to change notification settings - Fork 140
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
Xcode 13.3 Beta 3 swift_binary not building #775
Comments
I can reproduce this as well, also with Xcode, it seems like this file isn't produced in some cases now, we need to debug more |
i can reproduce, this just stopped us in our tracks when we upgraded Xcode to 13.3.0 |
As a temporary workaround you can add |
thanks for the quick reply and all of your hard work on this library, @keith 😄 unfortunately you were so quick on your comment that i've yet to complete an Xcode 13.2.1 download, but i'm going to try restoring my toolchain and see if that clears this up. |
ah it's probably because it's for the host configuration, so you'd also have to pass |
in case this helps with diagnosis, @keith
and
all fail in my case with the same message:
previously these builds had succeeded, so it leads me to believe it's the same issue. i haven't upgraded SwiftProtobuf -- it's a transitive dependency, in this case, from |
okay, downloading
everything's building again. |
Looks like none of your build options combinations contains both --swiftcopt=-wmo and --host_swiftcopt=-wmo? |
As a potentially better short term workaround you can pass |
Previously we required this file to be produced by adding it to the outputs of compile actions. Starting with Swift 5.6 in incremental mode the driver no longer produces these files, and instead separates compilation from a single module creation step, instead of producing partial modules and merging them. This leads to this file never being created, and a build failure. This file is never consumed elsewhere, so we don't need to ensure it's created. We still leave it in the output file map so that in the case it is created it's still a validate filepath. swiftlang/swift-driver@e0c3e5c Fixes #775
I think we can just drop this requirement #781 |
Previously we required this file to be produced by adding it to the outputs of compile actions. Starting with Swift 5.6 in incremental mode the driver no longer produces these files, and instead separates compilation from a single module creation step, instead of producing partial modules and merging them. This leads to this file never being created, and a build failure. This file is never consumed elsewhere, so we don't need to ensure it's created. swiftlang/swift-driver@e0c3e5c Fixes #775
I've merged this, please test with HEAD, once I hear back I can work on a new release. I tested with Xcode 13.2.1 and 13.3 and also I tested incremental builds and they passed correctly AFAICT |
With Swift 5.6 the swift driver now emits modules in a separate step, which skips the partial module merging step that happened before. This means partial swiftmodule files are not emitted. This reflects that in our logic for determining this. It's also enabled by default for WMO builds, but that shouldn't matter for now either since we already assumed that. Technically this isn't a perfect solution, this ignores the fact that users could pass -no-emit-modules-separately, or the WMO version of these flags but this doesn't seem to be an issue. swiftlang/swift-driver@e0c3e5c Fixes #775
I'm reverting this and going with another fix, details on #784 |
This fixes #775 by disabling the optimization intended by swiftlang/swift-driver@e0c3e5c Ideally we wouldn't disable it, but that caused other issues #784 and this is no worse than what Swift 5.5 was doing until we find a better fix.
This fixes #775 by disabling the optimization intended by swiftlang/swift-driver@e0c3e5c Ideally we wouldn't disable it, but that caused other issues #784 and this is no worse than what Swift 5.5 was doing until we find a better fix.
So the core issue turned out to be swiftlang/swift-driver#1036, with that, and #781 things work as expected |
This fixes #775 by disabling the optimization intended by swiftlang/swift-driver@e0c3e5c Ideally we wouldn't disable it, but that caused other issues #784 and this is no worse than what Swift 5.5 was doing until we find a better fix.
Ok after even more investigation, that issue is a red-herring (although also a real issue), it seems that #786 is the actual fix we need |
Please test with the new change and I will actually create a release as long as we don't find any new issues in the next day or so |
I've tested this on commit 7b8558c and it's working for me, thank you! |
I'm still getting the same error. I have my workspace set up to use the commit:
Doing a Bazel clean, then a Bazel build is producing the same compile error.
|
Are you loading rules_apple above this? if so it's likely not respecting this version since rules apple loads a pinned version first |
Hi Keith, that looks to have been the problem. I was able to compile the build. Thanks so much for your help! |
Previously we required this file to be produced by adding it to the outputs of compile actions. Starting with Swift 5.6 in incremental mode the driver no longer produces these files, and instead separates compilation from a single module creation step, instead of producing partial modules and merging them. This leads to this file never being created, and a build failure. This file is never consumed elsewhere, so we don't need to ensure it's created. swiftlang/swift-driver@e0c3e5c Fixes bazelbuild#775
This fixes bazelbuild#775 by disabling the optimization intended by swiftlang/swift-driver@e0c3e5c Ideally we wouldn't disable it, but that caused other issues bazelbuild#784 and this is no worse than what Swift 5.5 was doing until we find a better fix.
I've come across an issue with
swift_binary
andmacos_command_line_application
not building with Xcode 13.3 Beta 3 command line tools (specifically the Mac OS 12.3 SDK that ships with it).At first I thought it was an issue with creating a custom rule and passing in a command line tool as the executable, but from creating a simple test project I've come across something else, which may or may not be related.
I've attached a very simple example project which replicates the issue.
You can build a
swift_binary
using Xcode 13.2.1 with no additional flags, but to build it in Xcode 13.3.0 you'll need--swiftcopt=-whole-module-optimization
turned on.The test project provides 3 configs:
bazelisk build SimpleCommandLine --config=success
points at Xcode 13.2.1 and succeeds.bazel clean --expunge
,bazelisk build SimpleCommandLine --config=fail
which points at Xcode 13.3.0 will failbazelisk build SimpleCommandLine --config=success-with-13.3
will succeed because it turns whole module optimization on.Please correct me if I'm just not understanding something, I'm still a Bazel novice.
Thank you for your time!
SimpleCommandLine.zip
This is using Bazel 5.0.0 and rules_apple 0.33.0.
The error given is:
The text was updated successfully, but these errors were encountered: