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

[SR-15684] Xcode 13.2 CLI tools building swift in release mode: error: remark: Incremental compilation has been disabled: it is not compatible with whole module optimization #4365

Open
swift-ci opened this issue Jan 4, 2022 · 3 comments
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Jan 4, 2022

Previous ID SR-15684
Radar https://feedbackassistant.apple.com/feedback/9832752
Original Reporter jayayres (JIRA User)
Type Bug

Attachment: Download

Environment

xcodebuild Xcode 13.2, Build version 13C90

Monterey 12.1

M1 Max MBP

Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: e549b419adb482736a0b860db11495c1

Issue Description:

Using Xcode 13.2 command line tools, swift build -c release --arch arm64 --arch x86_64 is resulting in the error:

"error: remark: Incremental compilation has been disabled: it is not compatible with whole module optimization"

being fatal, while in Xcode 13.1 and earlier it was non-fatal.

Steps to reproduce:

Install Xcode 13.2 CLI tools. Unzip attached PackageBug.zip.

cd PackageBug ; ./build.sh

Unzip attached PackageBug.zip.

Adding in --verbose, one can see that both -incremental and -whole-module-optimization are passed in as flags to swiftc. On Xcode 13.1, the line "remark: Incremental compilation has been disabled: it is not compatible with whole module optimization" is present, but it is not fatal; it only becomes fatal on Xcode 13.2, but it seems like the issue is that both -incremental and -whole-module-optimization are passed in from SwiftPM.

@artemcm
Copy link
Contributor

artemcm commented Jan 7, 2022

jayayres (JIRA User) I can't seem to reproduce this with 13.2 (not command-line-tools).

Have you tried it with a full Xcode or with an OSS Toolchain (https://www.swift.org/download/)?

@mayoff
Copy link

mayoff commented Jan 7, 2022

Here's a way to reproduce it:

  1. Get a 16" MacBook Pro M1 Max.

  2. Install macOS 12.1 (21C52).

  3. Install Xcode 13.2.1.xip.

  4. Use xcode-select to select Xcode 13.2.1.

  5. git clone https://github.com/apple/swift-protobuf.git

  6. cd swift-protobuf

  7. xcrun swift build -c release --product protoc-gen-swift --arch arm64 --arch x86_64

  8. echo $?

For me, the exit status ($?) is 1, indicating failure. Note, though, that the last line of output is

100%: Build succeeded 

and indeed ./.build/apple/Products/Release/protoc-gen-swift is an apparently complete, working executable.

In my testing, I have to build for both architectures simultaneously to produce the failure. Building for just one architecture at a time does not induce failure.

@swift-ci
Copy link
Contributor Author

Comment by Jay Ayres (JIRA)

I can't reproduce this from within Xcode itself. I am confirming as well, for the PackageBug.zip example, that this fails from the command line with error code 1 when I do:

swift build -c release --arch arm64 --arch x86_64

but single-architecture builds do not fail.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants