Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrypto build of workspace fails #1612

Open
cjdsellers opened this issue Oct 8, 2023 · 0 comments
Open

scrypto build of workspace fails #1612

cjdsellers opened this issue Oct 8, 2023 · 0 comments

Comments

@cjdsellers
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant