[Windows] regression: `swift --version`, `swift build` does not output anything to console and returns immediately
Description
There appears to have been a regression on the nightly main Windows toolchain sometime between March 10 and March 25, 2025 OSS toolchain, where running swift build in a directory containing a Package.swift outputs nothing to the console and returns immediately.
Reproduction
- Installed the Windows nightly Swift Toolchain using the executable
- Open a new Powershell window
- Clone a repository that has a
Package.swift(I cloned https://github.com/swiftlang/swift-package-manager) - Change to that directory
- Run
swift build
Expected behavior
A build starts, but nothing happens.
Environment
PS C:\Users\bkhouri\Documents\git\swift-package-manager> swiftc -version
PS C:\Users\bkhouri\Documents\git\swift-package-manager>
PS C:\Users\bkhouri> swift --version
PS C:\Users\bkhouri> swift build --version
PS C:\Users\bkhouri> cd .\Documents\git\swift-package-manager\
PS C:\Users\bkhouri\Documents\git\swift-package-manager> swift build --version
PS C:\Users\bkhouri\Documents\git\swift-package-manager> swift build
PS C:\Users\bkhouri\Documents\git\swift-package-manager> git remote -v
origin https://github.com/bkhouri/swift-package-manager.git (fetch)
origin https://github.com/bkhouri/swift-package-manager.git (push)
upstream https://github.com/swiftlang/swift-package-manager.git (fetch)
upstream https://github.com/swiftlang/swift-package-manager.git (push)
PS C:\Users\bkhouri\Documents\git\swift-package-manager>
Additional information
I installed the x86_64 exe installer
cc @compnerd
Analyzed the toolchain at https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2025-03-25-a/swift-DEVELOPMENT-SNAPSHOT-2025-03-25-a-windows10.exe and confirmed that there are a mix of x86_64 and aarch64 binaries. This is an x86_64 toolchain, yet:
./Runtimes/0.0.0/usr/bin/plutil.exe: PE32+ executable (console) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/BlocksRuntime.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/dispatch.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/Foundation.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/FoundationEssentials.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/FoundationInternationalization.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/FoundationNetworking.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/FoundationXML.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftCore.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftCRT.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftDispatch.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftDistributed.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftObservation.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftRegexBuilder.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftRemoteMirror.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftSwiftOnoneSupport.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftSynchronization.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swiftWinSDK.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swift_Concurrency.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swift_Differentiation.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swift_RegexParser.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/swift_StringProcessing.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
./Runtimes/0.0.0/usr/bin/_FoundationICU.dll: PE32+ executable (DLL) (GUI) Aarch64, for MS Windows
The compiler runtimes appear correct:
./Runtimes/0.0.0/usr/bin/concrt140.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/msvcp140_1.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/msvcp140_2.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/msvcp140_atomic_wait.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/msvcp140_codecvt_ids.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/msvcp140.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/vccorlib140.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/vcruntime140_1.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/vcruntime140_threads.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
./Runtimes/0.0.0/usr/bin/vcruntime140.dll: PE32+ executable (DLL) (console) x86-64, for MS Windows
And the toolchain content is all x86_64. So it seems just the runtime part has the wrong arch.
@compnerd Any idea what might've went wrong here which went in between March 10th and 25th?
Perhaps #80024 could be related?
It might be related to that PR - I have a follow up that I am working on right now. This sounds like there is an issue with the DLLs which are being packaged up.
once the issue is fixed, we will need to revert https://github.com/swiftlang/swift-docker/pull/453 to ensure the Windows docker image are no longer pinned to an "older" toolchain version
I think that https://github.com/swiftlang/swift/pull/80157 might fix the issue. Longer term, we need to figure out how to do some smoke testing for Windows with the toolchain itself.
I think that #80157 might fix the issue. Longer term, we need to figure out how to do some smoke testing for Windows with the toolchain itself.
@compnerd : I don't think https://github.com/swiftlang/swift/pull/80157 fixed the issue. Installing the June 9 main nightly toolchain does not yield any results when running swift --version
@bkhouri that doesn't make sense - I just installed that locally in a Windows Sandbox:
C:\Users\WDAGUtilityAccount>swiftc -v
Swift version 6.2-dev (LLVM 3c4a54b02dd62b7, Swift a40a7be6945a895)
Target: x86_64-unknown-windows-msvc
C:\Users\WDAGUtilityAccount>swift --version
Swift version 6.2-dev (LLVM 3c4a54b02dd62b7, Swift a40a7be6945a895)
Target: x86_64-unknown-windows-msvc
Build config: +assertions
Just tried re-installing and it's working now.
Re-opening to track merging of https://github.com/swiftlang/swift-docker/pull/477