about summary refs log tree commit diff
path: root/tvix/castore-go/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/castore-go/default.nix')
-rw-r--r--tvix/castore-go/default.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/tvix/castore-go/default.nix b/tvix/castore-go/default.nix
new file mode 100644
index 000000000000..09bbb77f81d4
--- /dev/null
+++ b/tvix/castore-go/default.nix
@@ -0,0 +1,25 @@
+{ depot, pkgs, ... }:
+
+(pkgs.buildGoModule {
+  name = "castore-go";
+  src = depot.third_party.gitignoreSource ./.;
+  vendorHash = "sha256-ZNtSSW+oCxMsBtURSrea9/GyUHDagtGefM+Ii+VkgCA=";
+}).overrideAttrs (_: {
+  meta.ci.extraSteps = {
+    check = {
+      label = ":water_buffalo: ensure generated protobuf files match";
+      needsOutput = true;
+      command = pkgs.writeShellScript "pb-go-check" ''
+        ${depot.tvix.castore-go-generate}
+        if [[ -n "$(git status --porcelain -unormal)" ]]; then
+            echo "-----------------------------"
+            echo ".pb.go files need to be updated, run //tvix:castore-go-generate"
+            echo "-----------------------------"
+            git status -unormal
+            exit 1
+        fi
+      '';
+      alwaysRun = true;
+    };
+  };
+})