From ffe4cc6f421fe086ef8be6a1baf823a1ea8c2464 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 21 Jun 2026 12:55:15 +0200 Subject: [PATCH] nix(loadtest): allow running multiple postgrest-loadtest in same working directory There is no need to store the out-links to the various build artifacts in the current working directory while running postgrest-with-pg, which is used by postgrest-loadtest. Instead reference the nix store paths directly. Resolves #5028 --- nix/tools/nixpkgsTools.nix | 2 +- nix/tools/withTools.nix | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/tools/nixpkgsTools.nix b/nix/tools/nixpkgsTools.nix index db1f76234..03866a36f 100644 --- a/nix/tools/nixpkgsTools.nix +++ b/nix/tools/nixpkgsTools.nix @@ -17,7 +17,7 @@ let nix flake update echo "# This file is auto-generated by postgrest-nixpkgs-upgrade" > docs/requirements.txt - cat "$(nix-build -A docs.requirements)" >> docs/requirements.txt + cat "$(nix-build --no-out-link -A docs.requirements)" >> docs/requirements.txt ''; in diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index 0b55b2451..94562207e 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -312,14 +312,14 @@ let if [ -z "''${PGRST_BUILD_CABAL:-}" ]; then echo -n "${commandName}: Building postgrest (nix)... " # Using lib.getBin to also make this work with older checkouts, where .bin was not a thing, yet. - nix-build -E 'with import ./. {}; pkgs.lib.getBin postgrestPackage' > "$tmpdir"/build.log 2>&1 || { + nix-build --no-out-link -E 'with import ./. {}; pkgs.lib.getBin postgrestPackage' > "$tmpdir"/build.log 2>&1 || { echo "failed, output:" cat "$tmpdir"/build.log exit 1 } - PGRST_CMD=$(echo ./result*/bin/postgrest) + PGRST_CMD="$(nix-build --no-out-link -E 'with import ./. {}; pkgs.lib.getBin postgrestPackage')/bin/postgrest" # To avoid glibc mismatches with back-branches, we need to take libfaketime from the target branch. - FAKETIME_CMD="$(nix-build -A pkgs.libfaketime)/bin/faketime" + FAKETIME_CMD="$(nix-build --no-out-link -A pkgs.libfaketime)/bin/faketime" else echo -n "${commandName}: Building postgrest (cabal)... " postgrest-build