-
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
When building Fixtures/DependencyResolution/Internal/InternalExecutableAsDependency
in release configuration using SwiftBuild, the action is successful but it fails when run in debug
Expected behavior
Building in either debug
and release
configuration either both pass or both fail.
Actual behavior
Building in debug
mode fails while building in release
configuration passed. both configuration fail using the native
build system.
Steps to reproduce
- clone the swift-package-manager repository
- Run the following
swift run swift-build --package-path Fixtures/DependencyResolution/Internal/InternalExecutableAsDependency --build-system native --configuration debug swift run swift-build --package-path Fixtures/DependencyResolution/Internal/InternalExecutableAsDependency --build-system native --configuration release swift run swift-build --package-path Fixtures/DependencyResolution/Internal/InternalExecutableAsDependency --build-system swiftbuild --configuration debug swift run swift-build --package-path Fixtures/DependencyResolution/Internal/InternalExecutableAsDependency --build-system swiftbuild --configuration release
- All fail except when using
swiftbuild
andrelease
Applying the following diff caused the release
configuration build to fail, but it may not be the desirable outcome.
diff --git a/Sources/SwiftBuildSupport/PackagePIFBuilder.swift b/Sources/SwiftBuildSupport/PackagePIFBuilder.swift
index 510be26ce..dbf9c18ce 100644
--- a/Sources/SwiftBuildSupport/PackagePIFBuilder.swift
+++ b/Sources/SwiftBuildSupport/PackagePIFBuilder.swift
@@ -612,7 +612,7 @@ public final class PackagePIFBuilder {
releaseSettings[.COPY_PHASE_STRIP] = "YES"
releaseSettings[.DEBUG_INFORMATION_FORMAT] = "dwarf-with-dsym"
releaseSettings[.GCC_OPTIMIZATION_LEVEL] = "s"
- releaseSettings[.SWIFT_OPTIMIZATION_LEVEL] = "-Owholemodule"
+ // releaseSettings[.SWIFT_OPTIMIZATION_LEVEL] = "-Owholemodule"
builder.project.addBuildConfig { id in BuildConfig(id: id, name: "Release", settings: releaseSettings) }
}
Swift Package Manager version/commit hash
3fbec0b4de27c08071e158f51eb1a9d1d75ffe88
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