Skip to content

Commit 874fb65

Browse files
authored
Remove source_hash.txtes from git (#3460)
### What * Resolves: #3334 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 * [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/3460) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3460) - [Docs preview](https://rerun.io/preview/d4eaa3fb30cd2fad8b518bf8829286a3762a64fb/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/d4eaa3fb30cd2fad8b518bf8829286a3762a64fb/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
1 parent 814fb3e commit 874fb65

21 files changed

Lines changed: 193 additions & 69 deletions

.github/workflows/reusable_bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
runs-on: ubuntu-latest-16-cores
5757

5858
container:
59-
image: rerunio/ci_docker:0.9.1
59+
image: rerunio/ci_docker:0.10.0
6060

6161
steps:
6262
- uses: actions/checkout@v4

.github/workflows/reusable_build_and_test_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
runner="ubuntu-latest-16-cores"
7575
target="x86_64-unknown-linux-gnu"
7676
run_tests="true"
77-
container="{'image': 'rerunio/ci_docker:0.9.1'}"
77+
container="{'image': 'rerunio/ci_docker:0.10.0'}"
7878
;;
7979
windows)
8080
runner="windows-latest-8-cores"

.github/workflows/reusable_build_and_upload_rerun_c.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
runner="ubuntu-latest-16-cores"
9595
target="x86_64-unknown-linux-gnu"
9696
run_tests="true"
97-
container="{'image': 'rerunio/ci_docker:0.9.1'}"
97+
container="{'image': 'rerunio/ci_docker:0.10.0'}"
9898
lib_name="librerun_c.a"
9999
;;
100100
windows)

.github/workflows/reusable_build_web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest-16-cores
3939

4040
container:
41-
image: rerunio/ci_docker:0.9.1
41+
image: rerunio/ci_docker:0.10.0
4242

4343
steps:
4444
- uses: actions/checkout@v4

.github/workflows/reusable_build_web_demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest-16-cores
4141

4242
container:
43-
image: rerunio/ci_docker:0.9.1
43+
image: rerunio/ci_docker:0.10.0
4444

4545
steps:
4646
- uses: actions/checkout@v4

.github/workflows/reusable_checks.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,41 @@ jobs:
109109
110110
# ---------------------------------------------------------------------------
111111

112+
no-codegen-changes:
113+
name: Check if running codegen would produce any changes
114+
runs-on: ubuntu-latest-16-cores
115+
container:
116+
image: rerunio/ci_docker:0.10.0
117+
env:
118+
RUSTC_WRAPPER: "sccache"
119+
steps:
120+
# Note: We explicitly don't override `ref` here. We need to see if changes would be made
121+
# in a context where we have merged with main. Otherwise we might miss changes such as one
122+
# PR introduces a new type and another PR changes the codegen.
123+
- uses: actions/checkout@v4
124+
125+
- name: Set up Rust
126+
uses: ./.github/actions/setup-rust
127+
with:
128+
cache_key: "build-linux"
129+
save_cache: true
130+
workload_identity_provider: ${{ secrets.GOOGLE_WORKLOAD_IDENTITY_PROVIDER }}
131+
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
132+
133+
- name: Codegen
134+
uses: actions-rs/cargo@v1
135+
with:
136+
command: codegen
137+
138+
- name: No Diffs From Running Codegen
139+
run: |
140+
git diff --exit-code
141+
112142
rs-lints:
113143
name: Rust lints (fmt, check, cranky, tests, doc)
114144
runs-on: ubuntu-latest-16-cores
115145
container:
116-
image: rerunio/ci_docker:0.9.1
146+
image: rerunio/ci_docker:0.10.0
117147
env:
118148
RUSTC_WRAPPER: "sccache"
119149
steps:
@@ -213,7 +243,7 @@ jobs:
213243
name: Check Rust web build (wasm32 + wasm-bindgen)
214244
runs-on: ubuntu-latest-16-cores
215245
container:
216-
image: rerunio/ci_docker:0.9.1
246+
image: rerunio/ci_docker:0.10.0
217247
env:
218248
RUSTC_WRAPPER: "sccache"
219249
steps:
@@ -325,7 +355,7 @@ jobs:
325355
name: Cargo Deny
326356
runs-on: ubuntu-latest
327357
container:
328-
image: rerunio/ci_docker:0.9.1
358+
image: rerunio/ci_docker:0.10.0
329359
steps:
330360
- uses: actions/checkout@v4
331361
with:
@@ -357,7 +387,7 @@ jobs:
357387
name: C++ tests
358388
runs-on: ubuntu-latest
359389
container:
360-
image: rerunio/ci_docker:0.9.1
390+
image: rerunio/ci_docker:0.10.0
361391
env:
362392
RUSTC_WRAPPER: "sccache"
363393
steps:

.github/workflows/reusable_deploy_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
name: Rust
107107
runs-on: ubuntu-latest-16-cores
108108
container:
109-
image: rerunio/ci_docker:0.9.1
109+
image: rerunio/ci_docker:0.10.0
110110
steps:
111111
- name: Show context
112112
run: |

.github/workflows/reusable_run_notebook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333

3434
container:
35-
image: rerunio/ci_docker:0.9.1
35+
image: rerunio/ci_docker:0.10.0
3636

3737
steps:
3838
- uses: actions/checkout@v4

.github/workflows/reusable_upload_wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131

3232
container:
33-
image: rerunio/ci_docker:0.9.1
33+
image: rerunio/ci_docker:0.10.0
3434

3535
permissions:
3636
contents: "read"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.DS_Store
22

3+
# Codegen stuff:
4+
crates/re_types/source_hash.txt
5+
crates/re_types_builder/source_hash.txt
6+
37
# C++ and CMake stuff:
48
*.bin
59
*.o

0 commit comments

Comments
 (0)