-
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 package
etc.
Description
The SwiftBuild integration with SwiftPM does not support the same module aliasing features as the native build system. This can be observed by building sample packaged in SwiftPM's code base.
it appears the PIF Builder does not handle module aliasing as the following error occurs
error: The workspace contains multiple targets with the same GUID 'PACKAGE-PRODUCT:Utils'
Expected behavior
The sample package are successfully build
Actual behavior
the following errors occur.
error: The workspace contains multiple targets with the same GUID 'PACKAGE-PRODUCT:Utils'
Steps to reproduce
- Clone the Swift PM repository
- Run the following, which builds successfully:
❯ swift run swift-build --package-path Fixtures/ModuleAliasing/DirectDeps1/AppPkg --build-system swiftbuild --configuration debug ❯ swift run swift-build --package-path Fixtures/ModuleAliasing/DirectDeps1/AppPkg --build-system swiftbuild --configuration release
- Run the following, which failed to build
❯ swift run swift-build --package-path Fixtures/ModuleAliasing/DirectDeps2/AppPkg --build-system swiftbuild --configuration debug ❯ swift run swift-build --package-path Fixtures/ModuleAliasing/DirectDeps2/AppPkg --build-system swiftbuild --configuration release ❯ swift run swift-build --package-path Fixtures/ModuleAliasing/NestedDeps1/AppPkg --build-system swiftbuild --configuration debug ❯ swift run swift-build --package-path Fixtures/ModuleAliasing/NestedDeps1/AppPkg --build-system swiftbuild --configuration release ❯ swift run swift-build --package-path Fixtures/ModuleAliasing/NestedDeps2/AppPkg --build-system swiftbuild --configuration debug
Swift Package Manager version/commit hash
cacb4fb70693e4c517614dc3d1904f1a4b689c7f
Swift & OS version (output of swift --version ; uname -a
)
❯ uname -a
Darwin BKs-Work-M1Pro-MacBook-Pro-5.local 25.0.0 Darwin Kernel Version 25.0.0: Sat Jul 12 00:30:16 PDT 2025; root:xnu_development-12377.0.154.0.2~25/DEVELOPMENT_ARM64_T6000 arm64