swift-package-manager: Couldn’t check out revision: reference is not a tree
Description
Always when we update an own created Swift package that is hosted in our companies git we get the following error in our project cli. After clear the spm cach located at ‘~/builds/cache/spm’ it works
[14:17:18]: ▸ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -resolvePackageDependencies -workspace myworkspace.xcworkspace -scheme myscheme -derivedDataPath ./derivedData -clonedSourcePackagesDirPath "~/builds/cache/spm"
[14:17:18]: ▸ User defaults from command line:
[14:17:18]: ▸ IDEClonedSourcePackagesDirPathOverride = /Users/gitlab-runner/builds/cache/spm
[14:17:18]: ▸ IDEDerivedDataPathOverride = /Users/gitlab-runner/builds/myapp/derivedData
[14:17:18]: ▸ IDEPackageSupportUseBuiltinSCM = YES
[14:17:45]: ▸ xcodebuild: error: Could not resolve package dependencies:
[14:17:45]: ▸ Couldn’t check out revision ‘906c204b2a6f517ccb13ed0c751d3e26013015d0’:
[14:17:45]: ▸ fatal: reference is not a tree: 906c204b2a6f517ccb13ed0c751d3e26013015d0
Expected behavior
Check out the new version of our swift package should be possible without clearing the spm cache
Actual behavior
Error in the pipeline while checkout swift package
[14:17:45]: ▸ xcodebuild: error: Could not resolve package dependencies:
[14:17:45]: ▸ Couldn’t check out revision ‘906c204b2a6f517ccb13ed0c751d3e26013015d0’:
[14:17:45]: ▸ fatal: reference is not a tree: 906c204b2a6f517ccb13ed0c751d3e26013015d0
Steps to reproduce
No response
Swift Package Manager version/commit hash
No response
Swift & OS version (output of swift --version && uname -a)
Xcode 14.0 Build version 14A309
swift-driver version: 1.62.8 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) Target: arm64-apple-macosx12.0 Darwin static.xx.xx.xx.xx.clients.your-server.de 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 6
- Comments: 15 (6 by maintainers)
Also seeing this under CI builds, sometimes when
swift-niogets a new release, the local.buildcache is not updated properly and get a failure whenswift package updateis executed with an error like:The mentioned commit is 2.49 release tag.
Project would have an indirect dependency to something like:
Happens on latest pre-release and 5.7.2:
Cleaning the
.builddirectory solves this.