feat(tvix/build): init
This adds the tvix-build crate, currently only containing a `tvix_build::proto` module, exposing the data structures defined in tvix/build/protos. Change-Id: I75f5d9196969ed0877b1fe640cacfecba0fb2e03 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10235 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
This commit is contained in:
parent
3c0a9a949a
commit
fd27d8ddc3
14 changed files with 330 additions and 0 deletions
35
tvix/build/protos/default.nix
Normal file
35
tvix/build/protos/default.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ depot, pkgs, ... }: {
|
||||
# Produces the golang bindings.
|
||||
go-bindings = pkgs.stdenv.mkDerivation {
|
||||
name = "go-bindings";
|
||||
|
||||
src = 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
|
||||
];
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgs.buf
|
||||
pkgs.protoc-gen-go
|
||||
pkgs.protoc-gen-go-grpc
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
buf lint
|
||||
buf format -d --exit-code
|
||||
buf generate
|
||||
|
||||
mkdir -p $out
|
||||
cp tvix/build/protos/*.pb.go $out/
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue