-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?
- Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands,
swift build,swift test,swift packageetc.
Description
I have a checkout of a package that was previously built and I upgraded my toolchain to a newer version. After upgrading the toolchain, I ran swift test again, and the build failed because modules were not rebuilt.
Expected behavior
SwiftPM should see that the build folder was built with an outdated compiler version and needs to rebuild swift modules that aren't ABI stable.
Actual behavior
SwiftPM build fails with:
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
error: emit-module command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
<unknown>:0: error: compiled module was created by an older version of the compiler; rebuild 'FoundationEssentials' and try again: C:\Users\jmschonfeld\Documents\Repos\swift-foundation\.build\aarch64-unknown-windows-msvc\debug\Modules-tool\FoundationEssentials.swiftmodule
And then appears to hang
Steps to reproduce
- Checkout a package
swift test- Upgrade your toolchain
swift test
Swift Package Manager version/commit hash
October 28th Swift 6.2 development snapshot
Swift & OS version (output of swift --version ; uname -a)
Swift version 6.2-dev (LLVM aeffdf35e6603d0, Swift 678ec6ec6001c6a)
Target: aarch64-unknown-windows-msvc
Build config: +assertions
on a Windows 11 VM (but uname -a does not exist on platforms like Windows)