From 73e03b90c2fe00edbad88e7aa185ff35d92ebf4a Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Tue, 15 Apr 2025 17:18:07 +0000
Subject: [PATCH] ci: use rocky8 for linux ghcup jobs

---
 .gitlab-ci.yml | 16 +++++++++-------
 setup.sh       |  2 +-
 tests/ghci.sh  |  2 +-
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e74868e..bbd74af 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -206,19 +206,21 @@ aarch64-darwin-nix:
 
 .linux-ghcup:
   extends: .ghcup
-  image: debian:12
+  image: rockylinux:8
   before_script:
     - |
-      apt update
-      apt full-upgrade -y
-      apt install -y \
-        build-essential \
-        curl \
+      dnf upgrade -y
+      dnf install -y \
+        epel-release
+      crb enable
+      dnf install -y \
         chromium \
-        firefox-esr \
+        firefox \
         jq \
+        make \
         unzip \
         zstd
+      ln -s /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
 
 x86_64-linux-ghcup:
   extends: .linux-ghcup
diff --git a/setup.sh b/setup.sh
index ec6797b..5076929 100755
--- a/setup.sh
+++ b/setup.sh
@@ -114,7 +114,7 @@ mkdir -p "$PREFIX/binaryen"
 curl -f -L --retry 5 "$(jq -r ".\"$BINARYEN\".url" "$REPO"/autogen.json)" | tar xz -C "$PREFIX/binaryen" --no-same-owner --strip-components=1
 
 mkdir -p "$PREFIX/wasmtime"
-curl -f -L --retry 5 "$(jq -r ".\"$WASMTIME\".url" "$REPO"/autogen.json)" | tar x --zstd -C "$PREFIX/wasmtime" --no-same-owner --strip-components=1
+curl -f -L --retry 5 "$(jq -r ".\"$WASMTIME\".url" "$REPO"/autogen.json)" | unzstd | tar x -C "$PREFIX/wasmtime" --no-same-owner --strip-components=1
 
 mkdir -p "$PREFIX/wasm-run/bin"
 cp -a "$REPO"/wasm-run/*.mjs "$REPO"/wasm-run/*.sh "$PREFIX/wasm-run/bin"
diff --git a/tests/ghci.sh b/tests/ghci.sh
index c067456..22993be 100755
--- a/tests/ghci.sh
+++ b/tests/ghci.sh
@@ -12,7 +12,7 @@ if [[ $FIREFOX_PATH != "" ]]; then
   echo -e "$GHCI_SCRIPT" | wasm32-wasi-ghc --interactive -fghci-browser -fghci-browser-puppeteer-launch-opts="{\"browser\":\"firefox\",\"executablePath\":\"$FIREFOX_PATH\"}"
 fi
 
-CHROME_PATH=$(type -P google-chrome-stable || type -P chromium || echo "")
+CHROME_PATH=$(type -P google-chrome-stable || type -P chromium || type -P chromium-browser || echo "")
 
 if [[ $CHROME_PATH != "" ]]; then
   echo -e "$GHCI_SCRIPT" | wasm32-wasi-ghc --interactive -fghci-browser -fghci-browser-puppeteer-launch-opts="{\"browser\":\"chrome\",\"protocol\":\"webDriverBiDi\",\"executablePath\":\"$CHROME_PATH\",\"args\":[\"--no-sandbox\"]}"
-- 
GitLab