Skip to content

Commit a0e5686

Browse files
authored
Merge pull request #1304 from IntersectMBO/wasm-ci-gitlab-fallback
haskell-wasm CI: add archive.org fallback for the ghc-wasm-meta input
2 parents 973b2ec + 51b091c commit a0e5686

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description: |
2+
Made the WASM CI job resilient to gitlab.haskell.org outages by pre-fetching the ghc-wasm-meta flake input with a fallback to a byte-identical, narHash-verified mirror on archive.org
3+
kind:
4+
- maintenance
5+
pr: 1304
6+
project: cardano-wasm

.github/workflows/haskell-wasm.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,29 @@ jobs:
6060
extra_nix_config: |
6161
accept-flake-config = true
6262
63+
# ghc-wasm-meta is the only flake input hosted on gitlab.haskell.org, whose
64+
# availability is flaky, and an outage breaks every nix invocation below.
65+
# Pre-fetch that input, falling back to a byte-identical mirror on
66+
# archive.org. The narHash taken from flake.lock guarantees that whichever
67+
# source responds yields exactly the locked content, and the nix
68+
# invocations below then resolve the input locally without re-downloading.
69+
- name: Fetch ghc-wasm-meta flake input (with archive.org mirror fallback)
70+
run: |
71+
rev=$(jq -r '.nodes["ghc-wasm-meta"].locked.rev' flake.lock)
72+
narHash=$(jq -r '.nodes["ghc-wasm-meta"].locked.narHash' flake.lock)
73+
hashQuery=${narHash//=/%3D}
74+
if nix flake prefetch --option connect-timeout 60 --option download-attempts 2 \
75+
"gitlab:haskell-wasm/ghc-wasm-meta/${rev}?host=gitlab.haskell.org&narHash=${hashQuery}"; then
76+
echo "Fetched ghc-wasm-meta@${rev} from gitlab.haskell.org"
77+
else
78+
echo "::warning::gitlab.haskell.org is unavailable, falling back to the archive.org mirror of ghc-wasm-meta@${rev}"
79+
nix flake prefetch \
80+
"tarball+https://archive.org/download/ghc-wasm-meta-${rev}/ghc-wasm-meta-${rev}-${rev}.tar.gz?narHash=${hashQuery}" || {
81+
echo "::error::The archive.org mirror does not serve ghc-wasm-meta@${rev}. If the flake input was re-pinned, upload the new GitLab archive tarball to an archive.org item named ghc-wasm-meta-${rev} (keeping GitLab's file name), or wait for gitlab.haskell.org to recover."
82+
exit 1
83+
}
84+
fi
85+
6386
- uses: rrbutani/use-nix-shell-action@v1
6487
with:
6588
devShell: .#wasm

0 commit comments

Comments
 (0)