swiftlang / swift

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

[SR-11044] Release version of project builds forever #53433

Open swift-ci opened 5 years ago

swift-ci commented 5 years ago
Previous ID SR-11044
Radar https://feedbackassistant.apple.com/feedback/6345293
Original Reporter Dubovkin (JIRA User)
Type Bug

Attachment: Download

Environment Reproducible with Swift 4 and Swift 5, Xcode 10.1 and 10.2.1 Build command for Xcode 10.2.1: xcodebuild -workspace DummySwift.xcworkspace -scheme DummySwift -sdk iphoneos -arch arm64 -configuration Release build CLANG_ENABLE_MODULE_DEBUGGING=NO CODE_SIGNING_REQUIRED=NO ENABLE_BITCODE=NO COMPILER_INDEX_STORE_ENABLE=NO CODE_SIGNING_ALLOWED=NO -derivedDataPath .Derived.noindex/
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: fe7bf54fdeee3e118893f200b76293a0

Issue Description:

Hey guys, we are doing some build time experiments with auto-generated projects and found an interesting issue for you - RELEASE build never finishes while DEBUG build runs just fine. Just run it overnight and still see 2 swift processes running happily at 100% and have already consumed 15 hours of CPU time.

swift-ci commented 4 years ago

Comment by Jack Newcombe (JIRA)

I'm also seeing this with Swift 5.1 compiler. 'swift build -c debug' generates \~115 tasks for my project and completes, whereas 'swift build -c release' generates \~15 tasks and hangs while either compiling or linking. Adding --verbose doesn't show anything particularly interesting.

There's also a thread of people reporting similar results over at the Apple Developer forums: https://forums.developer.apple.com/thread/115303

swift-ci commented 4 years ago

Comment by Jack Newcombe (JIRA)

Setting '-xswiftc -Onone' also fixes the issue, so it appears to be an issue with swift compiler optimizations