Skip to content

Failure to build 1.4.1 on existing projects that were using 1.3.2 #208

@leighmcculloch

Description

@leighmcculloch

Similar to #203, it seems like the 1.4.1 releases are still making assumptions about items in the current space that weren't prior, which is a breaking change, and fails to build on projects who were dependent on 1.3.2.

Cargo.toml:

[package]
name = "pkg"
edition = "2021"

[dependencies]
soroban-sdk = { version = "=21.7.6" }

[dev-dependencies]
soroban-sdk = { version = "=21.7.6", features = ["testutils"] }

src/lib.rs:

#![no_std]

use soroban_sdk::contracttype;

#[contracttype]
#[derive(Clone, Debug, PartialEq)]
pub struct Struct {
    pub index: u64,
}

Run cargo test with 1.4.1:

$ cargo update artbirary --precise 1.4.1
$ cargo update derive_artbirary --precise 1.4.1
$ cargo test

Included in the output are the following build errors:

error[E0433]: failed to resolve: could not find `std` in the list of imported crates
 --> src/lib.rs:5:1
  |
5 | #[contracttype]
  | ^^^^^^^^^^^^^^^ could not find `std` in the list of imported crates
  |
  = note: this error originates in the derive macro `soroban_sdk::testutils::arbitrary::arbitrary::Arbitrary` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `RECURSIVE_COUNT_ArbitraryStruct` in this scope
 --> src/lib.rs:5:1
  |
5 | #[contracttype]
  | ^^^^^^^^^^^^^^^ not found in this scope
  |
  = note: this error originates in the derive macro `soroban_sdk::testutils::arbitrary::arbitrary::Arbitrary` (in Nightly builds, run with -Z macro-backtrace for more info)

Re-run cargo test with 1.3.2 and it compiles:

$ cargo update artbirary --precise 1.3.2
$ cargo update derive_artbirary --precise 1.3.2
$ cargo test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions