diff --git a/.github/workflows/ghc-lib-da-ghc-8.4.3.yml b/.github/workflows/ghc-lib-da-ghc-8.4.3.yml new file mode 100644 index 00000000..fce9c2df --- /dev/null +++ b/.github/workflows/ghc-lib-da-ghc-8.4.3.yml @@ -0,0 +1,60 @@ +name: ghc-lib-da-ghc-8.4.3 +on: + push: +jobs: + runhaskell: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu, windows] + steps: + - uses: actions/checkout@v4 + - name: Install msys2 (windows) + shell: bash + run: |- + curl -L https://github.com/commercialhaskell/stackage-content/releases/download/msys2-20230526/msys2-20230526-x86_64.tar.xz -o msys2-20230526-x86_64.tar.xz + tar xvf msys2-20230526-x86_64.tar.xz > /dev/null + echo "GHCUP_MSYS2=$(pwd)/msys64" >> $GITHUB_ENV + if: matrix.os == 'windows' + - name: Install ghcup + shell: bash + run: |- + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \ + BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \ + BOOTSTRAP_HASKELL_GHC_VERSION=8.4.3 \ + BOOTSTRAP_HASKELL_CABAL_VERSION=latest \ + BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 \ + BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 \ + BOOTSTRAP_HASKELL_ADJUST_BASHRC=N sh + - name: Setup cabal (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/.ghcup/ghc-8.4.3/bin:/c/.ghcup/bin:$PATH + export PATH + cabal install alex happy + cabal --store-dir="c:\\cabal\\store" --lib --force-reinstalls --package-env=- install extra-1.6.13 optparse-applicative-0.14.3.0 + if: matrix.os == 'windows' + - name: Setup cabal(unix) + shell: bash + run: |- + PATH="$HOME/.cabal/bin":"$HOME/.ghcup/ghc-8.4.3/bin":"$HOME/.ghcup/bin:$PATH" + export PATH + cabal install alex happy + cabal --store-dir=$HOME/.cabal/store --lib --force-reinstalls --package-env=- install extra-1.6.13 optparse-applicative-0.14.3.0 + if: matrix.os == 'ubuntu' || matrix.os == 'macos' + - name: Run CI.hs (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/ghcup/ghc/8.4.3/bin:/c/ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + $GHCUP_MSYS2/usr/bin/bash --noprofile --norc -e -o pipefail -c "set -x && pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm && runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=/c/cabal/store/$(ls /c/cabal/store)/package.db CI.hs --da" + if: matrix.os == 'windows' + - name: Run CI.hs (unix) + shell: bash + run: |- + PATH="$HOME/.cabal/bin":"$HOME/.ghcup/ghc/8.4.3/bin":"$HOME/.ghcup/bin":"$PATH" + export PATH + runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=$HOME/.cabal/store/$(ls $HOME/.cabal/store)/package.db CI.hs --da + if: matrix.os == 'ubuntu' || matrix.os == 'macos' diff --git a/.github/workflows/ghc-lib-ghc-9.10.0-ghc-9.8.2.yml b/.github/workflows/ghc-lib-ghc-9.10.0-ghc-9.8.2.yml new file mode 100644 index 00000000..909025f6 --- /dev/null +++ b/.github/workflows/ghc-lib-ghc-9.10.0-ghc-9.8.2.yml @@ -0,0 +1,63 @@ +name: ghc-lib-ghc-9.10.1-ghc-9.8.2 +on: + push: +jobs: + runhaskell: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos, windows] + steps: + - uses: actions/checkout@v4 + - name: Install build tools (macOS) + run: brew install automake + if: matrix.os == 'macos' + - name: Install msys2 (windows) + shell: bash + run: |- + curl -L https://github.com/commercialhaskell/stackage-content/releases/download/msys2-20230526/msys2-20230526-x86_64.tar.xz -o msys2-20230526-x86_64.tar.xz + tar xvf msys2-20230526-x86_64.tar.xz > /dev/null + echo "GHCUP_MSYS2=$(pwd)/msys64" >> $GITHUB_ENV + if: matrix.os == 'windows' + - name: Install ghcup + shell: bash + run: |- + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \ + BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \ + BOOTSTRAP_HASKELL_GHC_VERSION=9.8.2 \ + BOOTSTRAP_HASKELL_CABAL_VERSION=latest \ + BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 \ + BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 \ + BOOTSTRAP_HASKELL_ADJUST_BASHRC=N sh + - name: Setup cabal (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/.ghcup/ghc-9.8.2/bin:/c/.ghcup/bin:$PATH + export PATH + cabal install alex happy + cabal --store-dir="c:\\cabal\\store" --lib --force-reinstalls --package-env=- install extra-1.7.16 optparse-applicative-0.18.1.0 + if: matrix.os == 'windows' + - name: Setup cabal(unix) + shell: bash + run: |- + PATH=$HOME/.cabal/bin:$HOME/.ghcup/ghc/9.8.2/bin:$HOME/.ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + cabal install alex happy + cabal --store-dir=$HOME/.cabal/store --lib --force-reinstalls --package-env=- install extra-1.7.16 optparse-applicative-0.18.1.0 + if: matrix.os == 'ubuntu' || matrix.os == 'macos' + - name: Run CI.hs (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/ghcup/ghc/9.8.2/bin:/c/ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + $GHCUP_MSYS2/usr/bin/bash --noprofile --norc -e -o pipefail -c "set -x && pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm && runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=/c/cabal/store/$(ls /c/cabal/store)/package.db CI.hs --ghc-flavor ghc-9.10.1" + if: matrix.os == 'windows' + - name: Run CI.hs (unix) + shell: bash + run: |- + PATH="$HOME/.cabal/bin":"$HOME/.ghcup/ghc/9.8.2/bin":"$HOME/.ghcup/bin":"$PATH" + export PATH + runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=$HOME/.cabal/store/$(ls $HOME/.cabal/store)/package.db CI.hs --ghc-flavor ghc-9.10.1 + if: matrix.os == 'ubuntu' || matrix.os == 'macos' diff --git a/.github/workflows/ghc-lib-ghc-9.8.2-ghc-9.6.5.yml b/.github/workflows/ghc-lib-ghc-9.8.2-ghc-9.6.5.yml new file mode 100644 index 00000000..432e5018 --- /dev/null +++ b/.github/workflows/ghc-lib-ghc-9.8.2-ghc-9.6.5.yml @@ -0,0 +1,63 @@ +name: ghc-lib-ghc-9.8.2-ghc-9.6.5 +on: + push: +jobs: + runhaskell: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos, windows] + steps: + - uses: actions/checkout@v4 + - name: Install build tools (macOS) + run: brew install automake + if: matrix.os == 'macos' + - name: Install msys2 (windows) + shell: bash + run: |- + curl -L https://github.com/commercialhaskell/stackage-content/releases/download/msys2-20230526/msys2-20230526-x86_64.tar.xz -o msys2-20230526-x86_64.tar.xz + tar xvf msys2-20230526-x86_64.tar.xz > /dev/null + echo "GHCUP_MSYS2=$(pwd)/msys64" >> $GITHUB_ENV + if: matrix.os == 'windows' + - name: Install ghcup + shell: bash + run: |- + 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=N sh + - name: Setup cabal (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/.ghcup/ghc-9.6.5/bin:/c/.ghcup/bin:$PATH + export PATH + cabal install alex happy + cabal --store-dir="c:\\cabal\\store" --lib --force-reinstalls --package-env=- install extra-1.7.16 optparse-applicative-0.18.1.0 semaphore-compat-1.0.0 + if: matrix.os == 'windows' + - name: Setup cabal(unix) + shell: bash + run: |- + PATH=$HOME/.cabal/bin:$HOME/.ghcup/ghc/9.6.5/bin:$HOME/.ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + cabal install alex happy + cabal --store-dir=$HOME/.cabal/store --lib --force-reinstalls --package-env=- install extra-1.7.16 optparse-applicative-0.18.1.0 semaphore-compat-1.0.0 + if: matrix.os == 'ubuntu' || matrix.os == 'macos' + - name: Run CI.hs (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/ghcup/ghc/9.6.5/bin:/c/ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + $GHCUP_MSYS2/usr/bin/bash --noprofile --norc -e -o pipefail -c "set -x && pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm && runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=/c/cabal/store/$(ls /c/cabal/store)/package.db CI.hs --ghc-flavor ghc-9.8.2" + if: matrix.os == 'windows' + - name: Run CI.hs (unix) + shell: bash + run: |- + PATH="$HOME/.cabal/bin":"$HOME/.ghcup/ghc/9.6.5/bin":"$HOME/.ghcup/bin":"$PATH" + export PATH + runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=$HOME/.cabal/store/$(ls $HOME/.cabal/store)/package.db CI.hs --ghc-flavor ghc-9.8.2 + if: matrix.os == 'ubuntu' || matrix.os == 'macos' diff --git a/.github/workflows/ghc-lib-ghc-master-ghc-9.10.1.yml b/.github/workflows/ghc-lib-ghc-master-ghc-9.10.1.yml new file mode 100644 index 00000000..cec632d1 --- /dev/null +++ b/.github/workflows/ghc-lib-ghc-master-ghc-9.10.1.yml @@ -0,0 +1,63 @@ +name: ghc-lib-ghc-master-ghc-9.10.1 +on: + push: +jobs: + runhaskell: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu, macos, windows] + steps: + - uses: actions/checkout@v4 + - name: Install build tools (macOS) + run: brew install automake + if: matrix.os == 'macos' + - name: Install msys2 (windows) + shell: bash + run: |- + curl -L https://github.com/commercialhaskell/stackage-content/releases/download/msys2-20230526/msys2-20230526-x86_64.tar.xz -o msys2-20230526-x86_64.tar.xz + tar xvf msys2-20230526-x86_64.tar.xz > /dev/null + echo "GHCUP_MSYS2=$(pwd)/msys64" >> $GITHUB_ENV + if: matrix.os == 'windows' + - name: Install ghcup + shell: bash + run: |- + 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=N sh + - name: Setup cabal (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/.ghcup/ghc-9.10.1/bin:/c/.ghcup/bin:$PATH + export PATH + cabal install alex happy + cabal --store-dir="c:\\cabal\\store" --lib --force-reinstalls --package-env=- install extra-1.7.16 optparse-applicative-0.18.1.0 + if: matrix.os == 'windows' + - name: Setup cabal(unix) + shell: bash + run: |- + PATH=/c/cabal/bin:$HOME/.ghcup/ghc/9.10.1/bin:$HOME/.ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + cabal install alex happy + cabal --store-dir=$HOME/.cabal/store --lib --force-reinstalls --package-env=- install extra-1.7.16 optparse-applicative-0.18.1.0 + if: matrix.os == 'ubuntu' || matrix.os == 'macos' + - name: Run CI.hs (windows) + shell: bash + run: |- + PATH=/c/cabal/bin:/c/ghcup/ghc/9.10.1/bin:/c/ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + $GHCUP_MSYS2/usr/bin/bash --noprofile --norc -e -o pipefail -c "set -x && pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm && runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=/c/cabal/store/$(ls /c/cabal/store)/package.db CI.hs --ghc-flavor ghc-master" + if: matrix.os == 'windows' + - name: Run CI.hs (unix) + shell: bash + run: |- + PATH="$HOME/.cabal/bin":"$HOME/.ghcup/ghc/9.10.1/bin":"$HOME/.ghcup/bin":"$PATH" + export PATH + runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=$HOME/.cabal/store/$(ls $HOME/.cabal/store)/package.db CI.hs --ghc-flavor ghc-master + if: matrix.os == 'ubuntu' || matrix.os == 'macos' diff --git a/.github/workflows/ghc-lib-runhaskell-ghc-9.10.1.yml b/.github/workflows/ghc-lib-runhaskell-ghc-9.10.1.yml deleted file mode 100644 index 97b7016d..00000000 --- a/.github/workflows/ghc-lib-runhaskell-ghc-9.10.1.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: ghc-lib-runhaskell-ghc-9.10.1 -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.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.10.1\\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.10.1 --package extra --package optparse-applicative CI.hs -- --stack-yaml stack-exact.yaml --resolver ghc-9.10.1 --ghc-flavor "ghc-9.10.1" diff --git a/.github/workflows/ghc-lib-runhaskell-ghc-9.6.5.yml b/.github/workflows/ghc-lib-runhaskell-ghc-9.6.5.yml deleted file mode 100644 index d6f2cbae..00000000 --- a/.github/workflows/ghc-lib-runhaskell-ghc-9.6.5.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: ghc-lib-runhaskell-ghc-9.6.5 -on: - push: -jobs: - runhaskell: - 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" diff --git a/CI.hs b/CI.hs index bcc79300..1dbdc3df 100755 --- a/CI.hs +++ b/CI.hs @@ -3,6 +3,8 @@ -- (Apache-2.0 OR BSD-3-Clause) -- CI script, compatible with all of Travis, Appveyor and Azure. +-- Compile with `stack exec --package optparse-applicative ---package extra -- ghc -package optparse-applicative -package extra -c CI.hs` + {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE CPP #-} @@ -76,7 +78,7 @@ data DaFlavor = DaFlavor -- Last tested gitlab.haskell.org/ghc/ghc.git at current :: String -current = "bc1d435e399d8376b4e33d5d936424ff76cb686a" -- 2024-06-30 +current = "5b1aefb70edbd54ac899896df39d8f3d6c579518" -- 2024-07-07 -- Command line argument generators. @@ -337,24 +339,14 @@ buildDists versionSuffix = do - let stackConfig = fromMaybe "stack.yaml" stackYaml - - -- Clean up old state. - isCi <- isJust <$> lookupEnv "GHCLIB_AZURE" - -- Avoid https://github.com/commercialhaskell/stack/issues/5866. - unless isCi $ stack "clean --full" -- Recursively delete '.stack-work' filesInDot <- getDirectoryContents "." let lockFiles = filter (isExtensionOf ".lock") filesInDot tarBalls = filter (isExtensionOf ".tar.gz") filesInDot ghcDirs = ["ghc" | not noGhcCheckout] ++ [ "ghc-lib", "ghc-lib-parser" ] toDelete = ghcDirs ++ tarBalls ++ lockFiles forM_ toDelete removePath - cmd $ "git checkout " ++ stackConfig - cmd "git checkout ghc-lib-gen.cabal examples" - - -- Get packages missing on Windows needed by hadrian. - when isWindows $ - stack "exec -- pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm" + system_ "rm -f cabal.project" + system_ "git checkout ghc-lib-gen.cabal examples" -- If '--no-checkout' is given, it's on the caller to get the GHC -- clone with e.g. @@ -362,64 +354,34 @@ buildDists -- git fetch --tags && git submodule update --init --recursive -- and it won't be deleted between runs. if noGhcCheckout then do - cmd "{ cd ghc; git remote remove upstream || true; }" - cmd "cd ghc && git clean -xdf && git submodule foreach git clean -xdf && git submodule foreach git checkout . && git checkout ." + system_ "{ cd ghc; git remote remove upstream || true; }" + system_ "cd ghc && git clean -xdf && git submodule foreach git clean -xdf && git submodule foreach git checkout . && git checkout ." else do - if isWindows then do - cmd "git clone https://github.com/ghc/ghc.git" - cmd "git config --global url.\"git://github.com/ghc/packages-\".insteadOf git://github.com/ghc/packages/" - cmd "git config --global url.\"http://github.com/ghc/packages-\".insteadOf http://github.com/ghc/packages/" - cmd "git config --global url.\"https://github.com/ghc/packages-\".insteadOf https://github.com/ghc/packages/" - cmd "git config --global url.\"git\\@github.com:/ghc/packages-\".insteadOf git\\@github.com:/ghc/packages/" - else - cmd "git clone https://gitlab.haskell.org/ghc/ghc.git" - cmd "cd ghc && git fetch --tags" + system_ "git clone https://gitlab.haskell.org/ghc/ghc.git" + system_ "cd ghc && git fetch --tags" gitCheckout ghcFlavor + system_ "cd ghc && git checkout ." - -- Doing this avoids "Prelude.chr:bad argument" errors - -- (https://gitlab.haskell.org/ghc/ghc/-/issues/19452) testing - -- locally when later steps try to certain install older versions - -- of GHC which enables local testing with `stack runhaskell --stack-yaml stack.yaml --resolver nightly-2020-01-08 --package extra --package optparse-applicative CI.hs -- --da --stack-yaml stack.yaml --resolver nightly-2020-01-08`. - stack "exec -- bash -c \"rm -f $HOME/.stack/setup-exe-src/*\"" - - -- Feedback on the compiler used for ghc-lib-gen. - stack "exec -- ghc --version" - - -- Build ghc-lib-gen. Do this here rather than in the Azure script - -- so that it's not forgotten when testing this program locally. - stack "build --no-terminal --ghc-options \"-Wall -Wno-name-shadowing -Werror\"" - - -- Any invocations of GHC in the sdist steps that follow use the - -- hadrian/stack.yaml resolver (which can and we should expect - -- to be, different to our resolver). - - -- Calculate version and package names. version <- tag let pkg_ghclib = "ghc-lib-" ++ version pkg_ghclib_parser = "ghc-lib-parser-" ++ version + ghcFlavorArg = ghcFlavorOpt ghcFlavor - -- Make and extract an sdist of ghc-lib-parser. - cmd "cd ghc && git checkout ." - -- Make and extract an sdist of ghc-lib. The first argument is a - -- ghc repo dir relative to '.' ('root'), 'patches' needs to be - -- provided relative to 'root' (i.e. 'ghc') hence '../patches'. - stack $ "exec -- ghc-lib-gen ghc ../patches --ghc-lib-parser " ++ ghcFlavorOpt ghcFlavor ++ " " ++ cppOpts ghcFlavor ++ " " ++ stackResolverOpt resolver + cabal <- systemOutput_ "which cabal" + putStrLn $ "cabal: " ++ cabal + system_ "cabal update" + system_ "cabal build exe:ghc-lib-gen" + system_ $ "cabal run exe:ghc-lib-gen -- ghc ../patches --ghc-lib-parser " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor ++ " " ++ stackResolverOpt resolver patchVersion version "ghc/ghc-lib-parser.cabal" mkTarball pkg_ghclib_parser renameDirectory pkg_ghclib_parser "ghc-lib-parser" removeFile "ghc/ghc-lib-parser.cabal" - cmd "git checkout stack.yaml" - - -- Make and extract an sdist of ghc-lib. The first argument is a - -- ghc repo dir relative to '.' ('root'), 'patches' needs to be - -- provided relative to 'root' (i.e. 'ghc') hence '../patches'. - stack $ "exec -- ghc-lib-gen ghc ../patches --ghc-lib " ++ ghcFlavorOpt ghcFlavor ++ " " ++ cppOpts ghcFlavor ++ " " ++ stackResolverOpt resolver ++ " " ++ "--skip-init" + system_ $ "cabal run exe:ghc-lib-gen -- ghc ../patches --ghc-lib " ++ ghcFlavorArg ++ " " ++ cppOpts ghcFlavor ++ " " ++ stackResolverOpt resolver ++ " " ++ "--skip-init" patchVersion version "ghc/ghc-lib.cabal" patchConstraints version "ghc/ghc-lib.cabal" mkTarball pkg_ghclib renameDirectory pkg_ghclib "ghc-lib" removeFile "ghc/ghc-lib.cabal" - cmd "git checkout stack.yaml" copyDirectoryRecursive "ghc-lib-gen/ghc-lib-parser" @@ -445,115 +407,49 @@ buildDists verifyConstraint "ghc-lib-parser == " version "examples/ghc-lib-test-mini-compile/ghc-lib-test-mini-compile.cabal" verifyConstraint "ghc-lib == " version "examples/ghc-lib-test-mini-compile/ghc-lib-test-mini-compile.cabal" - cmd "cabal sdist -o ." - cmd "(cd examples/ghc-lib-test-utils && cabal sdist -o ../..)" - cmd "(cd examples/ghc-lib-test-mini-hlint && cabal sdist -o ../..)" - cmd "(cd examples/ghc-lib-test-mini-compile && cabal sdist -o ../..)" + system_ "cabal sdist -o ." + system_ "(cd examples/ghc-lib-test-utils && cabal sdist -o ../..)" + system_ "(cd examples/ghc-lib-test-mini-hlint && cabal sdist -o ../..)" + system_ "(cd examples/ghc-lib-test-mini-compile && cabal sdist -o ../..)" when noBuilds exitSuccess - -- Append the libraries and examples to the prevailing stack - -- configuration file. - stackYamlFileContents <- readFile' stackConfig - writeFile stackConfig $ - stackYamlFileContents ++ - unlines [ "- ghc-lib-parser" - , "- ghc-lib" - , "- examples/ghc-lib-test-utils" - , "- examples/ghc-lib-test-mini-hlint" - , "- examples/ghc-lib-test-mini-compile" - ] ++ - case ghcFlavor of -#if __GLASGOW_HASKELL__ == 804 && __GLASGOW_HASKELL_PATCHLEVEL1__ == 4 - GhcMaster _ -> - -- Resolver 'lts-12.26' serves 'transformers-0.5.5.0' which - -- lacks 'Control.Monad.Trans.RWS.CPS'. The need for that - -- module came in around around 09/20/2019. Putting this - -- here keeps the CI ghc-8.4.4 builds going (for 8.8.* - -- ghc-libs, there is no support for bootstrapping ghc-8.10 - -- builds with ghc-8.4.4; see azure-pipelines.yml for an - -- explanation) - unlines ["extra-deps: [transformers-0.5.6.2]"] -#endif - Da {} -> - unlines ["flags: {ghc-lib-test-mini-compile: {daml-unit-ids: true}}"] - _ -> "" - - -- All invocations of GHC from here on are using our resolver. - - -- Feedback on what compiler has been selected for building - -- ghc-lib packages and tests. - stack "ghc -- --version" - - -- Separate the two library build commands so they are - -- independently timed. Note that optimizations in these builds - -- are disabled in stack.yaml via `ghc-options: -O0`. - -- `-haddock` makes the parser stricter about Haddock comments (see - -- https://gitlab.haskell.org/ghc/ghc/-/commit/c35c545d3f32f092c52052349f741739a844ec0f). - -- TODO: https://github.com/digital-asset/ghc/issues/97 - let ghcOpts = case ghcFlavor of Da {} -> ghcOptionsOpt ghcOptions; _ -> ghcOptionsWithHaddock ghcOptions - stack $ "--no-terminal --interleaved-output build " ++ ghcOpts ++ " ghc-lib-parser" - stack $ "--no-terminal --interleaved-output build " ++ ghcOptionsOpt ghcOptions ++ " ghc-lib" - stack $ "--no-terminal --interleaved-output build " ++ ghcOptionsOpt ghcOptions ++ " ghc-lib-test-mini-hlint ghc-lib-test-mini-compile" - - miniHlintCmdFile <- writeCmdFile "ghc-lib-test-mini-hlint" stackConfig resolver - stack $ "test ghc-lib-test-mini-hlint --no-terminal " ++ testArguments miniHlintCmdFile stackConfig resolver ghcFlavor - - miniCompileCmdFile <- writeCmdFile "ghc-lib-test-mini-compile" stackConfig resolver - stack $ "test ghc-lib-test-mini-compile --no-terminal " ++ testArguments miniCompileCmdFile stackConfig resolver ghcFlavor - -#if __GLASGOW_HASKELL__ == 808 && \ - (__GLASGOW_HASKELL_PATCHLEVEL1__ == 1 || __GLASGOW_HASKELL_PATCHLEVEL1__ == 2) && \ - defined (mingw32_HOST_OS) - -- Skip these tests on ghc-8.8.1 and ghc-8.8.2. See - -- https://gitlab.haskell.org/ghc/ghc/issues/17599. -#else - -- Missing `SymI_HasProto(setKeepCAFs)` in 'rts/RtsSymbols.c' - -- prevents loading in GHCi on Windows (see - -- https://gitlab.haskell.org/ghc/ghc/-/issues/22961). I don't - -- know why it so far only exhibits with 9.2.6. Seems to me it - -- should be a problem with >= ghc-9.6.1 too (but, "if it ain't - -- broke don't fix it"). - unless (ghcFlavor `elem` [Ghc926, Ghc927, Ghc928] && System.Info.Extra.isWindows) $ do - -- Test everything loads in GHCi, see - -- https://github.com/digital-asset/ghc-lib/issues/27 - stack "--no-terminal ghc -- -ignore-dot-ghci -package=ghc-lib-parser -e \"print 1\"" - stack "--no-terminal ghc -- -ignore-dot-ghci -package=ghc-lib -e \"print 1\"" -#endif + writeFile "cabal.project" ( + unlines $ + [ "packages: " + , " ghc-lib-parser/ghc-lib-parser.cabal" + , " ghc-lib/ghc-lib.cabal" + , " examples/ghc-lib-test-utils/ghc-lib-test-utils.cabal" + , " examples/ghc-lib-test-mini-hlint/ghc-lib-test-mini-hlint.cabal" + , " examples/ghc-lib-test-mini-compile/ghc-lib-test-mini-compile.cabal" + ] ++ + [ "constraints: ghc-lib-test-mini-compile +daml-unit-ids" | Da {} <- [ghcFlavor] ] + ) + miniHlintCmdFile <- writeCabalCmdFile "ghc-lib-test-mini-hlint" + miniCompileCmdFile <- writeCabalCmdFile "ghc-lib-test-mini-compile" + + cmd "cabal build --ghc-options=-j all" + + system_ $ "cd examples/ghc-lib-test-mini-hlint && cabal test --project-dir ../.. --test-show-details direct --test-options \"--color always --test-command ../../ghc-lib-test-mini-hlint " ++ ghcFlavorArg ++ "\"" + system_ $ "cd examples/ghc-lib-test-mini-compile && cabal test --project-dir ../.. --test-show-details direct --test-options \"--color always --test-command ../../ghc-lib-test-mini-compile " ++ ghcFlavorArg ++ "\"" + system_ "cabal exec -- ghc -ignore-dot-ghci -package=ghc-lib-parser -e \"print 1\"" + system_ "cabal exec -- ghc -ignore-dot-ghci -package=ghc-lib -e \"print 1\"" -- Something like, "8.8.1.20190828". tag -- The return value of type 'IO string'. where - writeCmdFile :: String -> FilePath -> Maybe String -> IO FilePath - writeCmdFile exe stackConfig resolver = do + writeCabalCmdFile :: String -> IO FilePath + writeCabalCmdFile exe = do let filename = exe - let cmd = "stack --silent " ++ stackYamlOpt (Just $ "../.." stackConfig) ++ " " ++ stackResolverOpt resolver ++ " " ++ "exec -- " ++ exe ++ " " - writeFile filename cmd + cmd = "cabal run exe:" ++ exe ++ " --project-dir ../.. -- " + writeFile filename cmd pure filename - testArguments :: FilePath -> FilePath -> Maybe String -> GhcFlavor -> String - testArguments cmdFile stackConfig resolver ghcFlavor = - "--test-arguments " ++ - "\"" ++ - "--test-command " ++ "../../" cmdFile ++ " " ++ - stackYamlOpt (Just $ "../.." stackConfig) ++ " " ++ - stackResolverOpt resolver ++ " " ++ ghcFlavorOpt ghcFlavor ++ " " ++ - "\"" - ghcOptionsWithHaddock :: Maybe String -> String - -- Enabling strict haddock mode with -haddock (and for some - -- build compilers -Winvalid-haddock) has become too tedious. - -- See 20935, 20924 and now 21269. The good news is that MR# - -- 7762 means this shouldn't be an issue anymore going forward. ghcOptionsWithHaddock = ghcOptionsOpt - -- Mitigate against macOS/ghc-9.2.2 failures for lack of this - -- c-include path. See - -- https://gitlab.haskell.org/ghc/ghc/-/issues/20592#note_391266. - -- There are reports that this exhibits with 9.0.2 and 9.2.1 as - -- well but I haven't observed that. prelude :: (String, String) -> String #if __GLASGOW_HASKELL__ == 902 && __GLASGOW_HASKELL_PATCHLEVEL1__ == 2 prelude ("darwin", _) = "C_INCLUDE_PATH=`xcrun --show-sdk-path`/usr/include/ffi" @@ -580,9 +476,8 @@ buildDists mkTarball :: String -> IO () mkTarball target = do - writeFile "stack.yaml" . (++ "- ghc\n") =<< readFile' "stack.yaml" - stack "sdist ghc --tar-dir=." - cmd $ "tar -xvf " ++ target ++ ".tar.gz" + system_ "(cd ghc && cabal sdist -o ..)" + system_ $ "tar -xvf " ++ target ++ ".tar.gz" tag :: IO String tag = do @@ -629,14 +524,14 @@ buildDists gitCheckout :: GhcFlavor -> IO () gitCheckout ghcFlavor = do - cmd $ "cd ghc && git checkout -f " <> branch ghcFlavor + system_ $ "cd ghc && git checkout -f " <> branch ghcFlavor case ghcFlavor of Da DaFlavor { patches, upstream } -> do - cmd $ "cd ghc && git remote add upstream " <> upstream - cmd "cd ghc && git fetch upstream" - cmd $ "cd ghc && git -c user.name=\"Cookie Monster\" -c user.email=cookie.monster@seasame-street.com merge --no-edit " <> unwords patches + system_ $ "cd ghc && git remote add upstream " <> upstream + system_ "cd ghc && git fetch upstream" + system_ $ "cd ghc && git -c user.name=\"Cookie Monster\" -c user.email=cookie.monster@seasame-street.com merge --no-edit " <> unwords patches _ -> pure () - cmd "cd ghc && git submodule update --init --recursive" + system_ "cd ghc && git submodule update --init --recursive" branch :: GhcFlavor -> String branch = \case diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 66b83fca..68a884c2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -50,21 +50,18 @@ strategy: linux-ghc-master-9.6.5: image: "ubuntu-22.04" mode: "--ghc-flavor ghc-master" - resolver: "ghc-9.6.5" cabal-with-ghc: "9.6.5" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0 semaphore-compat-1.0.0" mac-ghc-master-9.6.5: image: "macOS-latest" mode: "--ghc-flavor ghc-master" - resolver: "ghc-9.6.5" cabal-with-ghc: "9.6.5" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0 semaphore-compat-1.0.0" windows-ghc-master-9.6.5: image: "windows-latest" mode: "--ghc-flavor ghc-master" - resolver: "ghc-9.6.5" cabal-with-ghc: "9.6.5" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0 semaphore-compat-1.0.0" # +---------+-----------------+------------+ # | OS | ghc-lib flavor | GHC | @@ -76,21 +73,18 @@ strategy: linux-ghc-master-9.8.2: image: "ubuntu-22.04" mode: "--ghc-flavor ghc-master" - resolver: "ghc-9.8.2" cabal-with-ghc: "9.8.2" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0" mac-ghc-master-9.8.2: image: "macOS-latest" mode: "--ghc-flavor ghc-master" - resolver: "ghc-9.8.2" cabal-with-ghc: "9.8.2" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0" windows-ghc-master-9.8.2: image: "windows-latest" mode: "--ghc-flavor ghc-master" - resolver: "ghc-9.8.2" cabal-with-ghc: "9.8.2" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0" # +---------+-----------------+------------+ # | OS | ghc-lib flavor | GHC | @@ -102,47 +96,41 @@ strategy: linux-ghc-9.10.1-9.8.2: image: "ubuntu-22.04" mode: "--ghc-flavor ghc-9.10.1" - resolver: "ghc-9.8.2" cabal-with-ghc: "9.8.2" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0" mac-ghc-9.10.1-9.8.2: image: "macOS-latest" mode: "--ghc-flavor ghc-9.10.1" - resolver: "ghc-9.8.2" cabal-with-ghc: "9.8.2" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0" windows-ghc-9.10.1-9.8.2: image: "windows-latest" mode: "--ghc-flavor ghc-9.10.1" - resolver: "ghc-9.8.2" cabal-with-ghc: "9.8.2" - stack-yaml: "stack-exact.yaml" + runghc-libs: "extra-1.7.16 optparse-applicative-0.18.1.0" # +---------+-----------------+------------+ # | OS | ghc-lib flavor | GHC | # +=========+=================+============+ - # | linux | da-ghc-8.8.1 | ghc-8.8.1 | - # | windows | da-ghc-8.8.1 | ghc-8.8.1 | - # | macOS | da-ghc-8.8.1 | ghc-8.8.1 | + # | linux | da-ghc-8.4.3 | ghc-8.4.3 | + # | windows | da-ghc-8.4.3 | ghc-8.4.3 | + # | macOS | da-ghc-8.4.3 | ghc-8.4.3 | # +---------+-----------------+------------+ - linux-da-ghc-8.8.1-8.8.1: + linux-da-ghc-8.4.3-8.4.3: image: "ubuntu-22.04" mode: "--da" - resolver: "nightly-2020-01-08" - cabal-with-ghc: "8.8.1" - stack-yaml: "stack.yaml" - windows-da-ghc-8.8.1-8.8.1: + cabal-with-ghc: "8.4.3" + runghc-libs: "extra-1.6.13 optparse-applicative-0.14.3.0" + windows-da-ghc-8.4.3-8.4.3: image: "windows-latest" mode: "--da" - resolver: "nightly-2020-01-08" - cabal-with-ghc: "8.8.1" - stack-yaml: "stack.yaml" - mac-da-ghc-8.8.1-8.8.1: + cabal-with-ghc: "8.4.3" + runghc-libs: "extra-1.6.13 optparse-applicative-0.14.3.0" + mac-da-ghc-8.4.3-8.4.3: image: "macOS-latest" mode: "--da" - resolver: "nightly-2020-01-08" - cabal-with-ghc: "8.8.1" - stack-yaml: "stack.yaml" + cabal-with-ghc: "8.4.3" + runghc-libs: "extra-1.6.13 optparse-applicative-0.14.3.0" pool: {vmImage: '$(image)'} @@ -160,8 +148,17 @@ steps: condition: eq( variables['Agent.OS'], 'Darwin' ) displayName: Install brew - bash: | - curl -sSL https://get.haskellstack.org/ | sh -s - -f - displayName: install Stack + curl -L https://github.com/commercialhaskell/stackage-content/releases/download/msys2-20230526/msys2-20230526-x86_64.tar.xz -o msys2-20230526-x86_64.tar.xz + tar xvf msys2-20230526-x86_64.tar.xz > /dev/null + GHCUP_MSYS2=$(pwd)/msys64 + PATH="$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + $GHCUP_MSYS2/usr/bin/bash --noprofile --norc -e -o pipefail -c "pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm" + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + displayName: install msys2 + - bash: | + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=$(cabal-with-ghc) BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=N sh + displayName: install ghcup - bash: | set -euo pipefail @@ -189,9 +186,29 @@ steps: displayName: run hlint condition: eq( variables['Agent.OS'], 'Linux' ) - bash: | - GHCLIB_AZURE=1;export GHCLIB_AZURE - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=$(cabal-with-ghc) BOOTSTRAP_HASKELL_CABAL_VERSION=latest BOOTSTRAP_HASKELL_INSTALL_STACK=0 BOOTSTRAP_HASKELL_INSTALL_HLS=0 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh - PATH="$HOME"/.ghcup/ghc/$(cabal-with-ghc)/bin:"$PATH"; export PATH - PATH="$HOME"/.cabal/bin:"$PATH"; export PATH - stack runhaskell --stack-yaml $(stack-yaml) --resolver $(resolver) --package extra --package optparse-applicative -- CI.hs $(mode) --stack-yaml $(stack-yaml) --resolver $(resolver) - displayName: build + PATH=/c/cabal/bin:/c/.ghcup/ghc-$(cabal-with-ghc)/bin:/c/.ghcup/bin:$PATH + export PATH + cabal install alex happy + cabal --store-dir="c:\\cabal\\store" --lib --force-reinstalls --package-env=- install $(runghc-libs) + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + displayName: setup cabal (windows) + - bash: | + PATH=$HOME/.cabal/bin:$HOME/.ghcup/ghc/9.6.5/bin:$HOME/.ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + cabal install alex happy + cabal --store-dir=$HOME/.cabal/store --lib --force-reinstalls --package-env=- install $(runghc-libs) + condition: or(eq(variables['Agent.OS'], 'Darwin'), eq(variables['Agent.OS'], 'Linux')) + displayName: setup cabal (unix) + - bash: | + GHCUP_MSYS2=$(pwd)/msys64; + PATH=/c/cabal/bin:/c/ghcup/ghc/$(cabal-with-ghc)/bin:/c/ghcup/bin:"$GHCUP_MSYS2"/usr/bin:/c/mingw64/bin:"/c/program files/git/bin":"$PATH" + export PATH + $GHCUP_MSYS2/usr/bin/bash --noprofile --norc -e -o pipefail -c "runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=/c/cabal/store/$(ls /c/cabal/store)/package.db CI.hs --ghc-flavor $(mode)" + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + displayName: run CI.hs (windows) + - bash: | + PATH="$HOME/.cabal/bin":"$HOME/.ghcup/ghc/$(cabal-with-ghc)/bin":"$HOME/.ghcup/bin":"$PATH" + export PATH + runghc --ghc-arg=-clear-package-db --ghc-arg=-global-package-db --ghc-arg=-user-package-db --ghc-arg=-package-db --ghc-arg=$HOME/.cabal/store/$(ls $HOME/.cabal/store)/package.db CI.hs $(mode) + condition: or(eq(variables['Agent.OS'], 'Darwin'), eq(variables['Agent.OS'], 'Linux')) + displayName: run CI.hs (unix) diff --git a/ghc-lib-gen/src/Ghclibgen.hs b/ghc-lib-gen/src/Ghclibgen.hs index 39551fcd..771e7037 100644 --- a/ghc-lib-gen/src/Ghclibgen.hs +++ b/ghc-lib-gen/src/Ghclibgen.hs @@ -291,12 +291,12 @@ ghcNumericVersion = do cabalPackageDb :: String -> IO String cabalPackageDb ghcNumericVersion = do let ghcVersion = "ghc-" ++ ghcNumericVersion - home <- systemOutput_ "bash -c \"echo -n $HOME\"" - let cabalPackageDb = - if isWindows then - "/c/cabal/store" ghcVersion "package.db" - else - home ".cabal/store" ghcVersion "package.db" + cabalPackageDb <- + if isWindows then + systemOutput_ "bash -c \"echo -n /c/cabal/store/$(ls /c/cabal/store | grep $(ghc --numeric-version))/package.db\"" + else + systemOutput_ "bash -c \"echo -n $HOME/.cabal/store/$(ls $HOME/.cabal/store | grep $(ghc --numeric-version))/package.db\"" + putStrLn $ "cabal package-db: " ++ cabalPackageDb pure cabalPackageDb ghcPackagePath :: String -> String -> IO String @@ -336,11 +336,12 @@ setupModuleDepsPlaceholders _ = do copyFile file new_p setupModuleDepsExtraDeps :: GhcFlavor -> IO () -setupModuleDepsExtraDeps ghcFlavor = do - let s = ghcSeries ghcFlavor - semaphoreCompatBootExists >>= \exists -> - when (not exists && s >= GHC_9_8) $ - system_ "bash -c \"unset GHC_PACKAGE_PATH && cabal install --lib semaphore-compat --force-reinstalls -v3\"" +setupModuleDepsExtraDeps _ghcFlavor = do + -- let s = ghcSeries ghcFlavor + -- semaphoreCompatBootExists >>= \exists -> + -- when (not exists && s >= GHC_9_8) $ do + -- system_ "bash -c \"set -x && echo \"HOME = $HOME\" && echo $(which cabal) && cabal install --lib semaphore-compat --force-reinstalls --package-env - -v3\"" + system_ "bash -c \"set -x && echo $(which bash)\" && echo $HOME" calcModuleDeps :: [FilePath] -> [FilePath] -> [FilePath] -> GhcFlavor -> String -> Bool -> String -> String calcModuleDeps includeDirs _hsSrcDirs hsSrcIncludes ghcFlavor ghcPackagePath semaphoreCompatBootExists ghcMakeModeOutputFile = do @@ -1074,11 +1075,8 @@ applyPatchCmmParseNoImplicitPrelude _ = do applyPatchHadrianCabalProject :: GhcFlavor -> IO () applyPatchHadrianCabalProject ghcFlavor = do cabalProjectContents <- lines' <$> readFile' cabalProject - writeFile cabalProject $ unlines ( - cabalProjectContents ++ - ["flags:-selftest -with-bazel"] ++ - ["allow-newer:Cabal,QuickCheck" | ghcApi < GHC_9_0] - ) + cabalProjectContents <- pure (unlines (cabalProjectContents ++ [ "flags:-selftest -with_bazel" ])) + writeFile cabalProject cabalProjectContents whenM (doesPathExist cabalProjectFreeze) $ removePathForcibly cabalProjectFreeze where lines' s = [ l | l <- lines s , not $ "index-state" `isPrefixOf` l ] @@ -1362,7 +1360,8 @@ generateGhcLibCabal ghcFlavor customCppOpts = do [ " exposed: False" , " include-dirs:" ] ++ indent2 includeDirs ++ - [ " ghc-options: -fno-safe-haskell" ] ++ + [ " if impl(ghc >= 8.8.1)" + , " ghc-options: -fno-safe-haskell" ] ++ [ " if flag(threaded-rts)" , " ghc-options: -fobject-code -package=ghc-boot-th -optc-DTHREADED_RTS" , " cc-options: -DTHREADED_RTS" @@ -1461,7 +1460,8 @@ generateGhcLibParserCabal ghcFlavor customCppOpts = do [ " exposed: False" , " include-dirs:" ] ++ indent2 includeDirs ++ - [ " ghc-options: -fno-safe-haskell" ] ++ + [ " if impl(ghc >= 8.8.1)" + , " ghc-options: -fno-safe-haskell" ] ++ [ " if flag(threaded-rts)" , " ghc-options: -fobject-code -package=ghc-boot-th -optc-DTHREADED_RTS" , " cc-options: -DTHREADED_RTS" @@ -1513,21 +1513,18 @@ generatePrerequisites ghcFlavor = do =<< readFile' "./mk/get-win32-tarballs.sh" ) - system_ "bash -c \"unset GHC_PACKAGE_PATH && cabal update\"" - system_ "bash -c \"unset GHC_PACKAGE_PATH && cabal install alex happy --overwrite-policy=always\"" system_ "bash -c ./boot" system_ "bash -c \"./configure --enable-tarballs-autodownload\"" withCurrentDirectory "hadrian" $ do - system_ "bash -c \"unset GHC_PACKAGE_PATH && cabal build exe:hadrian --ghc-option=-j\"" + system_ "cabal build exe:hadrian --ghc-options=-j" system_ $ unwords $ [ - "bash -c \"unset GHC_PACKAGE_PATH && cabal run exe:hadrian --" + "cabal run exe:hadrian --" , "--directory=.." , "--build-root=ghc-lib" ] ++ [ "--bignum=native" | ghcSeries ghcFlavor >= GHC_9_0 ] ++ [ "--integer-simple" | ghcSeries ghcFlavor < GHC_9_0 ] ++ - ghcLibParserExtraFiles ghcFlavor ++ map (dataDir ) (dataFiles ghcFlavor) ++ - ["\""] + ghcLibParserExtraFiles ghcFlavor ++ map (dataDir ) (dataFiles ghcFlavor) -- Given an Hsc, Alex, or Happy file, generate a placeholder module -- with the same module imports.