Skip to content

Run bootstrap on cygwin #1266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
9 changes: 6 additions & 3 deletions .github/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ 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
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 | tr -d '\r\n')" = "meta-mode: Lax" ]
6 changes: 3 additions & 3 deletions .github/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 13 additions & 1 deletion scripts/bootstrap/bootstrap-haskell
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -80,13 +82,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}"

Expand All @@ -100,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}"
Expand Down
Loading