From 0d28787d86fc1b7c50bbe4e2970db4f0db229288 Mon Sep 17 00:00:00 2001 From: Ira Peach Date: Wed, 21 May 2025 22:44:10 -0500 Subject: [PATCH 01/16] Use /cygdrive path prefix for bootstrap-haskell. --- scripts/bootstrap/bootstrap-haskell | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index e55efaeb..971fcf83 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -80,13 +80,20 @@ set_msys2_env_dir() { } case "${plat}" in - MSYS*|MINGW*|CYGWIN*) + MSYS*|MINGW*) : "${GHCUP_INSTALL_BASE_PREFIX:=/c}" GHCUP_DIR=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup") GHCUP_BIN=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin") : "${GHCUP_MSYS2:=${GHCUP_DIR}/msys64}" set_msys2_env_dir ;; + CYGWIN*) + : "${GHCUP_INSTALL_BASE_PREFIX:=/cygdrive/c}" + GHCUP_DIR=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup") + GHCUP_BIN=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin") + : "${GHCUP_MSYS2:=${GHCUP_DIR}/msys64}" + set_msys2_env_dir + ;; *) : "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}" From 974bc99a1155058713d4eaee7d95c6fe26a1ebb2 Mon Sep 17 00:00:00 2001 From: Divam Date: Thu, 29 May 2025 21:20:00 +0900 Subject: [PATCH 02/16] Run bootstrap on cygwin --- .github/workflows/bootstrap.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 49b9a8b5..61c6a2fd 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -57,3 +57,27 @@ 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 From c32b92ac48dcb9d568e455c32d2010434d95194f Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 15:00:50 +0900 Subject: [PATCH 03/16] remove ming64 --- .github/workflows/bootstrap.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 61c6a2fd..1f972f1d 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -80,4 +80,6 @@ jobs: install-dir: 'c:\cygwin64' - name: Run bootstrap - run: sh ./.github/scripts/bootstrap.sh + run: | + $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -notmatch '^C:/mingw64/bin' }) -join ';' + sh ./.github/scripts/bootstrap.sh From 2625e12c3c52a790e40fda2e63e75dada412c3a0 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 15:16:31 +0900 Subject: [PATCH 04/16] Revert "remove ming64" This reverts commit c32b92ac48dcb9d568e455c32d2010434d95194f. --- .github/workflows/bootstrap.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 1f972f1d..61c6a2fd 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -80,6 +80,4 @@ jobs: install-dir: 'c:\cygwin64' - name: Run bootstrap - run: | - $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -notmatch '^C:/mingw64/bin' }) -join ';' - sh ./.github/scripts/bootstrap.sh + run: sh ./.github/scripts/bootstrap.sh From 3949c7faafcab04abaf5bce7096a6b5c53e7e15d Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 15:23:46 +0900 Subject: [PATCH 05/16] add debug info --- scripts/bootstrap/bootstrap-haskell | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index 971fcf83..88697b8b 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -39,7 +39,9 @@ die() { exit 2 } +echo "DEBUG:START" plat="$(uname -s)" +echo "DEBUG:plat ${plat}" arch=$(uname -m) ghver="0.1.50.2" : "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}" @@ -107,6 +109,9 @@ case "${plat}" in ;; esac +echo "DEBUG:GHCUP_INSTALL_BASE_PREFIX ${GHCUP_INSTALL_BASE_PREFIX}" +echo "DEBUG:GHCUP_DIR ${GHCUP_DIR}" + : "${BOOTSTRAP_HASKELL_GHC_VERSION:=recommended}" : "${BOOTSTRAP_HASKELL_CABAL_VERSION:=recommended}" : "${BOOTSTRAP_HASKELL_STACK_VERSION:=recommended}" From aa36723712894115d0dc9dc7f9698171eefc3109 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 15:31:25 +0900 Subject: [PATCH 06/16] unset prefix --- .github/workflows/bootstrap.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 61c6a2fd..539412cc 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -68,6 +68,9 @@ jobs: ARCH: 64 JSON_VERSION: "0.0.7" steps: + - name: unset GHCUP_INSTALL_BASE_PREFIX + run: Remove-Item Env:GHCUP_INSTALL_BASE_PREFIX + - run: git config --global core.autocrlf input - name: Checkout code uses: actions/checkout@v3 From fea0e5c01dd58f55a942a339c6218a3c044021e5 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 15:36:25 +0900 Subject: [PATCH 07/16] fix --- .github/workflows/bootstrap.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 539412cc..3c3a6e45 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -68,9 +68,6 @@ jobs: ARCH: 64 JSON_VERSION: "0.0.7" steps: - - name: unset GHCUP_INSTALL_BASE_PREFIX - run: Remove-Item Env:GHCUP_INSTALL_BASE_PREFIX - - run: git config --global core.autocrlf input - name: Checkout code uses: actions/checkout@v3 @@ -83,4 +80,6 @@ jobs: install-dir: 'c:\cygwin64' - name: Run bootstrap - run: sh ./.github/scripts/bootstrap.sh + run: | + Remove-Item Env:GHCUP_INSTALL_BASE_PREFIX + sh ./.github/scripts/bootstrap.sh From b6130061f581d3623bc8d92470c720546bd69a99 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 16:01:52 +0900 Subject: [PATCH 08/16] fix --- .github/workflows/bootstrap.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 3c3a6e45..c30a6182 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,5 +81,4 @@ jobs: - name: Run bootstrap run: | - Remove-Item Env:GHCUP_INSTALL_BASE_PREFIX - sh ./.github/scripts/bootstrap.sh + sh -c "unset GHCUP_INSTALL_BASE_PREFIX && ./github/scripts/bootstrap.sh" From 6fcbb7fc59191c051403154fe9ed38ef45f7eeeb Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 16:10:11 +0900 Subject: [PATCH 09/16] fix --- .github/workflows/bootstrap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index c30a6182..8a83b206 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,4 +81,4 @@ jobs: - name: Run bootstrap run: | - sh -c "unset GHCUP_INSTALL_BASE_PREFIX && ./github/scripts/bootstrap.sh" + sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u $CI_PROJECT_DIR/github/scripts/bootstrap.sh)" From 746ffa483974c20d04293e21ac4a26d5eafd2c19 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 16:14:51 +0900 Subject: [PATCH 10/16] fix --- .github/workflows/bootstrap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 8a83b206..bd3e3a5b 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,4 +81,4 @@ jobs: - name: Run bootstrap run: | - sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u $CI_PROJECT_DIR/github/scripts/bootstrap.sh)" + sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u ${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh)" From 7e861a4384a7d86a69073d9f951117ab556c8357 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 16:17:50 +0900 Subject: [PATCH 11/16] fix --- .github/workflows/bootstrap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index bd3e3a5b..33ff6350 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,4 +81,4 @@ jobs: - name: Run bootstrap run: | - sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u ${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh)" + sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u \"${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh\")" From d6d83b95fc538026ab7838abd54b95bb3492e8e2 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 16:39:46 +0900 Subject: [PATCH 12/16] fix --- .github/workflows/bootstrap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index 33ff6350..b8e05bca 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,4 +81,4 @@ jobs: - name: Run bootstrap run: | - sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u \"${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh\")" + sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh')" From d21bb318319590d5d9d2e2d553deec7dfc9198e9 Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 16:49:17 +0900 Subject: [PATCH 13/16] debug --- .github/workflows/bootstrap.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index b8e05bca..fd3f1220 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,4 +81,11 @@ jobs: - name: Run bootstrap run: | + sh -c "echo $GHCUP_INSTALL_BASE_PREFIX" + sh -c "unset GHCUP_INSTALL_BASE_PREFIX" + sh -c "echo $GHCUP_INSTALL_BASE_PREFIX" + sh -c "echo '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh' + sh -c "echo $(cygpath -u '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh')" + sh -c "echo '${GITHUB_WORKSPACE}\github\scripts\bootstrap.sh' + sh -c "echo $(cygpath -u '${GITHUB_WORKSPACE}\github\scripts\bootstrap.sh')" sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh')" From 38dad36e158f883621a9917d3562b2a26247ef1b Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 18:32:23 +0900 Subject: [PATCH 14/16] test --- .github/scripts/env.sh | 6 +++--- .github/workflows/bootstrap.yaml | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/scripts/env.sh b/.github/scripts/env.sh index 61fd3c65..b202f14a 100644 --- a/.github/scripts/env.sh +++ b/.github/scripts/env.sh @@ -20,9 +20,9 @@ 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 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}" diff --git a/.github/workflows/bootstrap.yaml b/.github/workflows/bootstrap.yaml index fd3f1220..15936dce 100644 --- a/.github/workflows/bootstrap.yaml +++ b/.github/workflows/bootstrap.yaml @@ -81,11 +81,4 @@ jobs: - name: Run bootstrap run: | - sh -c "echo $GHCUP_INSTALL_BASE_PREFIX" - sh -c "unset GHCUP_INSTALL_BASE_PREFIX" - sh -c "echo $GHCUP_INSTALL_BASE_PREFIX" - sh -c "echo '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh' - sh -c "echo $(cygpath -u '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh')" - sh -c "echo '${GITHUB_WORKSPACE}\github\scripts\bootstrap.sh' - sh -c "echo $(cygpath -u '${GITHUB_WORKSPACE}\github\scripts\bootstrap.sh')" - sh -c "unset GHCUP_INSTALL_BASE_PREFIX && $(cygpath -u '${GITHUB_WORKSPACE}/github/scripts/bootstrap.sh')" + sh ./.github/scripts/bootstrap.sh From 9252c2ec51a1a6c4295f7646f4bc21536c6b355a Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 19:09:39 +0900 Subject: [PATCH 15/16] fix version check --- .github/scripts/bootstrap.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/scripts/bootstrap.sh b/.github/scripts/bootstrap.sh index 5f805e5e..8edcfbe5 100644 --- a/.github/scripts/bootstrap.sh +++ b/.github/scripts/bootstrap.sh @@ -12,7 +12,10 @@ git describe --always ./scripts/bootstrap/bootstrap-haskell -[ "$(ghc --numeric-version)" = "${BOOTSTRAP_HASKELL_GHC_VERSION}" ] +# on windows remove the carriage return +version=$(ghc --numeric-version | tr -d '\r\n') + +[ "$version" = "${BOOTSTRAP_HASKELL_GHC_VERSION}" ] + # https://github.com/actions/runner-images/issues/7061 [ "$(ghcup config | grep --color=never meta-mode)" = "meta-mode: Lax" ] - From 03391d0bfd44c14b12dc26a422eb2977751d1afa Mon Sep 17 00:00:00 2001 From: Divam Date: Fri, 30 May 2025 19:13:40 +0900 Subject: [PATCH 16/16] fix --- .github/scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/bootstrap.sh b/.github/scripts/bootstrap.sh index 8edcfbe5..0190802d 100644 --- a/.github/scripts/bootstrap.sh +++ b/.github/scripts/bootstrap.sh @@ -18,4 +18,4 @@ version=$(ghc --numeric-version | tr -d '\r\n') [ "$version" = "${BOOTSTRAP_HASKELL_GHC_VERSION}" ] # https://github.com/actions/runner-images/issues/7061 -[ "$(ghcup config | grep --color=never meta-mode)" = "meta-mode: Lax" ] +[ "$(ghcup config | grep --color=never meta-mode | tr -d '\r\n')" = "meta-mode: Lax" ]