diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03e98869a..8e4a51874 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,7 @@ node dependencies: - install -m 0644 .gitlab-ci/nix-bootstrap.conf /etc/nix/nix.conf - .gitlab-ci/write-minio-creds.sh - .gitlab-ci/make-minio-bucket.sh + - nix-env -f .gitlab-ci/patched-nix.nix -iE 'f: f {}' - cp -pr --reflink=auto -L .gitlab-ci/upload-to-cache.sh /etc/nix/upload-to-cache.sh - install -m 0644 .gitlab-ci/nix.conf /etc/nix/nix.conf - git config --global init.defaultBranch master diff --git a/.gitlab-ci/debug-aws.patch b/.gitlab-ci/debug-aws.patch new file mode 100644 index 000000000..a7583c295 --- /dev/null +++ b/.gitlab-ci/debug-aws.patch @@ -0,0 +1,12 @@ +diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc +index 6bfbee044..ff406e5e4 100644 +--- a/src/libstore/s3-binary-cache-store.cc ++++ b/src/libstore/s3-binary-cache-store.cc +@@ -126,6 +126,7 @@ ref S3Helper::makeConfig(const string & region + initAWS(); + auto res = make_ref(); + res->region = region; ++ debug("configuring scheme %s", scheme); + if (!scheme.empty()) { + res->scheme = Aws::Http::SchemeMapper::FromString(scheme.c_str()); + } diff --git a/.gitlab-ci/nix.conf b/.gitlab-ci/nix.conf index 713c109a0..29c91aba8 100644 --- a/.gitlab-ci/nix.conf +++ b/.gitlab-ci/nix.conf @@ -1,6 +1,6 @@ sandbox = true experimental-features = nix-command flakes ca-references -substituters = https://hydra.iohk.io https://cache.nixos.org/ +substituters = https://hydra.iohk.io https://cache.nixos.org/ s3://nix-cache?scheme=http&endpoint=minio-gitlab-runner-cache trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= minio-gitlab-runner-cache:ZN5neq93MHqpnieHSBlxGgWvCL0WKrZ2S9QS+U5Bnro= require-sigs = true post-build-hook = /etc/nix/upload-to-cache.sh \ No newline at end of file diff --git a/.gitlab-ci/patched-nix.nix b/.gitlab-ci/patched-nix.nix new file mode 100644 index 000000000..7b5f707af --- /dev/null +++ b/.gitlab-ci/patched-nix.nix @@ -0,0 +1,4 @@ +{ pkgs ? import {} }: +pkgs.nixUnstable.overrideAttrs (oldAttrs: { + patches = oldAttrs.patches or [] ++ [ ./debug-aws.patch ]; +}) diff --git a/.gitlab-ci/upload-to-cache.sh b/.gitlab-ci/upload-to-cache.sh index 171a4f00f..5adbd5cb8 100755 --- a/.gitlab-ci/upload-to-cache.sh +++ b/.gitlab-ci/upload-to-cache.sh @@ -5,4 +5,4 @@ set -f # disable globbing export IFS=' ' echo "Signing and uploading paths" $OUT_PATHS -exec nix --debug copy --to "s3://nix-cache?region=us-east-1&scheme=http&endpoint=minio-gitlab-runner-cache:80&secret-key=${NIX_CACHE_KEYFILE}" $OUT_PATHS +exec nix --debug copy --to "s3://nix-cache?region=us-east-1&scheme=http&endpoint=minio-gitlab-runner-cache&secret-key=${NIX_CACHE_KEYFILE}" $OUT_PATHS