Skip to content

Error while building SwiftPM library with Windows: "lld-link: error: subsystem must be defined" #8380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
cmcgee1024 opened this issue Mar 18, 2025 · 2 comments
Labels
bug swift build Changes impacting `swift build` windows

Comments

@cmcgee1024
Copy link
Member

cmcgee1024 commented Mar 18, 2025

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 package etc.

Description

SwiftPM libraries are failing to build with the swiftbuild build system with this error when building on Windows x86.

Expected behavior

The package should build without error on Windows x86.

Actual behavior

The package fails to build with the linker error: "lld-link: error: subsystem must be defined".

Steps to reproduce

  • Clone the latest SwiftPM on the main branch
  • Create a simple library package using the init function:
emptydir=$(mktemp -d)
(cd "$emptydir"; swift package init --type=library)
  • Build the project with the swiftbuild build system
swift run swift-build --package-path="$emptydir" --build-system=swiftbuild

See also this test: BuildPlanSwiftBuildTests.testPackageNameFlag (related to #8433).

Swift Package Manager version/commit hash

main

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

6.2-dev Windows x86_64

@cmcgee1024 cmcgee1024 added bug swift build Changes impacting `swift build` labels Mar 18, 2025
@cmcgee1024
Copy link
Member Author

cmcgee1024 commented Mar 18, 2025

See swiftlang/swift-build#310

This could be related: swiftlang/swift-build#104

@dschaefer2
Copy link
Member

Let's move the discussion to swiftlang/swift-build#310.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug swift build Changes impacting `swift build` windows
Projects
None yet
Development

No branches or pull requests

3 participants