diff options
-rw-r--r-- | tvix/build/build.rs | 2 | ||||
-rw-r--r-- | tvix/build/protos/default.nix | 21 | ||||
-rw-r--r-- | tvix/castore/build.rs | 2 | ||||
-rw-r--r-- | tvix/castore/protos/default.nix | 18 | ||||
-rw-r--r-- | tvix/store/build.rs | 2 | ||||
-rw-r--r-- | tvix/store/protos/default.nix | 21 |
6 files changed, 25 insertions, 41 deletions
diff --git a/tvix/build/build.rs b/tvix/build/build.rs index 09604c3e3b71..fe230cbeca8a 100644 --- a/tvix/build/build.rs +++ b/tvix/build/build.rs @@ -25,7 +25,7 @@ fn main() -> Result<()> { ], // If we are in running `cargo build` manually, using `../..` works fine, // but in case we run inside a nix build, we need to instead point PROTO_ROOT - // to a sparseTree containing that structure. + // to a custom tree containing that structure. &[match std::env::var_os("PROTO_ROOT") { Some(proto_root) => proto_root.to_str().unwrap().to_owned(), None => "../..".to_string(), diff --git a/tvix/build/protos/default.nix b/tvix/build/protos/default.nix index 790655ac7522..287b513136c9 100644 --- a/tvix/build/protos/default.nix +++ b/tvix/build/protos/default.nix @@ -1,17 +1,12 @@ -{ depot, pkgs, ... }: +{ depot, pkgs, lib, ... }: let - protos = depot.nix.sparseTree { - name = "build-protos"; - root = depot.path.origSrc; - paths = [ - # We need to include castore.proto (only), as it's referred. - ../../castore/protos/castore.proto - ./build.proto - ./rpc_build.proto - ../../../buf.yaml - ../../../buf.gen.yaml - ]; - }; + protos = lib.sourceByRegex depot.path.origSrc [ + "buf.yaml" + "buf.gen.yaml" + # We need to include castore.proto (only), as it's referred. + "^tvix(/castore(/protos(/castore\.proto)?)?)?$" + "^tvix(/build(/protos(/.*\.proto)?)?)?$" + ]; in depot.nix.readTree.drvTargets { inherit protos; diff --git a/tvix/castore/build.rs b/tvix/castore/build.rs index 98e2ab348528..a4591c845509 100644 --- a/tvix/castore/build.rs +++ b/tvix/castore/build.rs @@ -26,7 +26,7 @@ fn main() -> Result<()> { ], // If we are in running `cargo build` manually, using `../..` works fine, // but in case we run inside a nix build, we need to instead point PROTO_ROOT - // to a sparseTree containing that structure. + // to a custom tree containing that structure. &[match std::env::var_os("PROTO_ROOT") { Some(proto_root) => proto_root.to_str().unwrap().to_owned(), None => "../..".to_string(), diff --git a/tvix/castore/protos/default.nix b/tvix/castore/protos/default.nix index feef55690fb9..08bb8fcfeef1 100644 --- a/tvix/castore/protos/default.nix +++ b/tvix/castore/protos/default.nix @@ -1,16 +1,10 @@ -{ depot, pkgs, ... }: +{ depot, pkgs, lib, ... }: let - protos = depot.nix.sparseTree { - name = "castore-protos"; - root = depot.path.origSrc; - paths = [ - ./castore.proto - ./rpc_blobstore.proto - ./rpc_directory.proto - ../../../buf.yaml - ../../../buf.gen.yaml - ]; - }; + protos = lib.sourceByRegex depot.path.origSrc [ + "buf.yaml" + "buf.gen.yaml" + "^tvix(/castore(/protos(/.*\.proto)?)?)?$" + ]; in depot.nix.readTree.drvTargets { inherit protos; diff --git a/tvix/store/build.rs b/tvix/store/build.rs index 8a92ab26fd64..4e0371311220 100644 --- a/tvix/store/build.rs +++ b/tvix/store/build.rs @@ -25,7 +25,7 @@ fn main() -> Result<()> { ], // If we are in running `cargo build` manually, using `../..` works fine, // but in case we run inside a nix build, we need to instead point PROTO_ROOT - // to a sparseTree containing that structure. + // to a custom tree containing that structure. &[match std::env::var_os("PROTO_ROOT") { Some(proto_root) => proto_root.to_str().unwrap().to_owned(), None => "../..".to_string(), diff --git a/tvix/store/protos/default.nix b/tvix/store/protos/default.nix index 56345d9338b2..005a2697e5e9 100644 --- a/tvix/store/protos/default.nix +++ b/tvix/store/protos/default.nix @@ -1,17 +1,12 @@ -{ depot, pkgs, ... }: +{ depot, pkgs, lib, ... }: let - protos = depot.nix.sparseTree { - name = "store-protos"; - root = depot.path.origSrc; - paths = [ - # We need to include castore.proto (only), as it's referred. - ../../castore/protos/castore.proto - ./pathinfo.proto - ./rpc_pathinfo.proto - ../../../buf.yaml - ../../../buf.gen.yaml - ]; - }; + protos = lib.sourceByRegex depot.path.origSrc [ + "buf.yaml" + "buf.gen.yaml" + # We need to include castore.proto (only), as it's referred. + "^tvix(/castore(/protos(/castore\.proto)?)?)?$" + "^tvix(/store(/protos(/.*\.proto)?)?)?$" + ]; in depot.nix.readTree.drvTargets { inherit protos; |