Our team uses the Package Manager extensively for an iOS project. We have added several local Swift Packages via Xcode that define binary targets accessible only via a VPN. When package resolution occurs while not connected to the VPN, the state of the package gets into a bad state as can be observed by inspecting
SourcePackages/artifacts. The artifacts are being placed in directories unrelated to the binary. Its like "randomly" selecting another local package to store the artifact. Reconnecting to the VPN doesn't resolve the issue. It often requires us to clear the package cache and derived data. This issue has become very disruptive to our daily workflows so we are really looking for a some type of fix or workaround.
I'll provide more details as I get I learn more but first wanted to see how I can seriously debug this. Through now, we can only reproduce this issue with an Xcode workspace, with local packages dragged into that workspace. I downloaded the swift-package-manager hoping I can somehow catch this issue in the debugger and step through the code. But is this actually possible to trigger the same resolution process that Xcode triggers for local packages in an Xcode workspace? How does Xcode manage these workspace packages and call into the swift package? As a reminder, with the local Swift packages in a workspace, these are not part of a Package.swift file but rather has is being managed on the Xcode side.