You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 using Context.gitInformation to inject the git commit version, incremental builds will not be updated appropriately. Additionally, swift package dump-package will continue to dump a cached version of the git information, and resetting the build state using tools like swift package clean has no effect. Only modifications to Package.swift seem to have an effect, though such modifications change the git information by their very nature, so cannot be relied upon. Changing the file back to a previous state, even with an updated modification date results in a previously cached value being used.
Expected behavior
Every build will check the git state so the correct define is written to.
Actual behavior
The git information is frozen in time until Package.swift is modified.
Steps to reproduce
First, use the gitInformation to inject a define into a C module:
Then, build with swift build. Only the first build of the first checkout will have valid gitInformation, making the information not-too-helpful 😔
Swift Package Manager version/commit hash
No response
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx15.0
Darwin ---- 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:14 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8103 arm64
The text was updated successfully, but these errors were encountered:
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
When using
Context.gitInformation
to inject the git commit version, incremental builds will not be updated appropriately. Additionally,swift package dump-package
will continue to dump a cached version of the git information, and resetting the build state using tools likeswift package clean
has no effect. Only modifications to Package.swift seem to have an effect, though such modifications change the git information by their very nature, so cannot be relied upon. Changing the file back to a previous state, even with an updated modification date results in a previously cached value being used.Expected behavior
Every build will check the git state so the correct define is written to.
Actual behavior
The git information is frozen in time until Package.swift is modified.
Steps to reproduce
First, use the gitInformation to inject a define into a C module:
Then, build with
swift build
. Only the first build of the first checkout will have valid gitInformation, making the information not-too-helpful 😔Swift Package Manager version/commit hash
No response
Swift & OS version (output of
swift --version ; uname -a
)The text was updated successfully, but these errors were encountered: