#unresolved imports `stellar_xdr::DepthLimitedRead`, `stellar_xdr::ReadXdr`, `stellar_xdr::ScSpecEntr

20 messages · Page 1 of 1 (latest)

pallid root
#

This morning I get this error while trying to set up a new project.

unresolved imports `stellar_xdr::DepthLimitedRead`, `stellar_xdr::ReadXdr`, `stellar_xdr::ScSpecEntry`

The only thing I can see from yesterday is that stellar-xdr got a new version and this version is used in soroban-spec.

Compilation errors:

error[E0432]: unresolved imports `stellar_xdr::DepthLimitedRead`, `stellar_xdr::ReadXdr`, `stellar_xdr::ScSpecEntry`
 --> /home/vincent/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-spec-20.0.0-rc2/src/read.rs:3:25
  |
3 | use stellar_xdr::{self, DepthLimitedRead, ReadXdr, ScSpecEntry};
  |                         ^^^^^^^^^^^^^^^^  ^^^^^^^  ^^^^^^^^^^^ no `ScSpecEntry` in the root
  |                         |                 |
  |                         |                 no `ReadXdr` in the root
  |                         no `DepthLimitedRead` in the root
  |
  = help: consider importing one of these items instead:
          crate::read::stellar_xdr::curr::ReadXdr
          stellar_xdr::curr::ReadXdr
  = help: consider importing one of these items instead:
          crate::read::stellar_xdr::curr::ScSpecEntry
          crate::read::stellar_xdr::curr::Type::ScSpecEntry
          crate::read::stellar_xdr::curr::TypeVariant::ScSpecEntry
          stellar_xdr::curr::ScSpecEntry
          stellar_xdr::curr::Type::ScSpecEntry
          stellar_xdr::curr::TypeVariant::ScSpecEntry

#

@plain terrace any idea why this is failing?

opal flame
#

try adding the next flag or using stellar_xdr::next::ReadXdr

#

though idk tbh, I'm still using rc1 which builds correctly and it's compatible

pallid root
#

Actually my already compiled project are working fine, the problem happen on a new one, I think even on rc1 the problem happens when compiling the deps. I will try again but it looks like wrong the dep tree is wrong.

pallid root
fallen holly
#

Yeah I also noticed this today, one way to "fix it" is copy/pasting the cargo lock from a functioning project... Not the best but it's enough for unlock development

pallid root
#

I copied a fully working project 😁and changed the src...

plain terrace
pallid root
#

The only dep is soroban-sdk

plain terrace
#

Oh

#

I know what's happening.

pallid root
#

The GitHub link has a repducible project even on rc1

plain terrace
#

Cargo is incorrectly treating the pre release and stable release as compatible, even though under semver rules they aren't.

#

I can fix this by pushing a release of soroban-sdk that pins to the pre release.

pallid root
#

it feels strange to see that even when you change the version of soroban-sdk you have the latest version coming from deps of deps. Maybe this is usual with rust/cargo.

plain terrace
#

Cargo doesn't support pre-releases very well and has some odd behavior around them, like this. During the prerelease phase of the project we should have been using pinned dependencies to prevent cargo from auto selecting stable verisons when they release. Fixing this behavior in cargo has been discussed for a while: https://github.com/rust-lang/rfcs/pull/3263

GitHub

Rendered
Internals thread
I think there is two major solution either:

Cargo will not use the more compatible version for pre-release by default, this mean that 1.0.0-alpha.0 will be interpreted as...

#

Got a fix coming.

plain terrace
bronze forge
#

I ran command soroban contract build from cli and faced the same error.
I'll try update soroban-sdk, thanks