about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-15T20·58+0200
committerclbot <clbot@tvl.fyi>2024-03-16T09·34+0000
commitfdf96576545dec3fca5d52c159b7f96645d88c14 (patch)
tree542f89041f7ce576152e0da706b65fa8595b6b2e
parent56dc4f735b58e38598a520451d4c95979745b9ad (diff)
fix(tvix): don't emit rerun-if-changed r/7701
`build.rs` emits rerun-if-changed statements for all proto files, as
well as all include paths we pass it.

Unfortunately, due to protobufs include path rules, we need to specify
the path to the depot root itself as an include path, at least when
building impurely with `cargo`. This causes cargo to essentially always
rebuild, as it also puts its own temporary files in there.

Unfortunately, tonic-build does not chase down to individual .proto
files that are included.

Disable emitting these `rerun-if-changed` statements for now.

This could cause cargo to not rebuild protos every time, causing stale
data until the next local `cargo clean`, but considering the protos
change not that frequently, and it'll immediately surface if trying to
build via Nix (either locally or in CI), it's a good-enough compromise.

Change-Id: Ifd279a2216222ef3fc0e70c5a2fe6f87997f562e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11157
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
-rw-r--r--tvix/build/build.rs4
-rw-r--r--tvix/castore/build.rs4
-rw-r--r--tvix/store/build.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/tvix/build/build.rs b/tvix/build/build.rs
index d75ebf7143..c3518ea877 100644
--- a/tvix/build/build.rs
+++ b/tvix/build/build.rs
@@ -20,6 +20,7 @@ fn main() -> Result<()> {
     builder
         .build_server(true)
         .build_client(true)
+        .emit_rerun_if_changed(false)
         .compile_with_config(
             config,
             &[
@@ -33,6 +34,5 @@ fn main() -> Result<()> {
                 Some(proto_root) => proto_root.to_str().unwrap().to_owned(),
                 None => "../..".to_string(),
             }],
-        )?;
-    Ok(())
+        )
 }
diff --git a/tvix/castore/build.rs b/tvix/castore/build.rs
index 339ba867dd..6424487b21 100644
--- a/tvix/castore/build.rs
+++ b/tvix/castore/build.rs
@@ -19,6 +19,7 @@ fn main() -> Result<()> {
     builder
         .build_server(true)
         .build_client(true)
+        .emit_rerun_if_changed(false)
         .compile_with_config(
             config,
             &[
@@ -33,6 +34,5 @@ fn main() -> Result<()> {
                 Some(proto_root) => proto_root.to_str().unwrap().to_owned(),
                 None => "../..".to_string(),
             }],
-        )?;
-    Ok(())
+        )
 }
diff --git a/tvix/store/build.rs b/tvix/store/build.rs
index cfeda59698..809fa29578 100644
--- a/tvix/store/build.rs
+++ b/tvix/store/build.rs
@@ -20,6 +20,7 @@ fn main() -> Result<()> {
     builder
         .build_server(true)
         .build_client(true)
+        .emit_rerun_if_changed(false)
         .compile_with_config(
             config,
             &[
@@ -33,6 +34,5 @@ fn main() -> Result<()> {
                 Some(proto_root) => proto_root.to_str().unwrap().to_owned(),
                 None => "../..".to_string(),
             }],
-        )?;
-    Ok(())
+        )
 }