swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.3k stars 10.34k forks source link

[SR-15216] Building apple/swift `main` results in CompileC errors #57538

Open swift-ci opened 2 years ago

swift-ci commented 2 years ago
Previous ID SR-15216
Radar None
Original Reporter ryank (JIRA User)
Type Bug
Environment M1, macOS Big Sur, 11.5.2, Xcode 12.5.1, cmake 3.21.2, ninja 1.10.2, sccache 0.2.15, python 3.9.7 My build script, which was working until late Aug, is below. ``` java SKIP_XCODE_VERSION_CHECK=1 utils/build-script --skip-build-benchmarks \ --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \ --sccache --release-debuginfo --debug-swift --swift-disable-dead-stripping \ --xcode ```
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler, Project Infrastructure | |Labels | Bug | |Assignee | @shahmishal | |Priority | Medium | md5: 0c98f7e7cee87b761599d7f3c736652e

Issue Description:

When building the compiler main branch, it fails with the following errors:

clang: error: unknown argument: '-fswift-async-fp=always'

BUILD FAILED ***
The following build commands failed:
CompileC /Users/ryankingston/swift-project/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-arm64/stdlib/public/Concurrency/Swift.build/Debug/swift_Concurrency-macosx-arm64.build/Objects-normal/arm64/ThreadSanitizer.o /Users/ryankingston/swift-project/swift/stdlib/public/Concurrency/ThreadSanitizer.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/ryankingston/swift-project/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-arm64/stdlib/public/Concurrency/Swift.build/Debug/swift_Concurrency-macosx-arm64.build/Objects-normal/arm64/dummy.o /Users/ryankingston/swift-project/swift/cmake/dummy.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
ERROR: command terminated with a non-zero exit status 65, aborting

A search for error: in the build also gives me:

xcodebuild: error: invalid option '--version'

In the past when I have attempted to update my build by using utils/update-checkout in the command line inside the swift project, and then re-build my Xcode build after the update, the "invalid option --version" error shows up as a "Zero Check error" in Xcode and cancels the re-build - not sure if that is related to that last error in the build log above. So far I have deleted the build entirely and rebuilt it from utils/build-script to circumvent this issue, but would appreciate knowing a more efficient fix.

I'm very new to building the compiler, and I've searched the forums for similar issues but found none. I've deleted the build and rebuilt it 3 times this weekend. I also tried deleting the build and the whole swift-project folder, but same result.

typesanitizer commented 2 years ago

Forum discussion: https://forums.swift.org/t/clang-error-unknown-argument-fswift-async-fp-always/52168