-
Notifications
You must be signed in to change notification settings - Fork 334
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
Fix unnecessary rebuilds by updating to maturin 1.3.1 #3266
Comments
I isolated one pattern with deterministic & unnecessary rebuilds
Looking at it with
which seems to imply an issue with our current egui patches |
We have a lot of fn main() {
re_build_tools::rebuild_if_crate_changed("re_data_source");
re_build_tools::export_env_vars();
} I am afraid this is brittle, and causes too many re-builds. We have this code in order to get correct and up-to-date build info. I wonder if we really need this though. Sure we want good build info for build from CI, but who really cares about the commit hash when you are building locally? I added it originally for when working on the web-viewer, since it wasn't always obvious if the web-viewer that e.g. a notebook was serving was the latest built one (either due to bugs in the |
Running |
It's the same underlying problem as the roundtrip test suite execution time regression: |
#3460 removed committed hashes, but `re_types_builder` is still subscribed to changes to `source_hash.txt`. Even though the build script will early exit as soon as it realizes that the hash is `None`, this is enough to invalidate `rustc`'s cache, which then invalidates every crate downstream. `main`: ![image](https://github.com/rerun-io/rerun/assets/2910679/80ff901e-926e-4695-a305-c88a483a9c0f) this branch: ![image](https://github.com/rerun-io/rerun/assets/2910679/acaec63e-660c-43ee-8d9e-4e0ecaea06b9) Fixes: - The roundtrip test suite execution time regression - #3266 ### What ### 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 [demo.rerun.io](https://demo.rerun.io/pr/3474) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3474) - [Docs preview](https://rerun.io/preview/ea449009416498c258c9672706dc3ebc362f16e2/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/ea449009416498c258c9672706dc3ebc362f16e2/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
This issue was opened before the PR that caused the bug fixed by #3474. There are more improvements to be had. |
cargo check
is doing double-workbuild.rs
magic
Right now I'm leaning towards something like this:
This means you'd most often need to run |
### What * Part of #3266 This cleans up all our `build.rs` files by introducing better helpers in `re_build_tools`. No functionality is actually changed (except a few tiny improvements). This will make it easier to take take the next steps of opting-in to most of these features. This is just the first step. ### 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 [demo.rerun.io](https://demo.rerun.io/pr/3789) (if applicable) * [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/3789) - [Docs preview](https://rerun.io/preview/e2cd48dcc1b549b9523fb92423e0da7521522afc/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/e2cd48dcc1b549b9523fb92423e0da7521522afc/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
* Part of #3266 ### What #### `rust-analyzer` will no longer run codegen …if you configure `rust-analyzer` to use `--all-features`, which you should, and which we do in `.vscode/settings.json` Same is true for stuff like `bacon` too. #### No build-time and git branch/commit for local developers I've removed the build-time and git branch/commit from: * `rerun --version` * Viewer Rerun Menu -> About * analytics for local developers (that means you), who has cloned our repository. This is to save us from annoying re-builds using complex detection code. #### No build-time and git branch/commit for crate users Users of our crates (i.e. users who put `rerun` in their `Cargo.toml` or build `rerun` using `cargo install rerun`) will also no longer see the build-time and git branch/commit in these places. Previously we would try to get the git branch/commit hash for whatever folder they happened to be in (😬 ), which was not a great idea. So that's a bug fix. The build time is a bit sadder to let go, but it was always unreliable: if you ran `cargo update` for instance, the build time would not update even if the rerun crate was being rebuilt. So instead of showing an unreliable built-time, I think it is better to just remove it. ### 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 [demo.rerun.io](https://demo.rerun.io/pr/3814) (if applicable) * [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/3814) - [Docs preview](https://rerun.io/preview/b6822d26484951599b89cd0c06b607cb88d2c4ec/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/b6822d26484951599b89cd0c06b607cb88d2c4ec/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
The problem that Andreas reported still remain on
This made me wonder if the feature flags are changing somehow. |
EDIT: Yes indeed! By always setting the environment variable The problem is now: how do we make sure We can of course tell our developers to just set Or we patch Maturin in a way to make it not set I've opened a Maturin ticket to start a discussion about this: PyO3/maturin#1804 |
Unblocked thanks to PyO3/maturin#1804 |
### What This should fix the recompilation issue related to the `MACOSX_DEPLOYMENT_TARGET` env var. * Fixes #3266 ### 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/5197/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5197/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/5197/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 * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5197) - [Docs preview](https://rerun.io/preview/09679948de831e3bc7ec53cd3bd9298f8731d16e/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/09679948de831e3bc7ec53cd3bd9298f8731d16e/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
Often when I run
cargo check
, it rebuilds dependencies deep down the dependency chain, e.g.egui
. Why? This is slowing me down a lot.The text was updated successfully, but these errors were encountered: