Skip to content

Commit

Permalink
a ghc-master/9.6.4 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne-fletcher committed Jun 23, 2024
1 parent 8dc6930 commit de56db6
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 16 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/ghc-lib-runhaskell-ghc-9.10.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,35 @@ jobs:
os: [ubuntu, macos, windows]
steps:
- uses: actions/checkout@v2
- uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: '2.15.7'
- run: |-
curl -sSL https://get.haskellstack.org/ | sh -s - -f
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=9.10.1 BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh
shell: bash
- name: Configure PATH (unix)
run: |-
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "$HOME/.ghcup/bin" >> $GITHUB_PATH
echo "$HOME/.ghcup/ghc/9.10.1/bin" >> $GITHUB_PATH
shell: bash
if: matrix.os == 'ubuntu' || matrix.os == 'macos'
- name: Configure PATH (windows)
run: |-
echo "C:\\Users\\runneradmin\\AppData\\Roaming\\local\\bin" >> $GITHUB_PATH
echo "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal\\bin" >> $GITHUB_PATH
echo "C:\\ghcup\\bin" >> $GITHUB_PATH
echo "C:\\ghcup\\ghc\\9.6.4\\bin" >> $GITHUB_PATH
shell: bash
if: matrix.os == 'windows'
- name: Print diagnostic PATH
shell: bash
run: echo "$PATH"
# - name: Upgrade stack from git
# shell: bash
# run: stack upgrade --git
- name: Print diagnostic stack
- name: Print diagnostics
shell: bash
run: |-
echo "wich stack: $(which stack)"
echo "stack-version: $(stack --version)"
echo "wich ghc: $(which ghc)"
echo "ghc-version: $(ghc --version)"
echo "wich cabal: $(which cabal)"
echo "cabal: $(cabal --version)"
- name: Install build tools
run: brew install automake
if: matrix.os == 'macos'
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/ghc-lib-runhaskell-ghc-9.6.5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ghc-lib-runhaskell-ghc-9.6.4
on:
push:
jobs:
ghc-9-10:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
steps:
- uses: actions/checkout@v2
- run: |-
curl -sSL https://get.haskellstack.org/ | sh -s - -f
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=9.6.5 BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh
shell: bash
- name: Configure PATH (unix)
run: |-
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "$HOME/.ghcup/bin" >> $GITHUB_PATH
echo "$HOME/.ghcup/ghc/9.6.5/bin" >> $GITHUB_PATH
shell: bash
if: matrix.os == 'ubuntu' || matrix.os == 'macos'
- name: Configure PATH (windows)
run: |-
echo "C:\\Users\\runneradmin\\AppData\\Roaming\\local\\bin" >> $GITHUB_PATH
echo "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal\\bin" >> $GITHUB_PATH
echo "C:\\ghcup\\bin" >> $GITHUB_PATH
echo "C:\\ghcup\\ghc\\9.6.5\\bin" >> $GITHUB_PATH
shell: bash
if: matrix.os == 'windows'
- name: Print diagnostics
shell: bash
run: |-
echo "wich stack: $(which stack)"
echo "stack-version: $(stack --version)"
echo "wich ghc: $(which ghc)"
echo "ghc-version: $(ghc --version)"
echo "wich cabal: $(which cabal)"
echo "cabal: $(cabal --version)"
- name: Install build tools
run: brew install automake
if: matrix.os == 'macos'
- name: Configure
shell: bash
# e.g. Don't recursively delete '.stack-work' (`stack clean --full`)
run: echo "GHCLIB_AZURE='1'" >> $GITHUB_ENV
- name: Run CI.hs
shell: bash
run: stack runhaskell --stack-yaml stack-exact.yaml --resolver ghc-9.6.5 --package extra --package optparse-applicative CI.hs -- --stack-yaml stack-exact.yaml --resolver ghc-9.6.5 --ghc-flavor "ghc-master"
10 changes: 5 additions & 5 deletions ghc-lib-gen/src/Ghclibgen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ cabalPackageDb ghcNumericVersion = do
home </> ".cabal/store" </> ghcVersion </> "package.db"
pure cabalPackageDb

ghcPackagePath :: String -> String -> String
ghcPackagePath :: String -> String -> IO String
ghcPackagePath cabalPackageDb ghcNumericVersion =
"GHC_PACKAGE_PATH=" ++ cabalPackageDb ++
pure $ "GHC_PACKAGE_PATH=" ++ cabalPackageDb ++
(if not isWindows then
":"
else
Expand Down Expand Up @@ -340,11 +340,11 @@ calcParserModules ghcFlavor = do

ghcNumericVersion <- ghcNumericVersion
cabalPackageDb <- cabalPackageDb ghcNumericVersion
ghcPackagePath <- pure $ ghcPackagePath cabalPackageDb ghcNumericVersion
ghcPackagePath <- ghcPackagePath cabalPackageDb ghcNumericVersion
semaphoreCompatBootExists <- (== ExitSuccess) . fst <$> systemOutput "bash -c \"ghc-pkg list | grep semaphore\""

when (not semaphoreCompatBootExists && flavor >= GHC_9_8) $ do
system_ "bash -c \"unset GHC_PACKAGE_PATH && cabal install --lib semaphore-compat --force-reinstalls\""
system_ "bash -c \"unset GHC_PACKAGE_PATH && cabal install --lib semaphore-compat --force-reinstalls -v3\""

let includeDirs = map ("-I" ++ ) (ghcLibParserIncludeDirs ghcFlavor)
hsSrcDirs = ghcLibParserHsSrcDirs True ghcFlavor lib
Expand Down Expand Up @@ -416,7 +416,7 @@ calcLibModules ghcFlavor = do

ghcNumericVersion <- ghcNumericVersion
cabalPackageDb <- cabalPackageDb ghcNumericVersion
ghcPackagePath <- pure $ ghcPackagePath cabalPackageDb ghcNumericVersion
ghcPackagePath <- ghcPackagePath cabalPackageDb ghcNumericVersion
semaphoreCompatBootExists <- (== ExitSuccess) . fst <$> systemOutput "bash -c \"ghc-pkg list | grep semaphore\""

let hsSrcDirs = ghcLibHsSrcDirs True ghcFlavor lib
Expand Down

0 comments on commit de56db6

Please sign in to comment.