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

Reduce the number of crate binaries in the cargo workspace #4623

Open
emilk opened this issue Dec 26, 2023 · 0 comments
Open

Reduce the number of crate binaries in the cargo workspace #4623

emilk opened this issue Dec 26, 2023 · 0 comments
Labels
🧑‍💻 dev experience developer experience (excluding CI)

Comments

@emilk
Copy link
Member

emilk commented Dec 26, 2023

cargo check etc currently checks all our binaries, which is a lot, because it includes all examples, all doc-tests, and all roundtrip tests. This also makes rust-analyzer slower because of this issue:

$ cargo run --bin 2>&1 | wc -l
99 55


One solution would be to split off examples and tests to its own workspace.

They should ideally be under its own folder then, but I'm not sure what that should be called.
Or we use many separate workspaces (one for docs, one for examples, one for tests, etc).
Either way we need to make sure all the workspaces are checked on CI (cargo fmt, cargo cranky, …),
which is annoying, because it may require duplicating Cranky.toml, clippy.toml, etc.


Another approach is to combine all existing binaries into one:

@emilk emilk added the 🧑‍💻 dev experience developer experience (excluding CI) label Dec 26, 2023
@emilk emilk changed the title Split off tests and examples to a separate Cargo workspace Reduce the number of crate binaries in the cargo workspace Jan 10, 2024
@emilk emilk self-assigned this Jan 10, 2024
emilk added a commit that referenced this issue Jan 10, 2024
### What
* Part of #4623
* Sibling PR: rerun-io/landing#611

This reduces the number of binaries in our workspace from 99 to 55.

We do this by joining all `docs/code-examples` into one binary, with a
little help from some `build.rs` codegen.
This will any compiler error messages to the wrong file though, so it is
not a perfect solution by any means.

I also decided to put all the code examples in their own folder
(`docs/code-examples/all`), with the control structures (`Cargo.toml`,
`CMakeLists`, …) in the parent folder (`docs/code-examples`). If you
have a better idea for a name than "all" I'm all ears.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4767/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4767/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4767/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4767)
- [Docs
preview](https://rerun.io/preview/84e36319d1a5ff181c1b436bc6e75e7be42bc05d/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/84e36319d1a5ff181c1b436bc6e75e7be42bc05d/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---------

Co-authored-by: Andreas Reich <andreas@rerun.io>
@emilk emilk removed their assignment Jan 10, 2024
@nikolausWest nikolausWest added this to the Triage milestone Jan 30, 2024
@emilk emilk modified the milestones: Triage, Spring Cleaning Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 dev experience developer experience (excluding CI)
Projects
None yet
Development

No branches or pull requests

2 participants