From f9953c31fc6b84a601364be5598748bbdb92f04d Mon Sep 17 00:00:00 2001 From: Matthias Ahouansou Date: Sun, 5 May 2024 09:28:48 +0100 Subject: [PATCH 1/3] Revert "ci: use sh instead of bash" This reverts commit 70b07dfabfe8108c5eb4a62a1dbf69500be6dcab. --- bin/nix-build-and-cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/nix-build-and-cache b/bin/nix-build-and-cache index 5b22b854..42c37709 100755 --- a/bin/nix-build-and-cache +++ b/bin/nix-build-and-cache @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash set -euo pipefail From a4c973e57eded43c850868c46768b7a9e30c2ab1 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Sun, 5 May 2024 09:25:39 +0100 Subject: [PATCH 2/3] build and cache all packages and CI dependencies This fixes the problem where some artifacts were not being cached when they should have been. The secret sauce is the `nix-store` command. --- bin/nix-build-and-cache | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/bin/nix-build-and-cache b/bin/nix-build-and-cache index 42c37709..6bd62664 100755 --- a/bin/nix-build-and-cache +++ b/bin/nix-build-and-cache @@ -17,15 +17,24 @@ if [ ! -z ${ATTIC_TOKEN+x} ]; then "${ATTIC_ENDPOINT:-https://attic.conduit.rs/conduit}" \ "$ATTIC_TOKEN" - readarray -t outputs < <(nix path-info "$@") readarray -t derivations < <(nix path-info "$@" --derivation) + for derivation in "${derivations[@]}"; do + cache+=( + "$(nix-store --query --requisites --include-outputs "$derivation")" + ) + done + + # Upload them to Attic + # + # Use `xargs` and a here-string because something would probably explode if + # several thousand arguments got passed to a command at once. Hopefully no + # store paths include a newline in them. + ( + IFS=$'\n' + nix shell --inputs-from . attic -c xargs \ + attic push conduit <<< "${cache[*]}" + ) - # Push the target installable and its build dependencies - nix run --inputs-from . attic -- \ - push \ - conduit \ - "${outputs[@]}" \ - "${derivations[@]}" else echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache" fi From 57a24f234d23b6b69da07d6cc85643fdc641cc32 Mon Sep 17 00:00:00 2001 From: Matthias Ahouansou Date: Sun, 5 May 2024 10:46:10 +0100 Subject: [PATCH 3/3] Revert "ci: temporarily disable CONDUIT_VERSION_EXTRA" This reverts commit 2a2b9554c8eea2b64cb4f19f5418a90488b93dae. --- nix/pkgs/default/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nix/pkgs/default/default.nix b/nix/pkgs/default/default.nix index 2595346f..4577fea9 100644 --- a/nix/pkgs/default/default.nix +++ b/nix/pkgs/default/default.nix @@ -36,8 +36,7 @@ let }); buildPackageEnv = { - # Temporarily disabled, see https://gitlab.com/famedly/conduit/-/merge_requests/662#note_1892753424 - # CONDUIT_VERSION_EXTRA = inputs.self.shortRev or inputs.self.dirtyShortRev; + CONDUIT_VERSION_EXTRA = inputs.self.shortRev or inputs.self.dirtyShortRev; } // buildDepsOnlyEnv; commonAttrs = {