about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-11-19T21·24+0000
committerflokli <flokli@flokli.de>2022-12-27T13·27+0000
commit7df27dad12e13c3abf3292bd24718df9529475ed (patch)
treec7371563a816f2730e335d0642b222c47b19ac24 /nix
parenta2ac8a66c1bf151a9d70704b23ec2bd2dd3b99a6 (diff)
feat(nix/bufCheck): always run from repo root r/5501
This doesn't work when run from subdirectories, and going there manually before
running `mg run //nix/bufCheck` is annoying.

Change-Id: Icd30a7596ff0dfe2781f7cfa1b4085cbfdebd6ac
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7324
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'nix')
-rw-r--r--nix/bufCheck/default.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nix/bufCheck/default.nix b/nix/bufCheck/default.nix
index 97b4124d4569..f247e6839eee 100644
--- a/nix/bufCheck/default.nix
+++ b/nix/bufCheck/default.nix
@@ -4,10 +4,10 @@
 
 pkgs.writeShellScriptBin "ci-buf-check" ''
   export PATH="$PATH:${pkgs.lib.makeBinPath [ pkgs.buf pkgs.protoc-gen-go pkgs.protoc-gen-go-grpc ]}"
-  buf lint .
+  (cd $(git rev-parse --show-toplevel) && buf lint .)
 
   # Run buf generate, and bail out if generated files are changed.
-  buf generate --path tvix/store/protos
+  (cd $(git rev-parse --show-toplevel) && buf generate --path tvix/store/protos)
   # Check if any files have changed
   if [[ -n "$(git status --porcelain -unormal)" ]]; then
       echo "-----------------------------"
@@ -18,5 +18,5 @@ pkgs.writeShellScriptBin "ci-buf-check" ''
   fi
 
   # Report-only
-  buf breaking . --against "./.git#ref=HEAD~1" || true
+  (cd $(git rev-parse --show-toplevel) && (buf breaking . --against "./.git#ref=HEAD~1" || true))
 ''