diff options
author | Ilan Joselevich <personal@ilanjoselevich.com> | 2024-08-19T11·42+0300 |
---|---|---|
committer | Ilan Joselevich <personal@ilanjoselevich.com> | 2024-08-19T16·56+0000 |
commit | 73e16c18552d0bd6866fad7e8f87fb74faeca1e4 (patch) | |
tree | fa0270a12730bba3c13b79d63b636eff48aa83b8 /tvix/store | |
parent | bc967c538d61c2dbf7a321c95062a215484fa946 (diff) |
feat(tvix): drop usage of sparseTree in favor of lib.sourceByRegex r/8538
We can avoid depending on things outside //tvix by just using a similar util from nixpkgs. Change-Id: I9ea3e1f0a8a059ea10caaec173569ba9f316aec6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12247 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store')
-rw-r--r-- | tvix/store/build.rs | 2 | ||||
-rw-r--r-- | tvix/store/protos/default.nix | 21 |
2 files changed, 9 insertions, 14 deletions
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; |