Problem with swift package manager caching and binary package

I've setup my Xcode project to use a binary package, for which the manifest is stored in the private git repository. The dependency tracking is set to branch -- it just fetches the manifest from master branch of the repository.

It seems, that after initial fetching Xcode or spm caches the commit hash used to fetch the manifest. If I push an update of Package.swift (i.e. containing updated artifact checksum) this change is not refreshed in the project (i.e. after resetting package cache it complains about the checksum mismatch between the actual binary artifact and the manifest). At the same time if I manually clone the repository I see valid checksum in the manifest.

I've tried to use all 3 options in Xcode (i.e. reset package cache, resolve package versions, update to newest version). None of them solves the problem. It seems that to reset the cache I need to remove the package from the project and add it again.

I'm looking for an elegant way to refresh the manifest through command line. Currently the only idea I have is to clone the manifest repository manually and overwrite Package.swift in SourcePackages within the projects derived data.

A bit of improvement to the workaround that also seems to work (but is nasty):

cd ~/Library/Developer/Xcode/DerivedData/myproject/SourcePackages/checkouts/mypackage
chmod -R u+w .
git pull origin master
Problem with swift package manager caching and binary package
 
 
Q