From 6534e188843da5a5be7342b9a2a189ccc80d3268 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 3 Apr 2024 11:54:14 -0400 Subject: Set CODEROOT dynamically in nix builds This seems to be needed for git test to work, in particular the directory inside the nix sandbox is like '/build/' which, in the case of git test, is the name of the worktree that git-branchless uses to checkout the commit under test. This is something like 'test-worktree-2'. So, I can't hardcode anything there. --- Biz/Bild.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 04be55f..24ce4bf 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -116,13 +116,12 @@ in nixpkgs // { src = ../.; USER = "nixbld"; HOSTNAME = "nix-sandbox"; - # this is the default sandbox path where bild will be working: - CODEROOT = "/build/omni"; # we need to remove the $src root because bild expects paths relative to the # working directory: TARGET = "." + lib.strings.removePrefix (toString src) (toString target); buildPhase = '' + export CODEROOT=$(pwd) mkdir $out ${bild}/bin/bild --plan "$TARGET" 1> $out/analysis.json \ 2> >(tee -a $out/stderr >&2) -- cgit v1.2.3