Help needed: issue with Windows Developer toolchain

Hello,

I created a developer toolchain with this SwiftPM PR as we are presenting Swift SBOM at FOSDEM on Saturday February 1.

Using this Swiftlang/swift PR, we were able to get the Windows toolchain built here.

I uninstalled all existing Swift Toolchain before installing the Dev toolchain with the executable installer archived on the Jenkins build.

On face value, the toolchain looks good.

PS C:\Users\bkhouri\Documents> swift --version
Swift version 6.3-dev (LLVM 56997e37453eb73, Swift 1d61917ff1a98c2)
Target: x86_64-unknown-windows-msvc
Build config: +assertions


PS C:\Users\bkhouri\Documents> swift --help
OVERVIEW: Swift compiler

USAGE: swift

OPTIONS:
<...SNIP...>

However, none of the SwiftPM executable target do anything

PS C:\Users\bkhouri\Documents> swift build
PS C:\Users\bkhouri\Documents> swift test --help
PS C:\Users\bkhouri\Documents> swift package --help
PS C:\Users\bkhouri\Documents> swift run --help

I'm not familiar with Windows toolchain build nor what could cause this. The PR does not introduce any new library dependencies, but does add a new SwiftPM target.

Is anyone able to assist with this as we would like to have a toolchain available for the talk attendees as we want to collect feedback.

Thanks.

cc/ @echeng3805 @compnerd @mishal_shah

If you're adding a new library, these types of failures are often missing DLLs in the installer. You may need to update this list in swift-installer-scripts and add that PR to your cross-repo testing: swift-installer-scripts/platforms/Windows/cli/cli.wxi at e651bebe5367ed21a4cb66c10ae046c0a85d8ca9 · swiftlang/swift-installer-scripts · GitHub

1 Like

Thank you Owen. I'll give that a try.

The PR creates a static library. Do we we need to do something else in this case?

add_library(SBOMModel STATIC

This could happen because you didn't restart your shell in between the uninstall and reinstall. The installer modifies the environment that will not be picked up in existing sessions. I would restart your computer and try again.

Here's a few things I tried:

  • Uninstall existing Swift Toolchain
  • Close all Command Prompt and PowerShell session
  • Install Dev Toolchain
  • Open Powershell and try the swift command. Same problem as in the original thread.
  • Restart computer
  • Open Powershell and try the swift command. Same problem as in the original thread.
  • Uninstall SwiftDev toolchain
  • Restart computer
  • Install Swift Dev toolchain
  • Open Powershell and try the swift command. Same problem as in the original thread.

Can you check the output of %LASTEXITCODE% in cmd? I wonder if it is a DLL that is missing.

The exit code is -1073741515. Does this mean something is off with the PR Cmake files?

PS C:\Users\bkhouri> swift --version
Swift version 6.3-dev (LLVM 85bc3cee3d9d8f7, Swift f513a5ea9fadb34)
Target: x86_64-unknown-windows-msvc
Build config: +assertions
PS C:\Users\bkhouri>  $LASTEXITCODE
0
PS C:\Users\bkhouri> swift build
PS C:\Users\bkhouri>  $LASTEXITCODE
-1073741515