diff options
author | Florian Klink <flokli@flokli.de> | 2023-12-09T13·49+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-11T22·35+0000 |
commit | 1cc3e9c1a83f819a94e1e3b92969cddf13356f2c (patch) | |
tree | 3c36eb8a1f3c9e1a05720c8ef533f76026477f85 /tvix | |
parent | 43943e26230562fcf3a6dc516f2c389f768f20fe (diff) |
refactor(tvix): use granular proto files r/7156
Only pass in the proto files that are actually needed to build that crate. They are already constructed in depot.tvix.$crate.protos.protos. Change-Id: If4381e6c3350e420ee4ddce1e0513bfe970678a2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10240 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/default.nix | 23 | ||||
-rw-r--r-- | tvix/proto/default.nix | 17 |
2 files changed, 17 insertions, 23 deletions
diff --git a/tvix/default.nix b/tvix/default.nix index ac800ce6a1f2..342508c3718f 100644 --- a/tvix/default.nix +++ b/tvix/default.nix @@ -41,12 +41,12 @@ let }; tvix-build = prev: { - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = depot.tvix.build.protos.protos; nativeBuildInputs = protobufDep prev; }; tvix-castore = prev: { - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = depot.tvix.castore.protos.protos; nativeBuildInputs = protobufDep prev; }; @@ -55,7 +55,7 @@ let }; tvix-store = prev: { - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = depot.tvix.store.protos.protos; nativeBuildInputs = protobufDep prev; # fuse-backend-rs uses DiskArbitration framework to handle mount/unmount on Darwin buildInputs = prev.buildInputs or [ ] @@ -101,9 +101,20 @@ let ${depot.tools.depotfmt}/bin/depotfmt Cargo.nix ''; + # Target containing *all* tvix proto files. + # Useful for workspace-wide cargo invocations (doc, clippy) + protos = pkgs.symlinkJoin { + name = "tvix-all-protos"; + paths = [ + depot.tvix.build.protos.protos + depot.tvix.castore.protos.protos + depot.tvix.store.protos.protos + ]; + }; + in { - inherit crates crate2nix-generate; + inherit crates crate2nix-generate protos; # Run crate2nix generate, ensure the output doesn't differ afterwards # (and doesn't fail). @@ -179,7 +190,7 @@ in rust-docs = pkgs.stdenv.mkDerivation { inherit cargoDeps src; name = "tvix-rust-docs"; - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = protos; nativeBuildInputs = with pkgs; [ cargo @@ -204,7 +215,7 @@ in clippy = pkgs.stdenv.mkDerivation { inherit cargoDeps src; name = "tvix-clippy"; - PROTO_ROOT = depot.tvix.proto; + PROTO_ROOT = protos; buildInputs = [ pkgs.fuse diff --git a/tvix/proto/default.nix b/tvix/proto/default.nix deleted file mode 100644 index 934a73fe33a6..000000000000 --- a/tvix/proto/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -# Target containing just the proto files used in tvix - -{ depot, lib, ... }: - -depot.nix.sparseTree { - name = "tvix-protos"; - root = depot.path.origSrc; - paths = [ - ../build/protos/build.proto - ../build/protos/rpc_build.proto - ../castore/protos/castore.proto - ../castore/protos/rpc_blobstore.proto - ../castore/protos/rpc_directory.proto - ../store/protos/pathinfo.proto - ../store/protos/rpc_pathinfo.proto - ]; -} |