#Error when installing soroban-cli 0.3.3

13 messages · Page 1 of 1 (latest)

ancient zinc
#

This seems to be the crux: perhaps two different versions of crate stellar_xdr are being used?

error[E0308]: `if` and `else` have incompatible types
   --> /Users/weller/.cargo/registry/src/github.com-1ecc6299db9ec823/soroban-cli-0.3.3/src/invoke.rs:295:13
    |
287 |           let spec_entries = if let Some(f) = &self.wasm {
    |  ____________________________-
288 | |             // Get the contract from a file
289 | |             let wasm = fs::read(f).map_err(|e| Error::CannotReadContractFile {
290 | |                 filepath: f.clone(),
...   |
293 | |             soroban_spec::read::from_wasm(&wasm).map_err(Error::CannotParseContractSpec)?
    | |             ----------------------------------------------------------------------------- expected because of this
294 | |         } else {
295 | |             get_remote_contract_spec_entries(&client, &contract_id).await?
    | |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `stellar_xdr::next::generated::ScSpecEntry`, found enum `soroban_env_host::stellar_xdr::ScSpecEntry`
296 | |         };
    | |_________- `if` and `else` have incompatible types
    |
    = note: expected struct `std::vec::Vec<stellar_xdr::next::generated::ScSpecEntry>`
               found struct `std::vec::Vec<soroban_env_host::stellar_xdr::ScSpecEntry>`
    = note: perhaps two different versions of crate `stellar_xdr` are being used?
onyx current
#

What command did you run?

ancient zinc
#

cargo install soroban-cli

onyx current
#

cargo install --locked soroban-cli

ancient zinc
#

why like this?

onyx current
#

It's safer to always install the locked dependencies, otherwise you are letting people YOLO their code straight onto your computer.

#

However, in this case it is working around a bug in how we have versioned dependencies.

#

All our crates dependent on other crates in our dep graph should be pinned to specific versions, not >= the known version.

#

Ah, we must have upgraded our version of stellar-xdr in soroban-sdk in a patch release. Ok. That's a learning, we shouldn't do that because of how cargo will resolve them.

rich otter
#

oh interesting is this the reason my rpc won't work

#

i use local versions of everything and i just pull down changes from the repos

#

i'll have to look.

onyx current
#

The way to fix this for the moment is to release soroban-cli again, using the new version of the SDK.