Skip to content

Commit 7fc10da

Browse files
committed
Cargo.toml: Use local solan-{sdk,program,zk-token-sdk}
1 parent 67212c5 commit 7fc10da

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

Cargo.lock

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,30 @@ exclude = [
9696

9797
# This prevents a Travis CI error when building for Windows.
9898
resolver = "2"
99+
100+
[patch.crates-io]
101+
# We include a number of crates as our dependencies above from crates.io:
102+
#
103+
# * spl-associated-token-account
104+
# * spl-instruction-padding
105+
# * spl-memo
106+
# * spl-pod
107+
# * spl-token
108+
# * spl-token-2022
109+
# * spl-token-metadata-interface
110+
#
111+
# They, in turn, depend on a number of crates that we also include directly
112+
# using `path` specifications. For example, `spl-token` depends on
113+
# `solana-program`.
114+
#
115+
# Unfortunately, Cargo will try to resolve the `spl-token` `solana-program`
116+
# dependency only using what is available on crates.io. Taking the latest from
117+
# crates.io is likely to mismatch what we have locally, creating a dependency
118+
# reposition error. We end up with two versions of `solana-program` and
119+
# `solana-zk-token-sdk` and all of their dependencies in our build tree.
120+
#
121+
# There is a similar override in `programs/bpf/Cargo.toml`. Please keep both in
122+
# sync.
123+
solana-sdk = { path = "sdk" }
124+
solana-program = { path = "sdk/program" }
125+
solana-zk-token-sdk = { path = "zk-token-sdk" }

programs/bpf/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,10 @@ members = [
9999

100100
[package.metadata.docs.rs]
101101
targets = ["x86_64-unknown-linux-gnu"]
102+
103+
[patch.crates-io]
104+
# See root level `Cargo.toml` for an explanation of this patch. Keep them in
105+
# sync.
106+
solana-sdk = { path = "../../sdk" }
107+
solana-program = { path = "../../sdk/program" }
108+
solana-zk-token-sdk = { path = "../../zk-token-sdk" }

0 commit comments

Comments
 (0)