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

Exclude slow to build crates which are unlikely to break frequently from the workspace default-members #3329

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

thomcc
Copy link
Contributor

@thomcc thomcc commented Jul 7, 2020

That is, if you do a cargo test from the root, this makes it so only some crates build. cargo test --all, cargo test -p thing, and cargo test from somewhere other than workspace root all do the same as old behavior.

This is conservative and only changes:

  • nss's systest which is very slow to build and low risk to break when you don't know you're messing with it

  • the megazords, which are essentially covered by the ffi, since they basically just reexport it.

With this change cargo build is about 2x faster, e.g. 71s instead of 150s, although it fluxuates a lot.

Downside: There's a bunch of duplication. The root cause of it is rust-lang/cargo#8460, or we could do something like:

[workspace]
members = [
    "components/*",
    "components/*/ffi",
    "components/support/*",
    "components/support/rc_crypto/nss/systest",
    "megazords/full",
    "megazords/ios/rust",
    "megazords/lockbox",
    "testing/sync-test",
    "tools/protobuf-gen",
]
default-members = [
    "components/*",
    "components/*/ffi",
    "components/support/*",
    "megazords/full",
    "megazords/ios/rust",
    "megazords/lockbox",
    "testing/sync-test",
    "tools/protobuf-gen",
]
# The globs above hit a few folders which aren't crates,
# so exclude them directly
exclude = [
    "components/support",
    "components/support/android",
]

However, if it looks like that cargo issue will ever get fixed, we move some projects into different folders so that globbing the rust crates would be possible.

@thomcc thomcc added the discuss label Jul 7, 2020
Copy link
Contributor

@rfk rfk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, thanks!

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@thomcc thomcc merged commit ec76cf1 into main Jul 20, 2020
@thomcc thomcc deleted the faster branch July 20, 2020 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants