From 63cfb6355dfa346b8aa79f2d40519f5c50a0f72d Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Fri, 9 Jun 2023 16:36:43 +1200 Subject: [PATCH] Avoid building in GHA (#71) * Avoid building in GHA GHA should be able to download the required files from the nix cache populated by hydra. If it cannot DL what it needs, it is better to have it fail instead of wasting resources trying a build that will probably eventually run out of disk space anyway. * Skip windows cross compile on darwin for now --- .github/workflows/main.yml | 2 +- extra/ghcr-upload.sh | 2 +- flake.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 346cac3..7bca06e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: # fixed output of the derivation is already in the `/nix/store` and will # not try to fetch it using the platform we do not have a builder for. if [[ "${{ matrix.platform }}" != "x86_64-linux" && "${{ matrix.target-platform }}" = "-js" ]]; then - nix build ".#hydraJobs.x86_64-linux.${{ matrix.compiler-nix-name }}-js-minimal" --show-trace + nix build --builders "" --max-jobs 0 ".#hydraJobs.x86_64-linux.${{ matrix.compiler-nix-name }}-js-minimal" --show-trace fi - name: Compute and upload closure and developer environment to ghcr.io env: diff --git a/extra/ghcr-upload.sh b/extra/ghcr-upload.sh index db41a0f..954fdb6 100755 --- a/extra/ghcr-upload.sh +++ b/extra/ghcr-upload.sh @@ -2,6 +2,6 @@ #! nix-shell -i bash -p zstd -p oras set -euox pipefail -nix build ".#hydraJobs.${DEV_SHELL}" --show-trace +nix build --builders "" --max-jobs 0 ".#hydraJobs.${DEV_SHELL}" --show-trace nix-store --export $(nix-store -qR result) | zstd -z8T8 >${DEV_SHELL} oras push ghcr.io/input-output-hk/devx:${DEV_SHELL} ${DEV_SHELL} diff --git a/flake.nix b/flake.nix index c0d4b89..f5c751c 100644 --- a/flake.nix +++ b/flake.nix @@ -81,7 +81,7 @@ "ghc945" ]; windows-compilers = pkgs: - pkgs.lib.optionalAttrs (__elem system ["x86_64-linux" "x86_64-darwin"]) + pkgs.lib.optionalAttrs (__elem system ["x86_64-linux"]) (builtins.removeAttrs (compilers pkgs) [ ]);