Skip to content

scrypto build of workspace fails #1612

@cjdsellers

Description

@cjdsellers

Hi all,

We have a large multi-crate scrypto project with a top level Cargo.toml manifest defining a workspace. Running scrypto build from the top level fails with the following output (redacted):

Error: BuildError(InvalidManifestFile("<..redacted..>Cargo.toml"))

There is no additional stack trace even when running with RUST_BACKTRACE=1 or with the --trace option.

Running cargo check finishes successfully which means all Rust syntax is correct, and the workspace is defined correctly.

Also running cargo build --target wasm32-unknown-unknown --release --target-dir target --manifest-path Cargo.toml succeeds, which afaik is what scrypto build is essentially running.

The slightly redacted workspace manifest looks like this:

[workspace]
resolver = "2"
members = [
   ... a bunch of crates
]

[workspace.package]
rust-version = "1.73.0"
version = "0.1.0"
edition = "2021"

[workspace.dependencies]
sbor = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.0.0" }
scrypto = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.0.0" }

# dev-dependencies
transaction = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.0.0" }
radix-engine = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.0.0" }
scrypto-unit = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.0.0" }
radix-engine-stores = { git = "https://github.com/radixdlt/radixdlt-scrypto", tag = "v1.0.0" }
rand = "0.8.5"

[profile.release]
opt-level = 's'        # Optimize for size.
lto = true             # Enable Link Time Optimization.
codegen-units = 1      # Reduce number of codegen units to increase optimizations.
panic = 'abort'        # Abort on panic.
strip = "debuginfo"    # Strip debug info.
overflow-checks = true # Panic in the case of an overflow.

Are we doing anything obviously wrong? or is this a known issue currently, with a workaround?

It would be great to be able to run scrypto/cargo commands from the top level of the source, as this will make setting up CI/CD much easier, also more efficient just compiling the subdependency crates once with a single Cargo.lock and target dir.

Thank you for all the hard work which went into getting scrypto to v1!

Looking forward to your response.

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