swiftlang/swift-package-manager

Swift 6.0 on Windows fails to run -- two DLL-related errors

Opened this issue · 0 comments

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI.

Description

None of the available Windows development snapshots from swift.org run on the latest build of Windows 11 Pro; swift and swiftc crash immediately with 2 message-box errors, one after the other:

swift.exe - Entry Point Not Found
The procedure entry point swift_willThrowTypedImpl could not be located in the dynamic link library C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\TSCBasic.dll.

swift.exe - Entry Point Not Found
The procedure entry point $s8Dispatch0A5QueueC5async5group3qos5flags7executeyAA0A5GroupCSg_AA0A3QoSVAA0A13WorkItemFlagsVyyYvXBtF could not be located in the dynamic link library C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin\TSCUtility.dll.

Note: It's possible I might have typed in that mangled name wrong, since Windows didn't let me copy it out of the error dialog.

Swift 5.10 and earlier run fine; by using the --toolchain flag with a Swift 5.10 executable, an additional error appears on the console after the two GUI errors:

error: InternalError(description: "Internal error. Please file a bug at https://github.com/apple/swift-package-manager/issues with this info. Failed to parse target info (malformed(json: \"\", underlyingError: Error Domain=NSCocoaErrorDomain Code=3840 \"The data is not in the correct format.\")).\nRaw compiler output: ")

Most other swift commands crash with variants of the first error listed above -- the procedure name (swift_willThrowTypedImpl) remains the same, but the offending DLL differs. Here's a list of what each command gives:

  • swift-build, swift-package, swift-run, swift-test -- ArgumentParser.dll, Commands.dll, CoreCommands.dll, Workspace.dll (sometimes PackageGraph.dll or Build.dll instead)
  • swift-demangle -- works
  • swift-format -- ArgumentParser.dll
  • swift-frontend -- works?! (see below)
  • swift-help -- ArgumentParser.dll, TSCBasic.dll

Oddities

Strangely, if I run swift-frontend instead of swift or swiftc, the REPL starts (and appears to be fully functional) after something relating to swift-healthcheck. Here's the output of that:

==== LLDB swift-healthcheck log. ===
This file contains the configuration of LLDB's embedded Swift compiler to help diagnosing module import and search path issues. The swift-healthcheck command is meant to be run *after* an error has occurred.
lldb version 17.0.6
Swift version 6.0-dev (LLVM e878388283d7b73, Swift eb92e6e50035d21)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration(SwiftASTContext*)0000029C037C48F0:
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Swift/C++ interop                : off
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Swift/Objective-C interop        : off
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Architecture                     : x86_64-unknown-windows-msvc
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   SDK path                         : C:\Users\0zinc\AppData\Local\Programs\Swift\Platforms\6.0.0\Windows.platform\Developer\SDKs\Windows.sdk
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Runtime resource path            : C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\lib\swift
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Runtime library paths            : (1 items)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\lib\swift\windows
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Runtime library import paths     : (4 items)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\lib\swift\windows
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\lib\swift\windows\x86_64
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     C:\Users\0zinc\AppData\Local\Programs\Swift\Platforms\6.0.0\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\windows
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     C:\Users\0zinc\AppData\Local\Programs\Swift\Platforms\6.0.0\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\windows\x86_64
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Framework search paths           : (0 items)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Import search paths              : (0 items)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Extra clang arguments            : (2 items)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     -D_MT
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     -D_DLL
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --   Plugin search options            : (1 items)
SwiftASTContextForExpressions::lldb_private::SwiftASTContext::LogConfiguration() --     -plugin-path C:\Users\0zinc\AppData\Local\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin
Welcome to Swift version 6.0-dev (LLVM e878388283d7b73, Swift eb92e6e50035d21).
Type :help for assistance.
1>

Running import Foundation causes this message to appear again (though Foundation is successfully imported and can be used). The print function doesn't seem to do anything, and readLine immediately returns nil, but other than that, the REPL works fine here.

Additional Info

Swift 6.0 was installed through the GUI installer provided on swift.org. Swift 5.10 was installed via winget.

Expected behavior

For swift, swiftc, etc. to, well, run.

Actual behavior

swift, swiftc, etc. did not run (though, strangely enough, swift-frontend did).

Steps to reproduce

No response

Swift Package Manager version/commit hash

eb92e6e50035d21 (I think)

Swift & OS version (output of swift --version ; uname -a)

(unable to run swift.exe; all available main and release/6.0 development branches on swift.org cause this issue)

Output of ver: Microsoft Windows [Version 10.0.22631.3672]