From f99567286bb45e9185c2b6651c0b96344c2776e8 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 19:30:35 +0900 Subject: [PATCH 1/3] Do not set GHCUP_INSTALL_BASE_PREFIX in windows The value is being set by the bootstrap script Setting this env.sh seems to be redundant, and problematic for the cygwin platform --- .github/scripts/env.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/scripts/env.sh b/.github/scripts/env.sh index 61fd3c652..a8d57e697 100644 --- a/.github/scripts/env.sh +++ b/.github/scripts/env.sh @@ -20,9 +20,6 @@ if [ "${RUNNER_OS}" = "Windows" ] ; then # on windows use pwd to get unix style path CI_PROJECT_DIR="$(pwd)" export CI_PROJECT_DIR - export GHCUP_INSTALL_BASE_PREFIX="/c" - export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin" - export PATH="$GHCUP_BIN:$PATH" export CABAL_DIR="C:\\Users\\runneradmin\\AppData\\Roaming\\cabal" else export CI_PROJECT_DIR="${GITHUB_WORKSPACE}" From ab6db4843ad5bb2b27bb49097f7ddb561c7d19df Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 19:32:07 +0900 Subject: [PATCH 2/3] Remove the carriage return (on windows) --- .github/scripts/bootstrap.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/bootstrap.sh b/.github/scripts/bootstrap.sh index 5f805e5eb..1941cf0cc 100644 --- a/.github/scripts/bootstrap.sh +++ b/.github/scripts/bootstrap.sh @@ -12,7 +12,8 @@ git describe --always ./scripts/bootstrap/bootstrap-haskell -[ "$(ghc --numeric-version)" = "${BOOTSTRAP_HASKELL_GHC_VERSION}" ] -# https://github.com/actions/runner-images/issues/7061 -[ "$(ghcup config | grep --color=never meta-mode)" = "meta-mode: Lax" ] +# on windows remove the carriage return +[ "$(ghc --numeric-version | tr -d '\r\n')" = "${BOOTSTRAP_HASKELL_GHC_VERSION}" ] +# https://github.com/actions/runner-images/issues/7061 +[ "$(ghcup config | grep --color=never meta-mode | tr -d '\r\n')" = "meta-mode: Lax" ] From 856044574a6b10e93b56305cdacbc4d6779af08c Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 19:32:53 +0900 Subject: [PATCH 3/3] Add workflow for checking bootstrap on cygwin --- .github/workflows/bootstrap.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 49b9a8b5a..15936dced 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -57,3 +57,28 @@ jobs: Write-Host "Current Working Directory: $curDir" Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; try { & ([ScriptBlock]::Create((Invoke-WebRequest https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/scripts/bootstrap/bootstrap-haskell.ps1 -UseBasicParsing))) -InstallDir ${GITHUB_WORKSPACE} -BootstrapUrl ("{0}/scripts/bootstrap/bootstrap-haskell" -f $curDir) -InBash -Msys2Env "MINGW64" } catch { Write-Error $_ } shell: pwsh + + bootstrap-windows-cygwin: + name: bootstrap-windows-cygwin + runs-on: windows-latest + env: + BOOTSTRAP_HASKELL_CABAL_VERSION: 3.12.1.0 + BOOTSTRAP_HASKELL_GHC_VERSION: 9.6.7 + BOOTSTRAP_HASKELL_NONINTERACTIVE: yes + ARCH: 64 + JSON_VERSION: "0.0.7" + steps: + - run: git config --global core.autocrlf input + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Install cygwin + uses: cygwin/cygwin-install-action@master + with: + install-dir: 'c:\cygwin64' + + - name: Run bootstrap + run: | + sh ./.github/scripts/bootstrap.sh