Skip to content

Commit

Permalink
Bump env crate dep and use separate rev for macro XDR dep
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Jun 27, 2022
1 parent 560f9df commit 04f390e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 11 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,26 @@ edition = "2021"
proc-macro = true

[dependencies]
stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "0b8fe26", features = ["next", "std"] }

# NB: For the time being (until we find a better solution, or abandon `no-std`
# in the guest) we need to specify the stellar-xdr dependency for the the env
# crate (pulled in transitively from the SDK crate) and the macros (this crate)
# with _different versions_ of the stellar-xdr crate.
#
# To repeat (this is weird): ensure the rev="..." specified in this file is a
# _different_ rev than the one specified in
# https://github.com/stellar/rs-stellar-contract-env/blob/main/stellar-contract-env-common/Cargo.toml
#
# This is because the macros activate the `std` feature (as visible here) and
# the guest crate when compiled to wasm requires _not_ activating the `std`
# feature, to include a custom panic handler.
#
# If cargo resolves both dependencies to a single version of stellar-xdr, it
# will enable the `std` feature in that "shared" version. If on the other hand
# (as a total hack) we depend on two _different_ versions of stellar-xdr, we can
# configure them with separate features. Which is what we're doing (for now).

stellar-xdr = { git = "https://github.com/stellar/rs-stellar-xdr", rev = "277d41c", features = ["next", "std"] }
syn = {version="1.0",features=["full"]}
quote = "1.0"
proc-macro2 = "1.0"
Expand Down
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
targets = ["wasm32-unknown-unknown"]
components = ["rustc", "cargo", "rustfmt", "clippy", "rust-src"]
6 changes: 3 additions & 3 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ crate-type = ["cdylib", "rlib"]
stellar-contract-macros = { path = "../macros" }

[target.'cfg(target_family="wasm")'.dependencies]
stellar-contract-env-panic-handler-wasm32-unreachable = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "42fc83ac" }
stellar-contract-env-guest = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "42fc83ac" }
stellar-contract-env-panic-handler-wasm32-unreachable = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "0d6ace7" }
stellar-contract-env-guest = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "0d6ace7" }
# stellar-contract-env-guest = { path = "../../rs-stellar-contract-env/stellar-contract-env-guest" }

[target.'cfg(not(target_family="wasm"))'.dependencies]
stellar-contract-env-host = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "42fc83ac" }
stellar-contract-env-host = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "0d6ace7" }
# stellar-contract-env-host = { path = "../../rs-stellar-contract-env/stellar-contract-env-host" }

[dev-dependencies]
Expand Down

0 comments on commit 04f390e

Please sign in to comment.