feat(api): build the contract packages from local checkouts - #646
Merged
Conversation
Trying a proto change meant publishing a version and a tag for it, because FlipcashAPI pins both contract packages exactly. Setting FLIPCASH_PROTO_LOCAL to the directory holding the two client checkouts swaps the pinned dependencies for path dependencies. An environment variable rather than an edit to this file, for two reasons: the switch has to survive worktrees, where a relative path to a sibling checkout does not, and a manifest nobody edits is one nobody can commit in local mode. CI never sets the variable, so release builds resolve the pins. Verified with swift build against local ocp-client-protocol and flipcash2-client-protocol checkouts, including a message added to a proto and brought in with sync-protos.sh --local.
This was referenced Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FlipcashAPI/Package.swiftpins both contract packages with.package(url:, exact:), so trying acontract change meant tagging a release of the client repos first.
The manifest now reads
FLIPCASH_PROTO_LOCAL. When it names a directory holdingocp-client-protocolandflipcash2-client-protocolcheckouts, both dependencies become.package(path:); unset, the manifest resolves the same pinned versions as before. Productreferences and the re-export are untouched, so
import FlipcashAPIbehaves identically either way.Xcode inherits the environment of whatever launched it, so it has to be started from a shell that
exported the variable.
Nothing is edited to enter local mode, so there is nothing to commit by accident. It does drop the
two contract entries from the workspace
Package.resolvedwhile active. That is noise rather than aversion change, since the manifest pins are
exact, but the file should be restored beforecommitting.
Checked with
swift package dump-packagein both states, and withswift buildofFlipcashAPIagainst local client checkouts carrying an uncommitted proto change: the added message reached
Ocp_Common_V1_LocalDevProbein the generated Swift and the build succeeded.Pairs with the client-repo change that lets the contract itself be synced from a local checkout:
code-payments/ocp-client-protocol#3 and code-payments/flipcash2-client-protocol#3.