I'm making changes in repo1 that has two dependencies in which I need to make a code change:
[workspace.dependencies]
solana-signature = { version = "2.2.1", default-features = false }
solana-vote-interface = "2.2.3"
My question is how to handle the fact that both dependencies come from the same repo (repo2 according to crates.io) but different tags within that repo. Solana-signature is built from tag 2.2.1 and solana-vote-interface is built from tag 2.2.3.
I approached this by:
Forking repo2
Adding repo2 as a submodule to repo1:
[submodule "solana_sdk"]
path = solana_sdk
url = github.com/my_git_user_name/solana_sdk.git
Make updates to repo2 (corresponding to the files in the "signature" and "vote-interface" folders, which exist in the solana-signature and solana-vote-interface crates I mentioned above).
Update patch.crates since other dependencies (not shown above) that I have not changed depend on the ones I changed (like solana-signature):
[patch.crates-io]
solana-signature = { path = "solana_sdk/signature" }
This builds correctly with no errors.
My questions are:
- Since crates solana-signature and solana-vote-interface are built from repo2 but different tags, how do I make sure that I get the right versions into repo1?
- In patch-crates-io, you can see I didn't include a version number. Do I need one here?
solana-vote-interface = "^2.2.3". I think this is because there are separate tags for each of the dependencies in repo2: Tag "[email protected]" contains the following: 1. A Cargo.toml in the "signature" folder with "version = "2.2.1" 2. A Cargo.toml in the "vote-interface" folder with "version = "2.2.1" #2 doesn't match the vote-interface requirement for 2.2.3.