Skip to content

Remove source_hash.txtes from git#3460

Merged
jleibs merged 14 commits intomainfrom
jleibs/untracked_source_hash.txt
Sep 25, 2023
Merged

Remove source_hash.txtes from git#3460
jleibs merged 14 commits intomainfrom
jleibs/untracked_source_hash.txt

Conversation

@jleibs
Copy link
Copy Markdown
Contributor

@jleibs jleibs commented Sep 25, 2023

What

Main changes:

  • Removes the source_hash.txt from git and adds it to gitignore.
  • Doesn't run the codegen during build.rs unless source_hash.txt is present
  • Makes cargo codegen produce the source_hash.txt
  • Removes the printlns from the source_hash generation when run as part of cargo codegen.
  • Adds the formatting dependencies to the docker image
  • Adds a new CI check that codegen produces no diffs.

Confirmed that we catch it when codegen would produce changes: https://github.com/rerun-io/rerun/actions/runs/6302436017/job/17109617144?pr=3461

Checklist

@jleibs jleibs marked this pull request as ready for review September 25, 2023 16:00
@jleibs jleibs added 🧑‍💻 dev experience developer experience (excluding CI) exclude from changelog PRs with this won't show up in CHANGELOG.md labels Sep 25, 2023
println!("cargo:rustc-env={name}={value}");
if should_output_cargo_build_instructions() {
println!("cargo:rustc-env={name}={value}");
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when is set_env used? maybe this should fallback to std::env::set ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's used by re_build_tools::export_env_vars().

I think having it fall back is potentially more confusing since it many situations I don't think std::env::set will actually do what the user wants?

Copy link
Copy Markdown
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Amazing 👏

@jleibs jleibs merged commit 874fb65 into main Sep 25, 2023
@jleibs jleibs deleted the jleibs/untracked_source_hash.txt branch September 25, 2023 18:29
teh-cmc added a commit that referenced this pull request Sep 26, 2023
teh-cmc added a commit that referenced this pull request Sep 26, 2023
#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/)
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) exclude from changelog PRs with this won't show up in CHANGELOG.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove source_hash.txtes from git

2 participants