-
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
While working on a change to migrate the PackageCommandTests to Swift Testing and augmenting the test to run against the SwiftBuild and both build configuration, it was discovered that, using the Native build system in release
configuration, applying the fix-its fails as the swift package migrate
is unable to find the .dia
file.
Expected behavior
Running swift run swift-package migrate --package-path Fixtures/SwiftMigrate/StrictMemorySafetyMigration -c release --to-feature StrictMemorySafety
is successful.
Actual behavior
Running swift run swift-package migrate --package-path Fixtures/SwiftMigrate/StrictMemorySafetyMigration -c release --to-feature StrictMemorySafety
fails.
❯ swift run swift-package reset --package-path Fixtures/SwiftMigrate/StrictMemorySafetyMigration
❯ swift run swift-package migrate --package-path Fixtures/SwiftMigrate/StrictMemorySafetyMigration -c release --to-feature StrictMemorySafety
[1/1] Planning build
Building for debugging...
[1/1] Write swift-version-61A6B76668897818.txt
Build of product 'swift-package' complete! (5.20s)
> Starting the build
Building for production...
/Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/SwiftMigrate/StrictMemorySafetyMigration/Sources/Test.swift:4:3: warning: expression uses unsafe constructs but is not marked with 'unsafe' [#StrictMemorySafety]
2 |
3 | func g() {
4 | f()
| |- warning: expression uses unsafe constructs but is not marked with 'unsafe' [#StrictMemorySafety]
| `- note: reference to unsafe global function 'f()'
5 | }
6 |
[#StrictMemorySafety]: <https://docs.swift.org/compiler/documentation/diagnostics/strict-memory-safety>
Build complete! (0.33s)
> Applying fix-its
error: /Users/bkhouri/Documents/git/public/swiftlang/swift-package-manager/Fixtures/SwiftMigrate/StrictMemorySafetyMigration/.build/arm64-apple-macosx/release/Diagnostics.build/Test.dia doesn't exist in file system
❯ find Fixtures/SwiftMigrate/StrictMemorySafetyMigration -iname "*.dia"
Fixtures/SwiftMigrate/StrictMemorySafetyMigration/.build/arm64-apple-macosx/release/Diagnostics.build/Diagnostics.dia
Steps to reproduce
- clone the repository
- change to the root of the cloned swift-package-manager repository
- Run
swift run swift-package migrate --package-path Fixtures/SwiftMigrate/StrictMemorySafetyMigration -c release --to-feature StrictMemorySafety
Swift Package Manager version/commit hash
53116b54c0f7a18df28a559bcb9edd9c06f7add6
Swift & OS version (output of swift --version ; uname -a
)
❯ uname -a
Darwin BKs-Work-M1Pro-MacBook-Pro-6.local 25.0.0 Darwin Kernel Version 25.0.0: Fri Jul 25 23:57:38 PDT 2025; root:xnu_development-12377.0.187.0.2~21/DEVELOPMENT_ARM64_T6000 arm64