Hi everyone,
I'm experiencing a critical issue with Swift 6.2 on Linux where SwiftPM hangs indefinitely during any incremental build.
Environment
- Swift: 6.2 (swift-6.2-RELEASE)
- OS: Ubuntu 24.04.3 LTS
- Kernel: Linux 6.8.0-60-generic x86_64
The Problem
After the initial clean build succeeds, any subsequent swift build hangs forever at the "Planning build" phase. This happens even on a
minimal project created with swift package init.
# First build - works fine
swift build
# Output: Build complete! (5-10 seconds)
# Second build - hangs indefinitely
swift build
# Hangs at "Planning build", never completes
What I've Tried
swift build -Xswiftc -whole-module-optimization - still hangs
swift build -c release - still hangs
swift build --verbose - shows "Planning build" then hangs
Different targets/test commands - all hang
Only workaround: Full reset before each build
swift package purge-cache && swift package reset && swift build
This adds 30-40 seconds to every build, making development impractical.
Impact
This completely breaks the development workflow on Linux. Incremental builds that should take 1-5 seconds now require 30-60 seconds for a full
rebuild every time.
Questions
1. Is this a known regression in Swift 6.2 on Linux?
2. Are there any environment variables or flags to fix incremental compilation?
3. Has anyone else experienced this?
I've filed a GitHub issue with full reproduction steps: SwiftPM hangs indefinitely at "Planning build" on incremental builds since Swift 6.1 in some Ubuntu KVM environments · Issue #9441 · swiftlang/swift-package-manager · GitHub
Any help or insights would be greatly appreciated!