From 705398ed88bd2d22f5102b49e7c8554760e5b708 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 15:07:21 +0800 Subject: [PATCH 01/34] Avoid templating GitHub Actions workflow GitHub Actions workflow have sufficient power to express what we need. We don't need to maintain and additional templating solution on top. --- .github/workflows/bootstrap.yml | 43 +- .github/workflows/linux.yml | 558 +++++----------------- .github/workflows/macos.yml | 110 ++--- .github/workflows/quick-jobs.yml | 7 +- .github/workflows/windows.yml | 122 +---- Makefile | 10 - cabal-dev-scripts/cabal-dev-scripts.cabal | 11 - cabal-dev-scripts/src/GenValidate.hs | 159 ------ templates/ci-bootstrap.template.yml | 58 --- templates/ci-linux.template.yml | 73 --- templates/ci-macos.template.yml | 65 --- templates/ci-quick-jobs.template.yml | 86 ---- templates/ci-windows.template.yml | 125 ----- 13 files changed, 170 insertions(+), 1257 deletions(-) delete mode 100644 cabal-dev-scripts/src/GenValidate.hs delete mode 100644 templates/ci-bootstrap.template.yml delete mode 100644 templates/ci-linux.template.yml delete mode 100644 templates/ci-macos.template.yml delete mode 100644 templates/ci-quick-jobs.template.yml delete mode 100644 templates/ci-windows.template.yml diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 425c38dd208..37456b0fa9b 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -1,10 +1,5 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# name: Bootstrap + on: push: branches: @@ -15,37 +10,21 @@ on: - created jobs: - bootstrap-linux: - name: Bootstrap on Linux - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: bootstrap.py - run: | - ghcup config set cache true - ghcup install ghc 8.10.7 - python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc 8.10.7) -d bootstrap/linux-8.10.7.json - - - name: Smoke test - run: | - _build/bin/cabal --version - - - uses: actions/upload-artifact@v2 - with: - name: cabal-linux-bootstrapped - path: _build/artifacts/* - - bootstrap-macos: - name: Bootstrap on macOS - runs-on: macos-latest + bootstrap: + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + name: Bootstrap ${{ matrix.os }} + runs-on: $${ matrix.os }} steps: - uses: actions/checkout@v2 - - # We use linux dependencies - name: bootstrap.py run: | ghcup config set cache true ghcup install ghc 8.10.7 + # We use linux dependencies also on macos python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc 8.10.7) -d bootstrap/linux-8.10.7.json - name: Smoke test @@ -54,5 +33,5 @@ jobs: - uses: actions/upload-artifact@v2 with: - name: cabal-macos-bootstrapped + name: cabal-${{ matrix.os }}-bootstrapped path: _build/artifacts/* diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fc6aaab4337..30030cbef49 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,10 +1,5 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# name: Linux + on: push: branches: @@ -15,211 +10,35 @@ on: - created jobs: - validate-9_0_1: - name: validate.sh ghc-9.0.1 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:9.0.1-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s lib-suite - validate-8_10_4: - name: validate.sh ghc-8.10.4 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:8.10.4-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: apt-get update - run: apt-get update - - name: Install `nroff` for `cabal man` - run: apt-get install -y groff-base - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s lib-suite - - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s cli-tests - - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s cli-suite - validate-8_8_4: - name: validate.sh ghc-8.8.4 - runs-on: ubuntu-18.04 - container: - image: phadej/ghc:8.8.4-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: apt-get update - run: apt-get update - - name: Install `nroff` for `cabal man` - run: apt-get install -y groff-base - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s lib-suite - - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s cli-tests - - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --solver-benchmarks -s cli-suite - validate-8_6_5: - name: validate.sh ghc-8.6.5 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:8.6.5-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: apt-get update - run: apt-get update - - name: Install `nroff` for `cabal man` - run: apt-get install -y groff-base - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s lib-suite - - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s cli-tests - - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.6.5 -v --complete-hackage-tests -s cli-suite - validate-8_4_4: - name: validate.sh ghc-8.4.4 + validate: + strategy: + matrix: + ghc: + - "9.0.1" + - "8.10.4" + - "8.8.4" + - "8.6.5" + - "8.4.4" + - "8.2.2" + - "8.0.2" + - "7.10.3" + - "7.8.4" + + name: validate ${{ matrix.ghc }} runs-on: ubuntu-18.04 - needs: validate-8_8_4 + container: - image: phadej/ghc:8.4.4-bionic + image: phadej/ghc:${{ matrix.ghc }}-bionic + steps: - name: System info run: | uname -a + - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH + - name: Install cabal-plan run: | mkdir -p $HOME/.cabal/bin @@ -228,12 +47,11 @@ jobs: xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan - - name: apt-get update - run: apt-get update - - name: Install `nroff` for `cabal man` - run: apt-get install -y groff-base + - name: Update Hackage index run: cabal v2-update + + # TODO revisit this # https://github.com/actions/checkout/issues/170 # - uses: actions/checkout@v2 - name: Checkout @@ -242,256 +60,76 @@ jobs: git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . git fetch origin $GITHUB_SHA:temporary-ci-branch git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s lib-suite - - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s cli-tests - - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.4.4 -v -s cli-suite - validate-8_2_2: - name: validate.sh ghc-8.2.2 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:8.2.2-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: apt-get update - run: apt-get update + + - name: Set flag --lib-only + if: contains(matrix.ghc, ["9.0.1", "8.0.2", "7.10.3", "7.8.4", "7.6.3"]) + run: echo "flags=--lib-only" >> $github_env + + - name: Set flag --solver-benchmark + if: matrix.ghc == "8.8.4" + run: echo "flags=--solver-benchmark" >> $github_env + + - name: Set flag --complete-hackage-tests + if: matrix.ghc == "8.6.5" + run: echo "flags=--complete-hackage-tests" >> $github_env + - name: Install `nroff` for `cabal man` - run: apt-get install -y groff-base - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout + if: contains(matrix.ghc, ["8.8.4", "8.6.5"]) run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) + apt-get update + apt-get install -y groff-base + - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s print-config + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-config + - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-tool-versions + - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s build + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s build + - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s lib-tests + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-tests + - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s lib-suite + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite + - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s cli-tests + if: contains(matrix.ghc, ["8.10.4", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-tests + - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.2.2 -v -s cli-suite - validate-8_0_2: - name: validate.sh ghc-8.0.2 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:8.0.2-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.0.2 -v --lib-only -s lib-suite - validate-7_10_3: - name: validate.sh ghc-7.10.3 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:7.10.3-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-7.10.3 -v --lib-only -s lib-suite - validate-7_8_4: - name: validate.sh ghc-7.8.4 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:7.8.4-bionic - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-7.8.4 -v --lib-only -s lib-suite - validate-7_6_3: - name: validate.sh ghc-7.6.3 - runs-on: ubuntu-18.04 - needs: validate-8_8_4 - container: - image: phadej/ghc:7.6.3-xenial - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: apt-get update - run: apt-get update - - name: Install dynamic libraries - run: apt-get install -y ghc-7.6.3-dyn - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-7.6.3 -v --lib-only -s lib-suite - validate-8_8_4-old: - name: validate.sh old GHCs + if: contains(matrix.ghc, ["8.10.4", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-suite + + validate_old: + strategy: + matrix: + include: + - ghc: "7.6.3" + old: false + image_tag: xenial + extra_steps: false + - ghc: "8.8.4" + old: true + image_tag: xenial + extra_steps: true + + name: Validate old GHCs ${{ matrix.ghc }} runs-on: ubuntu-18.04 - needs: validate-8_8_4 + container: - image: phadej/ghc:8.8.4-xenial + image: phadej/ghc:${{ matrix.ghc }}-${{ matrix.image_tag }} + steps: - name: System info run: | uname -a + - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH + - name: Install cabal-plan run: | mkdir -p $HOME/.cabal/bin @@ -500,14 +138,23 @@ jobs: xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan + - name: apt-get update + if: matrix.old == true run: apt-get update + - name: Install dynamic libraries - run: apt-get install -y ghc-8.8.4-dyn + if: matrix.image_tag == "xenial" + run: apt-get install -y ghc-${{ matrix.ghc }}-dyn + - name: Install extra compilers + if: matrix.old == true run: apt-get install -y ghc-7.0.4-dyn ghc-7.2.2-dyn ghc-7.4.2-dyn + - name: Update Hackage index run: cabal v2-update + + # TODO revisit this # https://github.com/actions/checkout/issues/170 # - uses: actions/checkout@v2 - name: Checkout @@ -516,19 +163,30 @@ jobs: git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . git fetch origin $GITHUB_SHA:temporary-ci-branch git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) + - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s print-config + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-config + - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-tool-versions + - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s build + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s build + - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-tests + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-tests + - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite - - name: Validate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 - - name: Validate lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2 - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2 - - name: Validate lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2 - run: sh validate.sh -j 2 -w ghc-8.8.4 -v --lib-only -s lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2 + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite + + - name: Valudate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 + if: matrix.extra_steps + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 + + - name: Valudate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.2.2 + if: matrix.extra_steps + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2 + + - name: Valudate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.4.2 + if: matrix.extra_steps + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 19059f4e3ba..29cc3468f9f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,10 +1,5 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# name: MacOS + on: push: branches: @@ -15,77 +10,33 @@ on: - created jobs: - validate-macos-8_8_4: - name: validate.sh macos ghc-8.8.4 + validate: + name: validate ghc-${{ matrix.ghc }} runs-on: macos-latest + strategy: + matrix: + ghc: + - "8.8.4" + - "8.8.5" + steps: - name: System info run: | uname -a + - name: Install Autotools run: | brew install automake - - name: Install GHC - run: | - cd $(mktemp -d) - curl -sLO https://downloads.haskell.org/~ghc/8.8.4/ghc-8.8.4-x86_64-apple-darwin.tar.xz - tar -xJf ghc-*.tar.xz - cd ghc-* - ./configure --prefix=/opt/ghc/8.8.4 - sudo make install - - name: Install Cabal - run: | - cd $(mktemp -d) - curl -sLO http://oleg.fi/cabal-install-3.4.0.0-rc1/cabal-install-3.4.0.0-x86_64-darwin-sierra.tar.xz - tar -xJf cabal-install-*.tar.xz - sudo mkdir -p /opt/cabal/3.4/bin - sudo cp cabal /opt/cabal/3.4/bin/cabal - sudo chmod 755 /opt/cabal/3.4/bin/cabal - - name: Set PATH - run: | - echo "/opt/ghc/8.8.4/bin" >> $GITHUB_PATH - echo "/opt/cabal/3.4/bin" >> $GITHUB_PATH - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Update Hackage index - run: cabal v2-update - - name: Install cabal-plan - run: | - cd $(mktemp -d) - cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' - - uses: actions/checkout@v2 - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s print-tool-versions - - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s build - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s lib-tests - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s lib-suite - - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s cli-tests - - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.8.4 -v -s cli-suite - validate-macos-8_6_5: - name: validate.sh macos ghc-8.6.5 - runs-on: macos-latest - needs: validate-macos-8_8_4 - steps: - - name: System info - run: | - uname -a - - name: Install Autotools - run: | - brew install automake - - name: Install GHC + + - name: Install GHC ${{ matrix.ghc }} run: | cd $(mktemp -d) - curl -sLO https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz + curl -sLO https://downloads.haskell.org/~ghc/${{ matrix.ghc }}/ghc-${{ matrix.ghc }}-x86_64-apple-darwin.tar.xz tar -xJf ghc-*.tar.xz cd ghc-* - ./configure --prefix=/opt/ghc/8.6.5 + ./configure --prefix=/opt/ghc/{{job.version}} sudo make install + - name: Install Cabal run: | cd $(mktemp -d) @@ -94,29 +45,42 @@ jobs: sudo mkdir -p /opt/cabal/3.4/bin sudo cp cabal /opt/cabal/3.4/bin/cabal sudo chmod 755 /opt/cabal/3.4/bin/cabal + - name: Set PATH run: | - echo "/opt/ghc/8.6.5/bin" >> $GITHUB_PATH + echo "/opt/ghc/${{ matrix.ghc }}/bin" >> $GITHUB_PATH echo "/opt/cabal/3.4/bin" >> $GITHUB_PATH echo "$HOME/.cabal/bin" >> $GITHUB_PATH + - name: Update Hackage index run: cabal v2-update + - name: Install cabal-plan run: | cd $(mktemp -d) + # aeson +fast, so we don't wait for -O2 cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' + - uses: actions/checkout@v2 + - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s print-config - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-config + + - name: Validate print-tool-version + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-tool-version + - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s build + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s build + - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s lib-tests + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s lib-tests + - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s lib-suite + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s lib-suite + - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s cli-tests + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s cli-tests + - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.6.5 -v -s cli-suite + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s cli-suite + diff --git a/.github/workflows/quick-jobs.yml b/.github/workflows/quick-jobs.yml index 34138dc3305..0573692ce89 100644 --- a/.github/workflows/quick-jobs.yml +++ b/.github/workflows/quick-jobs.yml @@ -1,10 +1,5 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# name: Quick jobs + on: push: branches: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7da5e44f662..dae40f689b2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,10 +1,5 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# name: Windows + on: push: branches: @@ -15,14 +10,19 @@ on: - created jobs: + test-windows: + strategy: + matrix: + ghc: + - "8.6.5" + - "8.10.4" - test-windows-8_6_5: - name: test ghc-8.6.5 + name: test ghc-${{ matrix.ghc }} runs-on: windows-latest steps: - uses: actions/setup-haskell@v1.1.4 with: - ghc-version: '8.6.5' + ghc-version: ${{ matrix.ghc }} cabal-version: '3.4.0.0' - name: Print versions run: | @@ -68,110 +68,14 @@ jobs: # Using only one job, -j1, to fail less. run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe -#TODO: store the exe from above as artifact and re-use it here instead of building anew - test-windows-8_6_5-dogfood: - name: test ghc-8.6.5 dogfood - runs-on: windows-latest - steps: - - uses: actions/setup-haskell@v1.1.4 - with: - ghc-version: '8.6.5' - cabal-version: '3.4.0.0' - - name: Print versions - run: | - [Environment]::GetEnvironmentVariable("Path") - cabal --version - ghc --version - cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3 - - uses: actions/cache@v1 - with: - path: C:\SR - key: windows-store-meta - - name: Update Hackage index - run: cabal v2-update - - uses: actions/checkout@v2 - # all dependencies of Cabal already there (due to GHC depending on Cabal) - - name: cabal v2-build Cabal - run: cabal v2-build Cabal - # We cannot ask for all dependencies, but we can for cabal-install. - - name: cabal v2-build cabal-install --only-dependencies - run: cabal v2-build cabal-install --only-dependencies - - name: cabal v2-build - run: cabal v2-build all - - name: wipe out cabal store - run: Remove-Item -Recurse -Force C:\SR - - name: eat its own dogfood by building own Cabal source with itself - run: | - cp $(cabal list-bin exe:cabal) ./cabal-exe-current - ./cabal-exe-current --version - ./cabal-exe-current v2-build Cabal - shell: bash - - name: eat its own dogfood by building all deps with itself - run: ./cabal-exe-current v2-build cabal-install --only-dependencies - shell: bash - - name: eat its own dogfood by building own source with itself - run: ./cabal-exe-current v2-build all - shell: bash - test-windows-8_10_4: - name: test ghc-8.10.4 - runs-on: windows-latest - steps: - - uses: actions/setup-haskell@v1.1.4 - with: - ghc-version: '8.10.4' - cabal-version: '3.4.0.0' - - name: Print versions - run: | - [Environment]::GetEnvironmentVariable("Path") - cabal --version - ghc --version - cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3 - - uses: actions/cache@v1 - with: - path: C:\SR - key: windows-store-meta - - name: Update Hackage index - run: cabal v2-update - - uses: actions/checkout@v2 - # all dependencies of Cabal already there (due to GHC depending on Cabal) - - name: cabal v2-build Cabal - run: cabal v2-build Cabal - # We cannot ask for all dependencies, but we can for cabal-install. - - name: cabal v2-build cabal-install --only-dependencies - run: cabal v2-build cabal-install --only-dependencies - - name: cabal v2-build - run: cabal v2-build all - - name: Cabal unit-tests - run: | - cabal v2-test Cabal-tests - - name: cabal-install memory-usage-tests - run: | - cd cabal-install - cabal v2-run cabal-install:memory-usage-tests - - name: cabal-install long-tests - run: | - cd cabal-install - cabal v2-run cabal-install:long-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)" - - name: cabal-install integration-tests2 - run: | - cd cabal-install - cabal v2-run cabal-install:integration-tests2 - - name: cabal-install unit-tests - run: | - cd cabal-install - cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)" - - name: cabal-tests - # Using only one job, -j1, to fail less. - run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.10.4\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe - -#TODO: store the exe from above as artifact and re-use it here instead of building anew - test-windows-8_10_4-dogfood: - name: test ghc-8.10.4 dogfood + # TODO: store the exe from above as artifact and re-use it here instead of building anew + test-windows-dogfood: + name: test ghc-${{ matrix.ghc }} dogfood runs-on: windows-latest steps: - uses: actions/setup-haskell@v1.1.4 with: - ghc-version: '8.10.4' + ghc-version: ${{ matrix.ghc }} cabal-version: '3.4.0.0' - name: Print versions run: | diff --git a/Makefile b/Makefile index 8edb9b328e1..5d5ebee4bda 100644 --- a/Makefile +++ b/Makefile @@ -70,16 +70,6 @@ buildinfo-fields-reference : phony analyse-imports : phony find Cabal-syntax/src Cabal/src cabal-install/src -type f -name '*.hs' | xargs cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta analyse-imports -- -# github actions -github-actions : .github/workflows/quick-jobs.yml -github-actions : .github/workflows/bootstrap.yml -github-actions : .github/workflows/linux.yml -github-actions : .github/workflows/macos.yml -github-actions : .github/workflows/windows.yml - -.github/workflows/%.yml : templates/ci-%.template.yml cabal-dev-scripts/src/GenValidate.hs - cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-validate -- $< $@ - # ghcid ghcid-lib : diff --git a/cabal-dev-scripts/cabal-dev-scripts.cabal b/cabal-dev-scripts/cabal-dev-scripts.cabal index c5417e57db9..5c783dd7ccc 100644 --- a/cabal-dev-scripts/cabal-dev-scripts.cabal +++ b/cabal-dev-scripts/cabal-dev-scripts.cabal @@ -44,17 +44,6 @@ executable gen-spdx-exc , text , zinza ^>=0.2 -executable gen-validate - default-language: Haskell2010 - main-is: GenValidate.hs - hs-source-dirs: src - ghc-options: -Wall - build-depends: - , base - , bytestring - , HsYAML ^>=0.2.1.0 - , zinza ^>=0.2 - executable gen-validate-dockerfile default-language: Haskell2010 main-is: GenValidateDockerfile.hs diff --git a/cabal-dev-scripts/src/GenValidate.hs b/cabal-dev-scripts/src/GenValidate.hs deleted file mode 100644 index 8203eb4f934..00000000000 --- a/cabal-dev-scripts/src/GenValidate.hs +++ /dev/null @@ -1,159 +0,0 @@ -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE ScopedTypeVariables #-} --- runghc -package-env=default Validate.hs validate.yml.zinza .github/workflows/validate.yml -module Main (main) where - -import Data.List (isPrefixOf) -import Data.Maybe (fromMaybe) -import GHC.Generics (Generic) -import System.Environment (getArgs) -import System.Exit (exitFailure) -import Zinza (Zinza (..), genericFromValueSFP, genericToTypeSFP, genericToValueSFP, parseAndCompileTemplateIO) - -import qualified Data.ByteString.Lazy.Char8 as LBS8 -import qualified Data.YAML as YAML - -main :: IO () -main = do - args <- getArgs - case args of - [src,tgt] -> do - run <- parseAndCompileTemplateIO src - -- this shouldn't fail (run-time errors are due bugs in zinza) - w <- run Z - { zJobs = -- version xenial flags old needs steps - ------------------------------------------------------------------- - [ GhcJob "9.0.1" False "--lib-only" False ["8.8.4"] libSteps - , GhcJob "8.10.4" False "" False ["8.8.4"] defSteps - , GhcJob "8.8.4" False "--solver-benchmarks" False [] defSteps - , GhcJob "8.6.5" False "--complete-hackage-tests" False ["8.8.4"] defSteps - , GhcJob "8.4.4" False "" False ["8.8.4"] defSteps - , GhcJob "8.2.2" False "" False ["8.8.4"] defSteps - , GhcJob "8.0.2" False "--lib-only" False ["8.8.4"] libSteps - , GhcJob "7.10.3" False "--lib-only" False ["8.8.4"] libSteps - , GhcJob "7.8.4" False "--lib-only" False ["8.8.4"] libSteps - , GhcJob "7.6.3" True "--lib-only" False ["8.8.4"] libSteps - , GhcJob "8.8.4" True "--lib-only" True ["8.8.4"] $ - libSteps ++ - [ "lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4" - , "lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2" - , "lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2" - ] - ] - , zMacosJobs = - [ mkMacGhcJob "8.8.4" "https://downloads.haskell.org/~ghc/8.8.4/ghc-8.8.4-x86_64-apple-darwin.tar.xz" - , mkMacGhcJob "8.6.5" "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz" - ] - , zWinJobs = - [ mkWinGhcJob "8.6.5" Nothing [] - , mkWinGhcJob "8.10.4" (Just "8.10.4") [] - ] - , zMangleVersion = map mangleChar - , zOr = (||) - , zNot = not - , zLibOnly = (== "--lib-only") - } - - -- check that YAML is syntactically valid - let bs = LBS8.pack w - case YAML.decode1 bs of - Right (_ :: YAML.Node YAML.Pos) -> return () - Left (pos, err) -> do - putStrLn $ "ERROR:" ++ YAML.prettyPosWithSource pos bs err - exitFailure - - writeFile tgt w - _ -> putStrLn "Usage source.yml.zinza target.yml" - -mangleChar :: Char -> Char -mangleChar '.' = '_' -mangleChar c = c - -defSteps :: [String] -defSteps = - [ "print-config" - , "print-tool-versions" - , "build" - , "lib-tests" - , "lib-suite" - , "cli-tests" - , "cli-suite" - ] - -libSteps :: [String] -libSteps = - [ "print-config" - , "print-tool-versions" - , "build" - , "lib-tests" - , "lib-suite" - ] - -data Z = Z - { zJobs :: [GhcJob] - , zMacosJobs :: [MacGhcJob] - , zWinJobs :: [WinGhcJob] - , zMangleVersion :: String -> String - , zOr :: Bool -> Bool -> Bool - , zNot :: Bool -> Bool - , zLibOnly :: String -> Bool - } - deriving (Generic) - -data GhcJob = GhcJob - { gjVersion :: String - , gjXenial :: Bool - , gjFlags :: String - , gjOld :: Bool - , gjNeeds :: [String] - , gjSteps :: [String] - } - deriving (Generic) - -data MacGhcJob = MacGhcJob - { mgjVersion :: String - , mgjGhcUrl :: String - , mgjFlags :: String - , mgjNeeds :: [String] - , mgjSteps :: [String] - } - deriving (Generic) - -mkMacGhcJob :: String -> String -> MacGhcJob -mkMacGhcJob v u = MacGhcJob - { mgjVersion = v - , mgjGhcUrl = u - , mgjFlags = "" - , mgjNeeds = ["8.8.4" | not $ "8.8" `isPrefixOf` v ] - , mgjSteps = defSteps - } - -data WinGhcJob = WinGhcJob - { wgjVersion :: String - , wgjChocoVersion :: String - , wgjNeeds :: [String] - } - deriving (Generic) - -mkWinGhcJob :: String -> Maybe String -> [String] -> WinGhcJob -mkWinGhcJob v mv = WinGhcJob v (fromMaybe v mv) - -instance Zinza Z where - toType = genericToTypeSFP - toValue = genericToValueSFP - fromValue = genericFromValueSFP - -instance Zinza GhcJob where - toType = genericToTypeSFP - toValue = genericToValueSFP - fromValue = genericFromValueSFP - -instance Zinza MacGhcJob where - toType = genericToTypeSFP - toValue = genericToValueSFP - fromValue = genericFromValueSFP - -instance Zinza WinGhcJob where - toType = genericToTypeSFP - toValue = genericToValueSFP - fromValue = genericFromValueSFP diff --git a/templates/ci-bootstrap.template.yml b/templates/ci-bootstrap.template.yml deleted file mode 100644 index 425c38dd208..00000000000 --- a/templates/ci-bootstrap.template.yml +++ /dev/null @@ -1,58 +0,0 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# -name: Bootstrap -on: - push: - branches: - - master - pull_request: - release: - types: - - created - -jobs: - bootstrap-linux: - name: Bootstrap on Linux - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: bootstrap.py - run: | - ghcup config set cache true - ghcup install ghc 8.10.7 - python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc 8.10.7) -d bootstrap/linux-8.10.7.json - - - name: Smoke test - run: | - _build/bin/cabal --version - - - uses: actions/upload-artifact@v2 - with: - name: cabal-linux-bootstrapped - path: _build/artifacts/* - - bootstrap-macos: - name: Bootstrap on macOS - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - # We use linux dependencies - - name: bootstrap.py - run: | - ghcup config set cache true - ghcup install ghc 8.10.7 - python3 bootstrap/bootstrap.py -w $(ghcup whereis ghc 8.10.7) -d bootstrap/linux-8.10.7.json - - - name: Smoke test - run: | - _build/bin/cabal --version - - - uses: actions/upload-artifact@v2 - with: - name: cabal-macos-bootstrapped - path: _build/artifacts/* diff --git a/templates/ci-linux.template.yml b/templates/ci-linux.template.yml deleted file mode 100644 index 63ea43da6d0..00000000000 --- a/templates/ci-linux.template.yml +++ /dev/null @@ -1,73 +0,0 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# -name: Linux -on: - push: - branches: - - master - pull_request: - release: - types: - - created - -jobs: -{% for job in jobs %} - validate-{{ mangleVersion job.version }}{% if job.old %}-old{% endif %}: - name: validate.sh {%if job.old %}old GHCs{% else %}ghc-{{job.version}}{% endif %} - runs-on: ubuntu-18.04 -{% for needs in job.needs %} - needs: validate-{{ mangleVersion needs }} -{% endfor %} - container: - image: phadej/ghc:{{job.version}}-{% if job.xenial %}xenial{% else %}bionic{% endif %} - steps: - - name: System info - run: | - uname -a - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan -{% if or job.xenial (or job.old (not (libOnly job.flags))) %} - - name: apt-get update - run: apt-get update -{% endif %} -{% if job.xenial %} - - name: Install dynamic libraries - run: apt-get install -y ghc-{{job.version}}-dyn -{% endif %} -{% if job.old %} - - name: Install extra compilers - run: apt-get install -y ghc-7.0.4-dyn ghc-7.2.2-dyn ghc-7.4.2-dyn -{% endif %} -{% if not (libOnly job.flags) %} - - name: Install `nroff` for `cabal man` - run: apt-get install -y groff-base -{% endif %} - - name: Update Hackage index - run: cabal v2-update - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) -{% for step in job.steps %} - - name: Validate {{step}} - run: sh validate.sh -j 2 -w ghc-{{job.version}} -v {{job.flags}} -s {{step}} -{% endfor %} -{% endfor %} diff --git a/templates/ci-macos.template.yml b/templates/ci-macos.template.yml deleted file mode 100644 index f4a8f3f3443..00000000000 --- a/templates/ci-macos.template.yml +++ /dev/null @@ -1,65 +0,0 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# -name: MacOS -on: - push: - branches: - - master - pull_request: - release: - types: - - created - -jobs: -{% for job in macosJobs %} - validate-macos-{{ mangleVersion job.version }}: - name: validate.sh macos ghc-{{job.version}} - runs-on: macos-latest -{% for needs in job.needs %} - needs: validate-macos-{{ mangleVersion needs }} -{% endfor %} - steps: - - name: System info - run: | - uname -a - - name: Install Autotools - run: | - brew install automake - - name: Install GHC - run: | - cd $(mktemp -d) - curl -sLO {{job.ghcUrl}} - tar -xJf ghc-*.tar.xz - cd ghc-* - ./configure --prefix=/opt/ghc/{{job.version}} - sudo make install - - name: Install Cabal - run: | - cd $(mktemp -d) - curl -sLO http://oleg.fi/cabal-install-3.4.0.0-rc1/cabal-install-3.4.0.0-x86_64-darwin-sierra.tar.xz - tar -xJf cabal-install-*.tar.xz - sudo mkdir -p /opt/cabal/3.4/bin - sudo cp cabal /opt/cabal/3.4/bin/cabal - sudo chmod 755 /opt/cabal/3.4/bin/cabal - - name: Set PATH - run: | - echo "/opt/ghc/{{job.version}}/bin" >> $GITHUB_PATH - echo "/opt/cabal/3.4/bin" >> $GITHUB_PATH - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Update Hackage index - run: cabal v2-update - - name: Install cabal-plan - run: | - cd $(mktemp -d) -{# aeson +fast, so we don't wait for -O2 #} - cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' - - uses: actions/checkout@v2 -{% for step in job.steps %} - - name: Validate {{step}} - run: sh validate.sh -j 2 -w ghc-{{job.version}} -v {{job.flags}} -s {{step}} -{% endfor %} -{% endfor %} diff --git a/templates/ci-quick-jobs.template.yml b/templates/ci-quick-jobs.template.yml deleted file mode 100644 index 34138dc3305..00000000000 --- a/templates/ci-quick-jobs.template.yml +++ /dev/null @@ -1,86 +0,0 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# -name: Quick jobs -on: - push: - branches: - - master - pull_request: - release: - types: - - created - -jobs: - meta: - name: Meta checks - runs-on: ubuntu-18.04 - # This job is not run in a container, any recent GHC should be fine - steps: - - name: Set PATH - # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - uses: actions/cache@v1 - with: - path: ~/.cabal/store - key: linux-store-meta - - name: ghcup - run: | - ghcup config set cache true - ghcup install ghc recommended - ghcup set ghc recommended - - name: Update Hackage index - run: cabal v2-update - - name: Install alex - run: cabal v2-install alex --constraint='alex ==3.2.6' - - uses: actions/checkout@v2 - - name: Regenerate files - run: | - make -B lexer - make -B spdx - make -B templates - make -B github-actions - - name: Check that diff is clean - run: | - git status > /dev/null - git diff-files -p --exit-code - doctest: - name: Doctest Cabal - runs-on: ubuntu-18.04 - steps: - - name: Set PATH - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-env - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/phadej/cabal-extras/releases/download/preview-20191225/cabal-env-snapshot-20191225-x86_64-linux.xz > cabal-env.xz - echo "1b567d529c5f627fd8c956e57ae8f0d9f11ee66d6db34b7fb0cb1c370b4edf01 cabal-env.xz" | sha256sum -c - - xz -d < cabal-env.xz > $HOME/.cabal/bin/cabal-env - rm -f cabal-env.xz - chmod a+x $HOME/.cabal/bin/cabal-env - - uses: actions/cache@v1 - with: - path: ~/.cabal/store - key: linux-store-doctest - - name: ghcup - run: | - ghcup config set cache true - ghcup install ghc recommended - ghcup set ghc recommended - - name: Update Hackage index - run: cabal v2-update - - name: Install doctest - run: cabal v2-install doctest - - name: Install libraries - run: | - cabal-env --transitive QuickCheck - cabal-env array bytestring containers deepseq directory filepath pretty process time binary unix text parsec mtl - cat $HOME/.ghc/*/environments/default - - uses: actions/checkout@v2 - - name: Doctest - run: make doctest diff --git a/templates/ci-windows.template.yml b/templates/ci-windows.template.yml deleted file mode 100644 index 52a7d5350bf..00000000000 --- a/templates/ci-windows.template.yml +++ /dev/null @@ -1,125 +0,0 @@ -# This file is auto-generated -# -# To regenerate it run -# -# make github-actions -# -name: Windows -on: - push: - branches: - - master - pull_request: - release: - types: - - created - -jobs: - -{############################################################################} -{# Windows jobs #} -{############################################################################} -{% for job in winJobs %} - test-windows-{{ mangleVersion job.version }}: - name: test ghc-{{job.version}} - runs-on: windows-latest -{% for needs in job.needs %} - needs: test-windows-{{ mangleVersion needs }} -{% endfor %} - steps: - - uses: actions/setup-haskell@v1.1.4 - with: - ghc-version: '{{ job.chocoVersion }}' - cabal-version: '3.4.0.0' - - name: Print versions - run: | - [Environment]::GetEnvironmentVariable("Path") - cabal --version - ghc --version - cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3 - - uses: actions/cache@v1 - with: - path: C:\SR - key: windows-store-meta - - name: Update Hackage index - run: cabal v2-update - - uses: actions/checkout@v2 - # all dependencies of Cabal already there (due to GHC depending on Cabal) - - name: cabal v2-build Cabal - run: cabal v2-build Cabal - # We cannot ask for all dependencies, but we can for cabal-install. - - name: cabal v2-build cabal-install --only-dependencies - run: cabal v2-build cabal-install --only-dependencies - - name: cabal v2-build - run: cabal v2-build all - - name: Cabal unit-tests - run: | - cabal v2-test Cabal-tests - - name: cabal-install memory-usage-tests - run: | - cd cabal-install - cabal v2-run cabal-install:memory-usage-tests - - name: cabal-install long-tests - run: | - cd cabal-install - cabal v2-run cabal-install:long-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)" - - name: cabal-install integration-tests2 - run: | - cd cabal-install - cabal v2-run cabal-install:integration-tests2 - - name: cabal-install unit-tests - run: | - cd cabal-install - cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)" - - name: cabal-tests - # Using only one job, -j1, to fail less. - run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-{{ job.version }}\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe - -#TODO: store the exe from above as artifact and re-use it here instead of building anew - test-windows-{{ mangleVersion job.version }}-dogfood: - name: test ghc-{{job.version}} dogfood - runs-on: windows-latest -{% for needs in job.needs %} - needs: test-windows-{{ mangleVersion needs }} -{% endfor %} - steps: - - uses: actions/setup-haskell@v1.1.4 - with: - ghc-version: '{{ job.chocoVersion }}' - cabal-version: '3.4.0.0' - - name: Print versions - run: | - [Environment]::GetEnvironmentVariable("Path") - cabal --version - ghc --version - cabal user-config init -a "http-transport: plain-http" -a "store-dir: C:\SR" -f -v3 - - uses: actions/cache@v1 - with: - path: C:\SR - key: windows-store-meta - - name: Update Hackage index - run: cabal v2-update - - uses: actions/checkout@v2 - # all dependencies of Cabal already there (due to GHC depending on Cabal) - - name: cabal v2-build Cabal - run: cabal v2-build Cabal - # We cannot ask for all dependencies, but we can for cabal-install. - - name: cabal v2-build cabal-install --only-dependencies - run: cabal v2-build cabal-install --only-dependencies - - name: cabal v2-build - run: cabal v2-build all - - name: wipe out cabal store - run: Remove-Item -Recurse -Force C:\SR - - name: eat its own dogfood by building own Cabal source with itself - run: | - cp $(cabal list-bin exe:cabal) ./cabal-exe-current - ./cabal-exe-current --version - ./cabal-exe-current v2-build Cabal - shell: bash - - name: eat its own dogfood by building all deps with itself - run: ./cabal-exe-current v2-build cabal-install --only-dependencies - shell: bash - - name: eat its own dogfood by building own source with itself - run: ./cabal-exe-current v2-build all - shell: bash -{% endfor %} From 1d986861eb50f2a0b33133ea7d0d5e23a9723706 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 17:17:46 +0800 Subject: [PATCH 02/34] Add GHC 9.2, bump bounds, fix syntax --- .github/workflows/linux.yml | 11 ++++++----- cabal-install-solver/cabal-install-solver.cabal | 4 ++-- cabal-install/cabal-install.cabal | 6 +++--- cabal-install/tests/IntegrationTests2.hs | 6 +++--- cabal-testsuite/cabal-testsuite.cabal | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 30030cbef49..a49cdf83369 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,8 +14,9 @@ jobs: strategy: matrix: ghc: - - "9.0.1" - - "8.10.4" + - "9.2.1" + - "9.0.2" + - "8.10.7" - "8.8.4" - "8.6.5" - "8.4.4" @@ -62,7 +63,7 @@ jobs: git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - name: Set flag --lib-only - if: contains(matrix.ghc, ["9.0.1", "8.0.2", "7.10.3", "7.8.4", "7.6.3"]) + if: contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4", "7.6.3"]) run: echo "flags=--lib-only" >> $github_env - name: Set flag --solver-benchmark @@ -95,11 +96,11 @@ jobs: run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite - name: Validate cli-tests - if: contains(matrix.ghc, ["8.10.4", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) + if: contains(matrix.ghc, ["8.10.7", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-tests - name: Validate cli-suite - if: contains(matrix.ghc, ["8.10.4", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) + if: contains(matrix.ghc, ["8.10.7", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-suite validate_old: diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 801d3906504..4811493d012 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -103,7 +103,7 @@ library build-depends: , array >=0.4 && <0.6 - , base >=4.10 && <4.15 + , base >=4.10 && <4.17 , binary >=0.7.3 && <0.9 , bytestring >=0.10.6.0 && <0.12 , Cabal ^>=3.7 @@ -137,7 +137,7 @@ Test-Suite unit-tests UnitTests.Distribution.Solver.Modular.MessageUtils build-depends: - , base >= 4.10 && <4.15 + , base >= 4.10 && <4.17 , Cabal , Cabal-syntax , cabal-install-solver diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 98c23fbd89c..221cdc7b928 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -46,7 +46,7 @@ common warnings ghc-options: -Wunused-packages common base-dep - build-depends: base >=4.10 && <4.16 + build-depends: base >=4.10 && <4.17 common cabal-dep build-depends: Cabal ^>=3.7 @@ -319,7 +319,7 @@ Test-Suite unit-tests directory, filepath, mtl, - network-uri >= 2.6.2.0 && <2.6.4.0, + network-uri >= 2.6.2.0 && <2.7, random, tar, time, @@ -406,7 +406,7 @@ test-suite long-tests filepath, hashable, mtl, - network-uri >= 2.6.2.0 && <2.6.4.0, + network-uri >= 2.6.2.0 && <2.7, random, tagged, tasty >= 1.2.3 && <1.5, diff --git a/cabal-install/tests/IntegrationTests2.hs b/cabal-install/tests/IntegrationTests2.hs index a2879a6f2be..cb7b7ddfeb1 100644 --- a/cabal-install/tests/IntegrationTests2.hs +++ b/cabal-install/tests/IntegrationTests2.hs @@ -509,7 +509,7 @@ mkTargetAllPackages = TargetAllPackages Nothing instance IsString PackageIdentifier where fromString pkgidstr = pkgid - where pkgid = fromMaybe (error $"fromString @PackageIdentifier " ++ show pkgidstr) $ simpleParse pkgidstr + where pkgid = fromMaybe (error $ "fromString @PackageIdentifier " ++ show pkgidstr) $ simpleParse pkgidstr testTargetSelectorNoCurrentPackage :: Assertion @@ -1611,8 +1611,8 @@ type PlanDetails = (ProjDetails, planProject :: FilePath -> ProjectConfig -> IO PlanDetails planProject testdir cliConfig = do - projDetails@ - (distDirLayout, + projDetails@( + distDirLayout, cabalDirLayout, projectConfig, localPackages, diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index b1474089950..dbf851552ab 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -26,7 +26,7 @@ common shared default-language: Haskell2010 build-depends: - , base >= 4.6 && <4.16 + , base >= 4.6 && <4.17 -- this needs to match the in-tree lib:Cabal version , Cabal == 3.7.0.0 , Cabal-syntax == 3.7.0.0 @@ -57,7 +57,7 @@ library Test.Cabal.ScriptEnv0 build-depends: - , aeson ^>= 1.4.2.0 || ^>=1.5.0.0 + , aeson ^>= 1.4.2.0 || ^>=1.5.0.0 || ^>= 2.0.0.0 , async ^>= 2.2.1 , attoparsec ^>= 0.13.2.2 || ^>=0.14.1 , base16-bytestring ^>= 0.1.1.6 || ^>= 1.0.0.0 From af850c09aff1faf650c1b746cf3a5da6dbc8b801 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 17:19:26 +0800 Subject: [PATCH 03/34] Switch to official haskell image --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a49cdf83369..d53a4c12dce 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-18.04 container: - image: phadej/ghc:${{ matrix.ghc }}-bionic + image: haskell:${{ matrix.ghc }} steps: - name: System info From caf429a0b65e2a738a2e658402672edee7908357 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 17:22:07 +0800 Subject: [PATCH 04/34] Always run cli tests for ghc 8.2 and above --- .github/workflows/linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d53a4c12dce..44aaca34b6f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -96,11 +96,11 @@ jobs: run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite - name: Validate cli-tests - if: contains(matrix.ghc, ["8.10.7", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) + if: !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-tests - name: Validate cli-suite - if: contains(matrix.ghc, ["8.10.7", "8.8.4", "8.6.5", "8.4.4", "8.2.2"]) + if: !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-suite validate_old: From cd328d3801a0eaee43f74bd0629ba2bb11b1da58 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 17:36:29 +0800 Subject: [PATCH 05/34] Remove step to regenerate GitHub Actions workflows --- .github/workflows/quick-jobs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/quick-jobs.yml b/.github/workflows/quick-jobs.yml index 0573692ce89..a34d4f01386 100644 --- a/.github/workflows/quick-jobs.yml +++ b/.github/workflows/quick-jobs.yml @@ -38,7 +38,6 @@ jobs: make -B lexer make -B spdx make -B templates - make -B github-actions - name: Check that diff is clean run: | git status > /dev/null From 2e0f916bcc7d94e6026a93a414a4e30b115ebc03 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 17:55:19 +0800 Subject: [PATCH 06/34] Fix missed reference to GHC version --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dae40f689b2..d40dd3de865 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -66,7 +66,7 @@ jobs: cabal v2-run cabal-install:unit-tests -- --pattern "! (/FileMonitor/ || /VCS/ || /Get/)" - name: cabal-tests # Using only one job, -j1, to fail less. - run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-8.6.5\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe + run: cabal v2-run cabal-testsuite:cabal-tests -- -j1 --with-cabal=dist-newstyle\build\x86_64-windows\ghc-${{ matrix.ghc }}\cabal-install-3.7.0.0\x\cabal\build\cabal\cabal.exe # TODO: store the exe from above as artifact and re-use it here instead of building anew test-windows-dogfood: From 8694058d7133cda108e9c57010c2cf7daa360387 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 18:00:34 +0800 Subject: [PATCH 07/34] Fix yaml syntax --- .github/workflows/linux.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 44aaca34b6f..ab71727de6e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -96,11 +96,13 @@ jobs: run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite - name: Validate cli-tests - if: !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) + if: | + !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-tests - name: Validate cli-suite - if: !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) + if: | + !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-suite validate_old: From 63f9e02a78ce44f00aab6ab5d9adedab045a38db Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 4 Feb 2022 18:04:50 +0800 Subject: [PATCH 08/34] Fix type in the GHC version --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 29cc3468f9f..a70be8ac134 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,7 +17,7 @@ jobs: matrix: ghc: - "8.8.4" - - "8.8.5" + - "8.6.5" steps: - name: System info From 1c63671e880d8bef3f7b4facaa9a51a74fe67d61 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Feb 2022 15:18:13 +0800 Subject: [PATCH 09/34] More CI changes - Run bootstrap.yml on ubuntu-latest - Use explicit matrix for linux.yml - Drop containers in favour of haskell setup action - Drop workaround for ancient git --- .github/workflows/linux.yml | 97 ++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 54 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ab71727de6e..dcc08f3e2d8 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -11,30 +11,44 @@ on: jobs: validate: + name: Validate ${{ matrix.ghc }} + runs-on: ubuntu-latest + strategy: matrix: - ghc: - - "9.2.1" - - "9.0.2" - - "8.10.7" - - "8.8.4" - - "8.6.5" - - "8.4.4" - - "8.2.2" - - "8.0.2" - - "7.10.3" - - "7.8.4" - - name: validate ${{ matrix.ghc }} - runs-on: ubuntu-18.04 - - container: - image: haskell:${{ matrix.ghc }} + include: + - ghc: "9.2.1" + flags: "" + cli: true + - ghc: "9.0.2" + flags: "" + cli: true + - ghc: "8.10.7" + flags: "" + cli: true + - ghc: "8.8.4" + flags: "--solver-benchmarks" + cli: true + - ghc: "8.6.5" + flags: "--complete-hackage-tests" + cli: true + - ghc: "8.4.4" + flags: "" + cli: true + - ghc: "8.2.2" + flags: "" + cli: true + - ghc: "8.0.2" + flags: "--lib-only" + cli: false steps: - - name: System info - run: | - uname -a + - uses: actions/checkout@v2 + + - uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: latest - name: Set PATH run: | @@ -52,58 +66,33 @@ jobs: - name: Update Hackage index run: cabal v2-update - # TODO revisit this - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - - name: Set flag --lib-only - if: contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4", "7.6.3"]) - run: echo "flags=--lib-only" >> $github_env - - - name: Set flag --solver-benchmark - if: matrix.ghc == "8.8.4" - run: echo "flags=--solver-benchmark" >> $github_env - - - name: Set flag --complete-hackage-tests - if: matrix.ghc == "8.6.5" - run: echo "flags=--complete-hackage-tests" >> $github_env - - name: Install `nroff` for `cabal man` - if: contains(matrix.ghc, ["8.8.4", "8.6.5"]) run: | apt-get update apt-get install -y groff-base - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-config + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-tool-versions - name: Validate build - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s build + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s build - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-tests + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s lib-tests - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s lib-suite - name: Validate cli-tests - if: | - !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-tests + if: matrix.cli == true + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s cli-tests - name: Validate cli-suite - if: | - !contains(matrix.ghc, ["8.0.2", "7.10.3", "7.8.4"]) - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s cli-suite + if: matrix.cli == true + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s cli-suite validate_old: strategy: From 9305e3ff943590357f76a95adbe2d5a89a893e46 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Feb 2022 21:37:58 +0800 Subject: [PATCH 10/34] Remove unneeded package from CI setup I belive this is only necessary to run `cabal man` which we do not in the CI. --- .github/workflows/linux.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dcc08f3e2d8..81632b5a2a7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -66,11 +66,6 @@ jobs: - name: Update Hackage index run: cabal v2-update - - name: Install `nroff` for `cabal man` - run: | - apt-get update - apt-get install -y groff-base - - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config From 1d031adccc230a4ffac51d61329afc20274b7748 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Feb 2022 21:47:24 +0800 Subject: [PATCH 11/34] Drop old GHCs from the CI --- .github/workflows/linux.yml | 88 ------------------------------------- 1 file changed, 88 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 81632b5a2a7..73cb598deaa 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -89,91 +89,3 @@ jobs: if: matrix.cli == true run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s cli-suite - validate_old: - strategy: - matrix: - include: - - ghc: "7.6.3" - old: false - image_tag: xenial - extra_steps: false - - ghc: "8.8.4" - old: true - image_tag: xenial - extra_steps: true - - name: Validate old GHCs ${{ matrix.ghc }} - runs-on: ubuntu-18.04 - - container: - image: phadej/ghc:${{ matrix.ghc }}-${{ matrix.image_tag }} - - steps: - - name: System info - run: | - uname -a - - - name: Set PATH - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - - name: apt-get update - if: matrix.old == true - run: apt-get update - - - name: Install dynamic libraries - if: matrix.image_tag == "xenial" - run: apt-get install -y ghc-${{ matrix.ghc }}-dyn - - - name: Install extra compilers - if: matrix.old == true - run: apt-get install -y ghc-7.0.4-dyn ghc-7.2.2-dyn ghc-7.4.2-dyn - - - name: Update Hackage index - run: cabal v2-update - - # TODO revisit this - # https://github.com/actions/checkout/issues/170 - # - uses: actions/checkout@v2 - - name: Checkout - run: | - echo $GITHUB_REF $GITHUB_SHA - git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . - git fetch origin $GITHUB_SHA:temporary-ci-branch - git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - - - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-config - - - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s print-tool-versions - - - name: Validate build - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s build - - - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-tests - - - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite - - - name: Valudate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 - if: matrix.extra_steps - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.0.4 - - - name: Valudate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.2.2 - if: matrix.extra_steps - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite-extras --extra-hc /opt/ghc/7.2.2/bin/ghc-7.2.2 - - - name: Valudate lib-suite-extras --extra-hc /opt/ghc/7.0.4/bin/ghc-7.4.2 - if: matrix.extra_steps - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ env.flags }} -s lib-suite-extras --extra-hc /opt/ghc/7.4.2/bin/ghc-7.4.2 From fe809fbc948c8d5ef6d3d38fc266403100d0946c Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Feb 2022 21:51:45 +0800 Subject: [PATCH 12/34] Switch macos.yml to haskell/action/setup Also add the same GHC versions as Linux. --- .github/workflows/macos.yml | 40 +++++++++---------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a70be8ac134..81ddbf27f70 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -16,41 +16,19 @@ jobs: strategy: matrix: ghc: + - "9.2.1" + - "9.0.2" + - "8.10.7" - "8.8.4" - "8.6.5" + - "8.2.2" + - "8.0.2" steps: - - name: System info - run: | - uname -a - - - name: Install Autotools - run: | - brew install automake - - - name: Install GHC ${{ matrix.ghc }} - run: | - cd $(mktemp -d) - curl -sLO https://downloads.haskell.org/~ghc/${{ matrix.ghc }}/ghc-${{ matrix.ghc }}-x86_64-apple-darwin.tar.xz - tar -xJf ghc-*.tar.xz - cd ghc-* - ./configure --prefix=/opt/ghc/{{job.version}} - sudo make install - - - name: Install Cabal - run: | - cd $(mktemp -d) - curl -sLO http://oleg.fi/cabal-install-3.4.0.0-rc1/cabal-install-3.4.0.0-x86_64-darwin-sierra.tar.xz - tar -xJf cabal-install-*.tar.xz - sudo mkdir -p /opt/cabal/3.4/bin - sudo cp cabal /opt/cabal/3.4/bin/cabal - sudo chmod 755 /opt/cabal/3.4/bin/cabal - - - name: Set PATH - run: | - echo "/opt/ghc/${{ matrix.ghc }}/bin" >> $GITHUB_PATH - echo "/opt/cabal/3.4/bin" >> $GITHUB_PATH - echo "$HOME/.cabal/bin" >> $GITHUB_PATH + - uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: latest - name: Update Hackage index run: cabal v2-update From 778fd587086ccdfb27c34312d095fc5a4c83d5f8 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Feb 2022 22:03:29 +0800 Subject: [PATCH 13/34] Simplify CI - Remove cabal-plan, we actually never call it (I think) - Remove vendored cabal-doctest - Remove few stray allow-newer clauses no longer necessary, apparently Originally done by @gbaz in PR #7907. --- .github/workflows/linux.yml | 9 - .github/workflows/macos.yml | 6 - cabal.project | 9 - cabal.project.coverage | 2 - cabal.project.libonly | 2 - cabal.project.validate | 2 - cabal.project.validate.libonly | 2 - vendor/cabal-doctest-1.0.8/ChangeLog.md | 50 -- vendor/cabal-doctest-1.0.8/LICENSE | 30 - vendor/cabal-doctest-1.0.8/README.md | 255 -------- vendor/cabal-doctest-1.0.8/Setup.hs | 2 - .../cabal-doctest-1.0.8/cabal-doctest.cabal | 48 -- .../src/Distribution/Extra/Doctest.hs | 552 ------------------ 13 files changed, 969 deletions(-) delete mode 100644 vendor/cabal-doctest-1.0.8/ChangeLog.md delete mode 100644 vendor/cabal-doctest-1.0.8/LICENSE delete mode 100644 vendor/cabal-doctest-1.0.8/README.md delete mode 100644 vendor/cabal-doctest-1.0.8/Setup.hs delete mode 100644 vendor/cabal-doctest-1.0.8/cabal-doctest.cabal delete mode 100644 vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 73cb598deaa..efc4d6df359 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -54,15 +54,6 @@ jobs: run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Install cabal-plan - run: | - mkdir -p $HOME/.cabal/bin - curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz - echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - - xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan - rm -f cabal-plan.xz - chmod a+x $HOME/.cabal/bin/cabal-plan - - name: Update Hackage index run: cabal v2-update diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 81ddbf27f70..e405a3c4301 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -33,12 +33,6 @@ jobs: - name: Update Hackage index run: cabal v2-update - - name: Install cabal-plan - run: | - cd $(mktemp -d) - # aeson +fast, so we don't wait for -O2 - cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' - - uses: actions/checkout@v2 - name: Validate print-config diff --git a/cabal.project b/cabal.project index d8291fc64f0..3c652ecb803 100644 --- a/cabal.project +++ b/cabal.project @@ -11,20 +11,11 @@ packages: Cabal-described packages: Cabal-tests/ packages: cabal-benchmarks/ -packages: vendor/cabal-doctest-1.0.8 - optional-packages: ./vendored/*/*.cabal --- Remove after hackage-repo-tool release -allow-newer: - hackage-repo-tool:optparse-applicative - allow-newer: hackage-security:Cabal --- https://github.com/haskell-hvr/windns/pull/2 -allow-newer: windns-0.1.0.1:base - -- avoiding extra dependencies constraints: rere -rere-cfg constraints: these -assoc diff --git a/cabal.project.coverage b/cabal.project.coverage index 6e1ca6f27a8..7c39810b88f 100644 --- a/cabal.project.coverage +++ b/cabal.project.coverage @@ -11,8 +11,6 @@ packages: Cabal-described packages: Cabal-tests/ packages: cabal-benchmarks/ -packages: vendor/cabal-doctest-1.0.8 - -- Uncomment to allow picking up extra local unpacked deps: --optional-packages: */ diff --git a/cabal.project.libonly b/cabal.project.libonly index 4f09ff2fa82..e11d81f5d77 100644 --- a/cabal.project.libonly +++ b/cabal.project.libonly @@ -5,8 +5,6 @@ packages: Cabal-tree-diff packages: Cabal-described packages: Cabal-tests -packages: vendor/cabal-doctest-1.0.8 - tests: True -- Uncomment to allow picking up extra local unpacked deps: diff --git a/cabal.project.validate b/cabal.project.validate index 43db4f152c0..6f9dc0b45d3 100644 --- a/cabal.project.validate +++ b/cabal.project.validate @@ -11,8 +11,6 @@ packages: Cabal-described packages: Cabal-tests packages: cabal-benchmarks -packages: vendor/cabal-doctest-1.0.8 - tests: True -- avoiding extra dependencies diff --git a/cabal.project.validate.libonly b/cabal.project.validate.libonly index 736914de74c..2566a5cc8d2 100644 --- a/cabal.project.validate.libonly +++ b/cabal.project.validate.libonly @@ -6,8 +6,6 @@ packages: Cabal-tree-diff packages: Cabal-described packages: Cabal-tests -packages: vendor/cabal-doctest-1.0.8 - tests: True write-ghc-environment-files: never diff --git a/vendor/cabal-doctest-1.0.8/ChangeLog.md b/vendor/cabal-doctest-1.0.8/ChangeLog.md deleted file mode 100644 index d165583d753..00000000000 --- a/vendor/cabal-doctest-1.0.8/ChangeLog.md +++ /dev/null @@ -1,50 +0,0 @@ -# 1.0.8 -- 2019-10-02 - -* Pass `-package-env=-` when compiler supports it -* Amend examples to `unsetEnv "GHC_ENVIRONMENT"` - -# 1.0.7 -- 2019-08-26 - -* Make `Distribution.Extra.Doctest` `-Wall`-clean -* Support GHC-8.8, base-4.13, and Cabal-3.0 - -# 1.0.6 -- 2018-01-28 - -* Hook `haddock` build too. Fixes issue when `haddock` fails, as - `Build_doctests` isn't generated. - -# 1.0.5 -- 2018-01-26 - -* Add a hack so `Build_doctests` module is automatically added to - to `other-modules` and `autogen-modules` when compiled with Cabal-2.0. - Thanks to that, we don't get warnings because of `-Wmissing-home-modules`. - -# 1.0.4 -- 2017-12-05 - -* Add support for doctests in executables and (with `Cabal-2.0` or later) - internal libraries. Refer to the `README` for more details. - -# 1.0.3 -- 2017-11-02 - -* Add an explicit `Prelude` import to `Build_doctests` - -# 1.0.2 -- 2017-05-16 - -* Add `defaultMainAutoconfWithDoctests` and `addDoctestsUserHook`. - -* Add support for `.hsc` and other preprocessed files - ([#8](https://github.com/phadej/cabal-doctest/issues/8)) - -* Add support for `x-doctest-source-dirs` and `x-doctest-modules`. - -# 1.0.1 -- 2017-05-05 - -* Add support for `x-doctest-options` cabal-file field - -* Proper support for GHC-8.2.1 & Cabal-2.0.0.0 - -* Add support to `default-extensions` in library. - -# 1 -- 2017-01-31 - -* First version. Released on an unsuspecting world. diff --git a/vendor/cabal-doctest-1.0.8/LICENSE b/vendor/cabal-doctest-1.0.8/LICENSE deleted file mode 100644 index 96445e5484d..00000000000 --- a/vendor/cabal-doctest-1.0.8/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2017, Oleg Grenrus - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Oleg Grenrus nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/cabal-doctest-1.0.8/README.md b/vendor/cabal-doctest-1.0.8/README.md deleted file mode 100644 index 46810865525..00000000000 --- a/vendor/cabal-doctest-1.0.8/README.md +++ /dev/null @@ -1,255 +0,0 @@ -cabal-doctest -============= - -[![Hackage](https://img.shields.io/hackage/v/cabal-doctest.svg)](https://hackage.haskell.org/package/cabal-doctest) [![Build Status](https://travis-ci.org/phadej/cabal-doctest.svg?branch=master)](https://travis-ci.org/phadej/cabal-doctest) - -A `Setup.hs` helper for running `doctests`. - -Simple example --------------- - -For most use cases—a `.cabal` file with a single library containing -doctests—adapting the simple example located -[here](https://github.com/phadej/cabal-doctest/tree/master/simple-example) -will be sufficient. (Note that this example requires `Cabal-1.24` or later, but -you can relax this bound safely, although running doctests won't be supported -on versions of `Cabal` older than 1.24.) - -To use this library in your `Setup.hs`, you should specify a `custom-setup` -section in your `.cabal` file. For example: - -``` -custom-setup - setup-depends: - base >= 4 && <5, - Cabal, - cabal-doctest >= 1 && <1.1 -``` - -/Note:/ `Cabal` dependency is needed because of -[Cabal/GH-4288](https://github.com/haskell/cabal/issues/4288) bug. - -You'll also need to specify `build-type: Custom` at the top of the `.cabal` -file. Now put this into your `Setup.hs` file: - -```haskell -module Main where - -import Distribution.Extra.Doctest (defaultMainWithDoctests) - -main :: IO () -main = defaultMainWithDoctests "doctests" -``` - -When you build your project, this `Setup` will generate a `Build_doctests` -module. To use it in a testsuite, simply do this: - -```haskell -module Main where - -import Build_doctests (flags, pkgs, module_sources) -import Data.Foldable (traverse_) -import System.Environment.Compat (unsetEnv) -import Test.DocTest (doctest) - -main :: IO () -main = do - traverse_ putStrLn args -- optionally print arguments - unsetEnv "GHC_ENVIRONMENT" -- see 'Notes'; you may not need this - doctest args - where - args = flags ++ pkgs ++ module_sources -``` - -(The `System.Environment.Compat` module is from the `base-compat` -package. That's already in the transitive closure of `doctest`'s -dependencies. `System.Environment.unsetEnv` was added with GHC 7.8 so, -if you don't need to support versions of GHC older than 7.8, you can -use `System.Environment` from `base` instead.) - -Example with multiple .cabal components ---------------------------------------- - -`cabal-doctest` also supports more exotic use cases where a `.cabal` file -contains more components with doctests than just the main library, including: - -* Doctests in executables -* Doctests in Internal libraries (if using `Cabal-2.0` or later) - -Unlike the simple example shown above, these examples involve _named_ -components. You don't need to change the `Setup.hs` script to support -this use case. However, in this scenario `Build_doctests` will generate extra -copies of the `flags`, `pkgs`, and `module_sources` values for each additional -named component. - -Simplest approach is to use `x-doctest-components` field, for example -``` -x-doctest-components: lib lib:internal exe:example -``` - -In that case, the testdrive is general: - -```haskell -module Main where - -import Build_doctests (Component (..), components) -import Data.Foldable (for_) -import System.Environment.Compat (unsetEnv) -import Test.DocTest (doctest) - -main :: IO () -main = for_ components $ \(Component name flags pkgs sources) -> do - print name - putStrLn "----------------------------------------" - let args = flags ++ pkgs ++ sources - for_ args putStrLn - unsetEnv "GHC_ENVIRONMENT" - doctest args -``` - -There's also a more explicit approach: if you have an executable named `foo`, -then separate values named `flags_exe_foo`, `pkgs_exe_foo`, and `module_sources_exe_foo` will -be generated in `Build_doctests`. If the name has hyphens in it -(e.g., `my-exe`), then `cabal-doctest` will convert those hyphens to -underscores (e.g., you'd get `flags_my_exe`, `pkgs_my_exe`, and -`module_sources_my_exe`). -Internal library `bar` values will have a `_lib_bar` suffix. - -An example testsuite driver for this use case might look like this: - -```haskell -module Main where - -import Build_doctests - (flags, pkgs, module_sources, - flags_exe_my_exe, pkgs_exe_my_exe, module_sources_exe_my_exe) -import Data.Foldable (traverse_) -import System.Environment.Compat (unsetEnv) -import Test.DocTest - -main :: IO () -main = do - unsetEnv "GHC_ENVRIONMENT" - -- doctests for library - traverse_ putStrLn libArgs - doctest libArgs - - -- doctests for executable - traverse_ putStrLn exeArgs - doctest exeArgs - where - libArgs = flags ++ pkgs ++ module_sources - exeArgs = flags_exe_my_exe ++ pkgs_exe_my_exe ++ module_sources_exe_my_exe -``` - -See -[this example](https://github.com/phadej/cabal-doctest/tree/master/multiple-components-example) -for more details. - -Additional configuration ------------------------- - -The `cabal-doctest` based `Setup.hs` supports few extensions fields -in `pkg.cabal` files to customise the `doctest` runner behaviour, without -customising the default `doctest.hs`. - -``` -test-suite doctests: - if impl(ghc >= 8.0) - x-doctest-options: -fdiagnostics-color=never - x-doctest-source-dirs: test - x-doctest-modules: Servant.Utils.LinksSpec - - ... -``` - -* `x-doctest-options` Additional arguments passed into `doctest` command. -* `x-doctest-modules` Additional modules to `doctest`. May be useful if you - have `doctest` in test or executables (i.e not default library complonent). -* `x-doctest-src-dirs` Additional source directories to look for the modules. - -Notes ------ - -* Recent versions of `Cabal` (for instance, 2.0) can choose to build a - package's `doctest` test suite _before_ the library. However, in order for - `cabal-doctest` to work correctly, the library _must_ be built first, as - `doctest` relies on the presence of generated files that are only created - when the library is built. See - [#19](https://github.com/phadej/cabal-doctest/issues/19). - - A hacky workaround for this problem is to depend on the library itself in a - `doctests` test suite. See - [the simple example's .cabal file](https://github.com/phadej/cabal-doctest/blob/master/simple-example/simple-example.cabal) - for a demonstration. (This assumes that the test suite has the ability to - read build artifacts from the library, a separate build component. In - practice, this assumption holds, which is why this library works at all.) - -* `custom-setup` section is supported starting from `cabal-install-1.24`. - For older `cabal-install's` you have to install custom setup dependencies - manually. - -* `stack` respects `custom-setup` starting from version 1.3.3. Before that - you have to use `explicit-setup-deps` setting in your `stack.yaml`. - ([stack/GH-2094](https://github.com/commercialhaskell/stack/issues/2094)) - -* There is [an issue in the Cabal issue tracker](https://github.com/haskell/cabal/issues/2327) - about adding `cabal doctest` command. After that command is implemented, - this library will be deprecated. - -* You can use `x-doctest-options` field in `test-suite doctests` to - pass additional flags to the `doctest`. - -* For `build-type: Configure` packages, you can use - `defaultMainAutoconfWithDoctests` function to make custom `Setup.hs` script. - -* If you use the default `.` in `hs-source-dirs`, then running `doctests` - might fail with weird errors (ambiguous module errors). Workaround is - to move sources under `src/` or some non-top-level directory. - -* `extensions:` field isn't supported. Upgrade your `.cabal` file to use at least - `cabal-version: >= 1.10` and use `default-extensions` or `other-extensions`. - -* If you use QuickCheck properties (`prop>`) in your doctests, - the `test-suite doctest` should depend on `QuickCheck` and `template-haskell`. - This is a little HACK: These dependencies aren't needed to build the - `doctests` test-suite executable. However, as we let `Cabal` resolve - dependencies, we can pass the resolved (and installed!) package identifiers to - to the `doctest` command. This way, `QuickCheck` and `template-haskell` are - available to `doctest`, otherwise you'll get errors like: - -``` - Variable not in scope: - mkName - :: [Char] - -> template-haskell-2.11.1.0:Language.Haskell.TH.Syntax.Name -``` - -or - -``` - Variable not in scope: - polyQuickCheck - :: Language.Haskell.TH.Syntax.Name -> Language.Haskell.TH.Lib.ExpQ -``` - -* From version 2, Stack sets the `GHC_ENVRIONMENT` variable, and GHC - (as invoked by `doctest`) will pick that up. This is undesirable: - `cabal-doctest` passes all the necessary information on the command - line already, and can lead to ambiguous module errors as GHC will - load the environment in addition to what `cabal-doctest` instructs - it to. - - Hence, `cabal-doctest` tells GHC to ignore package environments - altogether on the command line. However, this is only possible since - GHC 8.2. If you are using `cabal-doctest` with Stack 2 and GHC 8.0 - or earlier and seeing ambiguous module errors or other mysterious - failures, try manually unsetting `GHC_ENVIRONMENT` before invoking - `doctest`. - -Copyright ---------- - -Copyright 2017 Oleg Grenrus. - -Available under the BSD 3-clause license. diff --git a/vendor/cabal-doctest-1.0.8/Setup.hs b/vendor/cabal-doctest-1.0.8/Setup.hs deleted file mode 100644 index 9a994af677b..00000000000 --- a/vendor/cabal-doctest-1.0.8/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/vendor/cabal-doctest-1.0.8/cabal-doctest.cabal b/vendor/cabal-doctest-1.0.8/cabal-doctest.cabal deleted file mode 100644 index 149b06660e2..00000000000 --- a/vendor/cabal-doctest-1.0.8/cabal-doctest.cabal +++ /dev/null @@ -1,48 +0,0 @@ -name: cabal-doctest -version: 1.0.8 -x-revision: 2 -synopsis: A Setup.hs helper for doctests running -description: - Currently (beginning of 2017), there isn't @cabal doctest@ - command. Yet, to properly work doctest needs plenty of configuration. - This library provides the common bits for writing custom Setup.hs - See for the progress - of @cabal doctest@, i.e. whether this library is obsolete. - -homepage: https://github.com/phadej/cabal-doctest -license: BSD3 -license-file: LICENSE -author: Oleg Grenrus -maintainer: Oleg Grenrus -copyright: (c) 2017 Oleg Grenrus -category: Distribution -build-type: Simple -cabal-version: >=1.10 -extra-source-files: - ChangeLog.md - README.md - -tested-with: GHC ==8.10.1 || >=7.4 && <8.10 || ==7.2.2 || ==7.0.4 - -source-repository head - type: git - location: https://github.com/phadej/cabal-doctest - -library - exposed-modules: Distribution.Extra.Doctest - other-modules: - other-extensions: - build-depends: - base >=4.3 && <4.16 - , Cabal >=1.10 && <3.8 - , Cabal-syntax >=1.10 && <3.8 - , directory - , filepath - - hs-source-dirs: src - default-language: Haskell2010 - ghc-options: -Wall - - if !impl(ghc >=7.2) - -- Work around a pattern-match coverage checking bug in GHC 7.0 - ghc-options: -fno-warn-overlapping-patterns diff --git a/vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs b/vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs deleted file mode 100644 index 3552b70e6c5..00000000000 --- a/vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs +++ /dev/null @@ -1,552 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE OverloadedStrings #-} --- | The provided 'generateBuildModule' generates 'Build_doctests' module. --- That module exports enough configuration, so your doctests could be simply --- --- @ --- module Main where --- --- import Build_doctests (flags, pkgs, module_sources) --- import Data.Foldable (traverse_) --- import Test.Doctest (doctest) --- --- main :: IO () --- main = do --- traverse_ putStrLn args -- optionally print arguments --- doctest args --- where --- args = flags ++ pkgs ++ module_sources --- @ --- --- To use this library in the @Setup.hs@, you should specify a @custom-setup@ --- section in the cabal file, for example: --- --- @ --- custom-setup --- setup-depends: --- base >= 4 && <5, --- cabal-doctest >= 1 && <1.1 --- @ --- --- /Note:/ you don't need to depend on @Cabal@ if you use only --- 'defaultMainWithDoctests' in the @Setup.hs@. --- -module Distribution.Extra.Doctest ( - defaultMainWithDoctests, - defaultMainAutoconfWithDoctests, - addDoctestsUserHook, - doctestsUserHooks, - generateBuildModule, - ) where - --- Hacky way to suppress few deprecation warnings. -#if MIN_VERSION_Cabal(1,24,0) -#define InstalledPackageId UnitId -#endif - -import Control.Monad - (when) -import Data.IORef - (modifyIORef, newIORef, readIORef) -import Data.List - (nub) -import Data.Maybe - (mapMaybe, maybeToList) -import Data.String - (fromString) -import Distribution.Package - (InstalledPackageId, Package (..)) -import Distribution.PackageDescription - (BuildInfo (..), Executable (..), GenericPackageDescription, - Library (..), PackageDescription, TestSuite (..)) -import Distribution.Simple - (UserHooks (..), autoconfUserHooks, defaultMainWithHooks, - simpleUserHooks) -import Distribution.Simple.Compiler - (CompilerFlavor (GHC), CompilerId (..), PackageDB (..), compilerId) -import Distribution.Simple.LocalBuildInfo - (ComponentLocalBuildInfo (componentPackageDeps), LocalBuildInfo, - compiler, withExeLBI, withLibLBI, withPackageDB, withTestLBI) -import Distribution.Simple.Setup - (BuildFlags (buildDistPref, buildVerbosity), - HaddockFlags (haddockDistPref, haddockVerbosity), emptyBuildFlags, - fromFlag) -import Distribution.Simple.Utils - (createDirectoryIfMissingVerbose, info) -import Distribution.Text - (display) -import System.FilePath - (()) - -import qualified Data.Foldable as F - (for_) -import qualified Data.Traversable as T - (traverse) - -#if MIN_VERSION_Cabal(1,25,0) -import Distribution.Simple.BuildPaths - (autogenComponentModulesDir) -#else -import Distribution.Simple.BuildPaths - (autogenModulesDir) -#endif - -#if MIN_VERSION_Cabal(2,0,0) -import Distribution.Types.MungedPackageId - (MungedPackageId) -import Distribution.Types.UnqualComponentName - (unUnqualComponentName) - --- For amendGPD -import Distribution.PackageDescription - (CondTree (..)) -import Distribution.Types.GenericPackageDescription - (GenericPackageDescription (condTestSuites)) - -import Distribution.Version - (mkVersion) -#else -import Data.Version - (Version (..)) -import Distribution.Package - (PackageId) -#endif - -#if MIN_VERSION_Cabal(3,0,0) -import Distribution.Simple.Utils - (findFileEx) -#else -import Distribution.Simple.Utils - (findFile) -#endif - -#if MIN_VERSION_Cabal(3,0,0) -import Distribution.Types.LibraryName - (libraryNameString) -#endif - -#if MIN_VERSION_Cabal(3,5,0) -import Distribution.Utils.Path - (getSymbolicPath) -#endif - -#if MIN_VERSION_directory(1,2,2) -import System.Directory - (makeAbsolute) -#else -import System.Directory - (getCurrentDirectory) -import System.FilePath - (isAbsolute) - -makeAbsolute :: FilePath -> IO FilePath -makeAbsolute p | isAbsolute p = return p - | otherwise = do - cwd <- getCurrentDirectory - return $ cwd p -#endif - -#if !MIN_VERSION_Cabal(3,0,0) -findFileEx :: verbosity -> [FilePath] -> FilePath -> IO FilePath -findFileEx _ = findFile -#endif - -#if !MIN_VERSION_Cabal(2,0,0) -mkVersion :: [Int] -> Version -mkVersion ds = Version ds [] -#endif - -#if !MIN_VERSION_Cabal(3,5,0) -getSymbolicPath :: FilePath -> FilePath -getSymbolicPath = id -#endif - -------------------------------------------------------------------------------- --- Mains -------------------------------------------------------------------------------- - --- | A default main with doctests: --- --- @ --- import Distribution.Extra.Doctest --- (defaultMainWithDoctests) --- --- main :: IO () --- main = defaultMainWithDoctests "doctests" --- @ -defaultMainWithDoctests - :: String -- ^ doctests test-suite name - -> IO () -defaultMainWithDoctests = defaultMainWithHooks . doctestsUserHooks - --- | Like 'defaultMainWithDoctests', for 'build-type: Configure' packages. --- --- @since 1.0.2 -defaultMainAutoconfWithDoctests - :: String -- ^ doctests test-suite name - -> IO () -defaultMainAutoconfWithDoctests n = - defaultMainWithHooks (addDoctestsUserHook n autoconfUserHooks) - --- | 'simpleUserHooks' with 'generateBuildModule' prepended to the 'buildHook'. -doctestsUserHooks - :: String -- ^ doctests test-suite name - -> UserHooks -doctestsUserHooks testsuiteName = - addDoctestsUserHook testsuiteName simpleUserHooks - --- | --- --- @since 1.0.2 -addDoctestsUserHook :: String -> UserHooks -> UserHooks -addDoctestsUserHook testsuiteName uh = uh - { buildHook = \pkg lbi hooks flags -> do - generateBuildModule testsuiteName flags pkg lbi - buildHook uh pkg lbi hooks flags - -- We use confHook to add "Build_Doctests" to otherModules and autogenModules. - -- - -- We cannot use HookedBuildInfo as it let's alter only the library and executables. - , confHook = \(gpd, hbi) flags -> - confHook uh (amendGPD testsuiteName gpd, hbi) flags - , haddockHook = \pkg lbi hooks flags -> do - generateBuildModule testsuiteName (haddockToBuildFlags flags) pkg lbi - haddockHook uh pkg lbi hooks flags - } - --- | Convert only flags used by 'generateBuildModule'. -haddockToBuildFlags :: HaddockFlags -> BuildFlags -haddockToBuildFlags f = emptyBuildFlags - { buildVerbosity = haddockVerbosity f - , buildDistPref = haddockDistPref f - } - -data Name = NameLib (Maybe String) | NameExe String deriving (Eq, Show) - -nameToString :: Name -> String -nameToString n = case n of - NameLib x -> maybe "" (("_lib_" ++) . map fixchar) x - NameExe x -> "_exe_" ++ map fixchar x - where - -- Taken from Cabal: - -- https://github.com/haskell/cabal/blob/20de0bfea72145ba1c37e3f500cee5258cc18e51/Cabal/Distribution/Simple/Build/Macros.hs#L156-L158 - -- - -- Needed to fix component names with hyphens in them, as hyphens aren't - -- allowed in Haskell identifier names. - fixchar :: Char -> Char - fixchar '-' = '_' - fixchar c = c - -data Component = Component Name [String] [String] [String] - deriving Show - --- | Generate a build module for the test suite. --- --- @ --- import Distribution.Simple --- (defaultMainWithHooks, UserHooks(..), simpleUserHooks) --- import Distribution.Extra.Doctest --- (generateBuildModule) --- --- main :: IO () --- main = defaultMainWithHooks simpleUserHooks --- { buildHook = \pkg lbi hooks flags -> do --- generateBuildModule "doctests" flags pkg lbi --- buildHook simpleUserHooks pkg lbi hooks flags --- } --- @ -generateBuildModule - :: String -- ^ doctests test-suite name - -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () -generateBuildModule testSuiteName flags pkg lbi = do - let verbosity = fromFlag (buildVerbosity flags) - let distPref = fromFlag (buildDistPref flags) - - -- Package DBs & environments - let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref "package.conf.inplace" ] - let dbFlags = "-hide-all-packages" : packageDbArgs dbStack - let envFlags - | ghcCanBeToldToIgnorePkgEnvs = [ "-package-env=-" ] - | otherwise = [] - - withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == fromString testSuiteName) $ do -#if MIN_VERSION_Cabal(1,25,0) - let testAutogenDir = autogenComponentModulesDir lbi suitecfg -#else - let testAutogenDir = autogenModulesDir lbi -#endif - - createDirectoryIfMissingVerbose verbosity True testAutogenDir - - let buildDoctestsFile = testAutogenDir "Build_doctests.hs" - - -- First, we create the autogen'd module Build_doctests. - -- Initially populate Build_doctests with a simple preamble. - info verbosity $ "cabal-doctest: writing Build_doctests to " ++ buildDoctestsFile - writeFile buildDoctestsFile $ unlines - [ "module Build_doctests where" - , "" - , "import Prelude" - , "" - , "data Name = NameLib (Maybe String) | NameExe String deriving (Eq, Show)" - , "data Component = Component Name [String] [String] [String] deriving (Eq, Show)" - , "" - ] - - -- we cannot traverse, only traverse_ - -- so we use IORef to collect components - componentsRef <- newIORef [] - - let testBI = testBuildInfo suite - - -- TODO: `words` is not proper parser (no support for quotes) - let additionalFlags = maybe [] words - $ lookup "x-doctest-options" - $ customFieldsBI testBI - - let additionalModules = maybe [] words - $ lookup "x-doctest-modules" - $ customFieldsBI testBI - - let additionalDirs' = maybe [] words - $ lookup "x-doctest-source-dirs" - $ customFieldsBI testBI - - additionalDirs <- mapM (fmap ("-i" ++) . makeAbsolute) additionalDirs' - - -- Next, for each component (library or executable), we get to Build_doctests - -- the sets of flags needed to run doctest on that component. - let getBuildDoctests withCompLBI mbCompName compExposedModules compMainIs compBuildInfo = - withCompLBI pkg lbi $ \comp compCfg -> do - let compBI = compBuildInfo comp - - -- modules - let modules = compExposedModules comp ++ otherModules compBI - -- it seems that doctest is happy to take in module names, not actual files! - let module_sources = modules - - -- We need the directory with the component's cabal_macros.h! -#if MIN_VERSION_Cabal(1,25,0) - let compAutogenDir = autogenComponentModulesDir lbi compCfg -#else - let compAutogenDir = autogenModulesDir lbi -#endif - - -- Lib sources and includes - iArgsNoPrefix - <- mapM makeAbsolute - $ compAutogenDir -- autogenerated files - : (distPref ++ "/build") -- preprocessed files (.hsc -> .hs); "build" is hardcoded in Cabal. - : map getSymbolicPath (hsSourceDirs compBI) - includeArgs <- mapM (fmap ("-I"++) . makeAbsolute) $ includeDirs compBI - -- We clear all includes, so the CWD isn't used. - let iArgs' = map ("-i"++) iArgsNoPrefix - iArgs = "-i" : iArgs' - - -- default-extensions - let extensionArgs = map (("-X"++) . display) $ defaultExtensions compBI - - -- CPP includes, i.e. include cabal_macros.h - let cppFlags = map ("-optP"++) $ - [ "-include", compAutogenDir ++ "/cabal_macros.h" ] - ++ cppOptions compBI - - -- Unlike other modules, the main-is module of an executable is not - -- guaranteed to share a module name with its filepath name. That is, - -- even though the main-is module is named Main, its filepath might - -- actually be Something.hs. To account for this possibility, we simply - -- pass the full path to the main-is module instead. - mainIsPath <- T.traverse (findFileEx verbosity iArgsNoPrefix) (compMainIs comp) - - let all_sources = map display module_sources - ++ additionalModules - ++ maybeToList mainIsPath - - let component = Component - (mbCompName comp) - (formatDeps $ testDeps compCfg suitecfg) - (concat - [ iArgs - , additionalDirs - , includeArgs - , envFlags - , dbFlags - , cppFlags - , extensionArgs - , additionalFlags - ]) - all_sources - - -- modify IORef, append component - modifyIORef componentsRef (\cs -> cs ++ [component]) - - -- For now, we only check for doctests in libraries and executables. - getBuildDoctests withLibLBI mbLibraryName exposedModules (const Nothing) libBuildInfo - getBuildDoctests withExeLBI (NameExe . executableName) (const []) (Just . modulePath) buildInfo - - components <- readIORef componentsRef - F.for_ components $ \(Component cmpName cmpPkgs cmpFlags cmpSources) -> do - let compSuffix = nameToString cmpName - pkgs_comp = "pkgs" ++ compSuffix - flags_comp = "flags" ++ compSuffix - module_sources_comp = "module_sources" ++ compSuffix - - -- write autogen'd file - appendFile buildDoctestsFile $ unlines - [ -- -package-id etc. flags - pkgs_comp ++ " :: [String]" - , pkgs_comp ++ " = " ++ show cmpPkgs - , "" - , flags_comp ++ " :: [String]" - , flags_comp ++ " = " ++ show cmpFlags - , "" - , module_sources_comp ++ " :: [String]" - , module_sources_comp ++ " = " ++ show cmpSources - , "" - ] - - -- write enabled components, i.e. x-doctest-components - -- if none enabled, pick library - let enabledComponents = maybe [NameLib Nothing] (mapMaybe parseComponentName . words) - $ lookup "x-doctest-components" - $ customFieldsBI testBI - - let components' = - filter (\(Component n _ _ _) -> n `elem` enabledComponents) components - appendFile buildDoctestsFile $ unlines - [ "-- " ++ show enabledComponents - , "components :: [Component]" - , "components = " ++ show components' - ] - - where - parseComponentName :: String -> Maybe Name - parseComponentName "lib" = Just (NameLib Nothing) - parseComponentName ('l' : 'i' : 'b' : ':' : x) = Just (NameLib (Just x)) - parseComponentName ('e' : 'x' : 'e' : ':' : x) = Just (NameExe x) - parseComponentName _ = Nothing - - -- we do this check in Setup, as then doctests don't need to depend on Cabal - isNewCompiler = case compilerId $ compiler lbi of - CompilerId GHC v -> v >= mkVersion [7,6] - _ -> False - - ghcCanBeToldToIgnorePkgEnvs :: Bool - ghcCanBeToldToIgnorePkgEnvs = case compilerId $ compiler lbi of - CompilerId GHC v -> v >= mkVersion [8,4,4] - _ -> False - - formatDeps = map formatOne - formatOne (installedPkgId, pkgId) - -- The problem is how different cabal executables handle package databases - -- when doctests depend on the library - -- - -- If the pkgId is current package, we don't output the full package-id - -- but only the name - -- - -- Because of MungedPackageId we compare display version of identifiers - -- not the identifiers themfselves. - | display (packageId pkg) == display pkgId = "-package=" ++ display pkgId - | otherwise = "-package-id=" ++ display installedPkgId - - -- From Distribution.Simple.Program.GHC - packageDbArgs :: [PackageDB] -> [String] - packageDbArgs | isNewCompiler = packageDbArgsDb - | otherwise = packageDbArgsConf - - -- GHC <7.6 uses '-package-conf' instead of '-package-db'. - packageDbArgsConf :: [PackageDB] -> [String] - packageDbArgsConf dbstack = case dbstack of - (GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs - (GlobalPackageDB:dbs) -> ("-no-user-package-conf") - : concatMap specific dbs - _ -> ierror - where - specific (SpecificPackageDB db) = [ "-package-conf=" ++ db ] - specific _ = ierror - ierror = error $ "internal error: unexpected package db stack: " - ++ show dbstack - - -- GHC >= 7.6 uses the '-package-db' flag. See - -- https://ghc.haskell.org/trac/ghc/ticket/5977. - packageDbArgsDb :: [PackageDB] -> [String] - -- special cases to make arguments prettier in common scenarios - packageDbArgsDb dbstack = case dbstack of - (GlobalPackageDB:UserPackageDB:dbs) - | all isSpecific dbs -> concatMap single dbs - (GlobalPackageDB:dbs) - | all isSpecific dbs -> "-no-user-package-db" - : concatMap single dbs - dbs -> "-clear-package-db" - : concatMap single dbs - where - single (SpecificPackageDB db) = [ "-package-db=" ++ db ] - single GlobalPackageDB = [ "-global-package-db" ] - single UserPackageDB = [ "-user-package-db" ] - isSpecific (SpecificPackageDB _) = True - isSpecific _ = False - - mbLibraryName :: Library -> Name -#if MIN_VERSION_Cabal(3,0,0) - mbLibraryName = NameLib . fmap unUnqualComponentName . libraryNameString . libName -#elif MIN_VERSION_Cabal(2,0,0) - -- Cabal-2.0 introduced internal libraries, which are named. - mbLibraryName = NameLib . fmap unUnqualComponentName . libName -#else - -- Before that, there was only ever at most one library per - -- .cabal file, which has no name. - mbLibraryName _ = NameLib Nothing -#endif - - executableName :: Executable -> String -#if MIN_VERSION_Cabal(2,0,0) - executableName = unUnqualComponentName . exeName -#else - executableName = exeName -#endif - --- | In compat settings it's better to omit the type-signature -testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -#if MIN_VERSION_Cabal(2,0,0) - -> [(InstalledPackageId, MungedPackageId)] -#else - -> [(InstalledPackageId, PackageId)] -#endif -testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys - -amendGPD - :: String -- ^ doctests test-suite name - -> GenericPackageDescription - -> GenericPackageDescription -#if !(MIN_VERSION_Cabal(2,0,0)) -amendGPD _ gpd = gpd -#else -amendGPD testSuiteName gpd = gpd - { condTestSuites = map f (condTestSuites gpd) - } - where - f (name, condTree) - | name == fromString testSuiteName = (name, condTree') - | otherwise = (name, condTree) - where - -- I miss 'lens' - testSuite = condTreeData condTree - bi = testBuildInfo testSuite - om = otherModules bi - am = autogenModules bi - - -- Cons the module to both other-modules and autogen-modules. - -- At the moment, cabal-spec-2.0 and cabal-spec-2.2 don't have - -- "all autogen-modules are other-modules if they aren't exposed-modules" - -- rule. Hopefully cabal-spec-3.0 will have. - -- - -- Note: we `nub`, because it's unclear if that's ok to have duplicate - -- modules in the lists. - om' = nub $ mn : om - am' = nub $ mn : am - - mn = fromString "Build_doctests" - - bi' = bi { otherModules = om', autogenModules = am' } - testSuite' = testSuite { testBuildInfo = bi' } - condTree' = condTree { condTreeData = testSuite' } -#endif From 450fb9f15560ece9b5cb00980977376cc65e98cd Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Tue, 8 Feb 2022 22:09:27 +0800 Subject: [PATCH 14/34] Mark GHC 9.2.1 as experimental --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index efc4d6df359..7154adaa317 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -20,6 +20,7 @@ jobs: - ghc: "9.2.1" flags: "" cli: true + experimental: true - ghc: "9.0.2" flags: "" cli: true From f89353bb67ef4b2bf936aae1577badc50f5e1f56 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Wed, 9 Feb 2022 10:03:45 +0800 Subject: [PATCH 15/34] Remove reference to cabal-plan from validate.sh --- validate.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/validate.sh b/validate.sh index ec08aef9657..023679b5b05 100755 --- a/validate.sh +++ b/validate.sh @@ -6,7 +6,6 @@ HC=ghc-8.2.2 CABAL=cabal -CABALPLAN=cabal-plan JOBS=4 LIBTESTS=true CLITESTS=true @@ -44,7 +43,6 @@ Available options: --(no-)run-cli-suite Run cabal-testsuite with client -w, --with-compiler HC With compiler --with-cabal CABAL With cabal-install - --with-cabal-plan CABALPLAN With cabal-plan --extra-hc HC Extra compiler to run test-suite with --(no-)doctest Run doctest on library --(no-)solver-benchmarks Build and trial run solver-benchmarks @@ -190,11 +188,6 @@ while [ $# -gt 0 ]; do shift shift ;; - --with-cabal-plan) - CABALPLAN=$2 - shift - shift - ;; --extra-hc) EXTRAHCS="$EXTRAHCS $2" shift @@ -319,7 +312,6 @@ cat < Date: Wed, 9 Feb 2022 10:11:00 +0800 Subject: [PATCH 16/34] setup-haskell action already runs cabal update --- .github/workflows/linux.yml | 3 --- .github/workflows/macos.yml | 3 --- .github/workflows/windows.yml | 2 -- 3 files changed, 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7154adaa317..eb86abba46e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -55,9 +55,6 @@ jobs: run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - name: Update Hackage index - run: cabal v2-update - - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e405a3c4301..85cde69dc9b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -30,9 +30,6 @@ jobs: ghc-version: ${{ matrix.ghc }} cabal-version: latest - - name: Update Hackage index - run: cabal v2-update - - uses: actions/checkout@v2 - name: Validate print-config diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d40dd3de865..3215be6d19d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -34,8 +34,6 @@ jobs: with: path: C:\SR key: windows-store-meta - - name: Update Hackage index - run: cabal v2-update - uses: actions/checkout@v2 # all dependencies of Cabal already there (due to GHC depending on Cabal) - name: cabal v2-build Cabal From 576d3f1f6ca91bb85a5164215e08ca49eeb41c43 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Wed, 9 Feb 2022 10:15:33 +0800 Subject: [PATCH 17/34] Add missing build matrix in test-windows-dogfood --- .github/workflows/windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3215be6d19d..ad208042ab8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -68,6 +68,11 @@ jobs: # TODO: store the exe from above as artifact and re-use it here instead of building anew test-windows-dogfood: + strategy: + matrix: + ghc: + - "8.6.5" + - "8.10.4" name: test ghc-${{ matrix.ghc }} dogfood runs-on: windows-latest steps: From 3c8dd207c39d0a056192ee4c744ff5fa653290c3 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Wed, 9 Feb 2022 11:50:24 +0800 Subject: [PATCH 18/34] Replace cabal-plan list-bin with cabal list-bin --- validate.sh | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/validate.sh b/validate.sh index 023679b5b05..a6bcddc11d9 100755 --- a/validate.sh +++ b/validate.sh @@ -300,7 +300,7 @@ BUILDDIR=dist-newstyle-validate-$BASEHC CABAL_TESTSUITE_BDIR="$(pwd)/$BUILDDIR/build/$ARCH/$BASEHC/cabal-testsuite-3" CABALNEWBUILD="${CABAL} v2-build $JOBS -w $HC --builddir=$BUILDDIR --project-file=$PROJECTFILE" -CABALPLANLISTBIN="${CABALPLAN} list-bin --builddir=$BUILDDIR" +CABALLISTBIN="${CABAL} list-bin --builddir=$BUILDDIR" # header ####################################################################### @@ -331,7 +331,6 @@ print_header print-tool-versions timed $HC --version timed $CABAL --version -timed $CABALPLAN --version for EXTRAHC in $EXTRAHCS; do timed $EXTRAHC --version @@ -369,22 +368,22 @@ timed doctest -package-env=doctest-Cabal --fast Cabal/Distribution Cabal/Languag step_lib_tests() { print_header "Cabal: tests" -CMD="$($CABALPLANLISTBIN Cabal-tests:test:unit-tests) $TESTSUITEJOBS --hide-successes --with-ghc=$HC" +CMD="$($CABALLISTBIN Cabal-tests:test:unit-tests) $TESTSUITEJOBS --hide-successes --with-ghc=$HC" (cd Cabal-tests && timed $CMD) || exit 1 -CMD="$($CABALPLANLISTBIN Cabal-tests:test:check-tests) $TESTSUITEJOBS --hide-successes" +CMD="$($CABALLISTBIN Cabal-tests:test:check-tests) $TESTSUITEJOBS --hide-successes" (cd Cabal-tests && timed $CMD) || exit 1 -CMD="$($CABALPLANLISTBIN Cabal-tests:test:parser-tests) $TESTSUITEJOBS --hide-successes" +CMD="$($CABALLISTBIN Cabal-tests:test:parser-tests) $TESTSUITEJOBS --hide-successes" (cd Cabal-tests && timed $CMD) || exit 1 -CMD="$($CABALPLANLISTBIN Cabal-tests:test:rpmvercmp) $TESTSUITEJOBS --hide-successes" +CMD="$($CABALLISTBIN Cabal-tests:test:rpmvercmp) $TESTSUITEJOBS --hide-successes" (cd Cabal-tests && timed $CMD) || exit 1 -CMD="$($CABALPLANLISTBIN Cabal-tests:test:no-thunks-test) $TESTSUITEJOBS --hide-successes" +CMD="$($CABALLISTBIN Cabal-tests:test:no-thunks-test) $TESTSUITEJOBS --hide-successes" (cd Cabal-tests && timed $CMD) || exit 1 -CMD=$($CABALPLANLISTBIN Cabal-tests:test:hackage-tests) +CMD=$($CABALLISTBIN Cabal-tests:test:hackage-tests) (cd Cabal-tests && timed $CMD read-fields) || exit 1 if $HACKAGETESTSALL; then @@ -402,14 +401,14 @@ fi step_lib_suite() { print_header "Cabal: cabal-testsuite" -CMD="$($CABALPLANLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR $TESTSUITEJOBS --with-ghc=$HC --hide-successes" +CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR $TESTSUITEJOBS --with-ghc=$HC --hide-successes" (cd cabal-testsuite && timed $CMD) || exit 1 } step_lib_suite_extras() { for EXTRAHC in $EXTRAHCS; do -CMD="$($CABALPLANLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR $TESTSUITEJOBS --with-ghc=$EXTRAHC --hide-successes" +CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR $TESTSUITEJOBS --with-ghc=$EXTRAHC --hide-successes" (cd cabal-testsuite && timed $CMD) || exit 1 done @@ -422,19 +421,19 @@ step_cli_tests() { print_header "cabal-install: tests" # this are sorted in asc time used, quicker tests first. -CMD="$($CABALPLANLISTBIN cabal-install:test:long-tests) $TESTSUITEJOBS --hide-successes" +CMD="$($CABALLISTBIN cabal-install:test:long-tests) $TESTSUITEJOBS --hide-successes" (cd cabal-install && timed $CMD) || exit 1 # This doesn't work in parallel either -CMD="$($CABALPLANLISTBIN cabal-install:test:unit-tests) -j1 --hide-successes" +CMD="$($CABALLISTBIN cabal-install:test:unit-tests) -j1 --hide-successes" (cd cabal-install && timed $CMD) || exit 1 # Only single job, otherwise we fail with "Heap exhausted" -CMD="$($CABALPLANLISTBIN cabal-install:test:memory-usage-tests) -j1 --hide-successes" +CMD="$($CABALLISTBIN cabal-install:test:memory-usage-tests) -j1 --hide-successes" (cd cabal-install && timed $CMD) || exit 1 # This test-suite doesn't like concurrency -CMD="$($CABALPLANLISTBIN cabal-install:test:integration-tests2) -j1 --hide-successes --with-ghc=$HC" +CMD="$($CABALLISTBIN cabal-install:test:integration-tests2) -j1 --hide-successes --with-ghc=$HC" (cd cabal-install && timed $CMD) || exit 1 } @@ -444,7 +443,7 @@ CMD="$($CABALPLANLISTBIN cabal-install:test:integration-tests2) -j1 --hide-succe step_cli_suite() { print_header "cabal-install: cabal-testsuite" -CMD="$($CABALPLANLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR --with-cabal=$($CABALPLANLISTBIN cabal-install:exe:cabal) $TESTSUITEJOBS --hide-successes" +CMD="$($CABALLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TESTSUITE_BDIR --with-cabal=$($CABALLISTBIN cabal-install:exe:cabal) $TESTSUITEJOBS --hide-successes" (cd cabal-testsuite && timed $CMD) || exit 1 } @@ -454,7 +453,7 @@ CMD="$($CABALPLANLISTBIN cabal-testsuite:exe:cabal-tests) --builddir=$CABAL_TEST step_solver_benchmarks_tests() { print_header "solver-benchmarks: test" -CMD="$($CABALPLANLISTBIN solver-benchmarks:test:unit-tests)" +CMD="$($CABALLISTBIN solver-benchmarks:test:unit-tests)" (cd Cabal && timed $CMD) || exit 1 } @@ -462,7 +461,7 @@ step_solver_benchmarks_run() { print_header "solver-benchmarks: run" SOLVEPKG=Chart-diagrams -CMD="$($CABALPLANLISTBIN solver-benchmarks:exe:hackage-benchmark) --cabal1=$CABAL --cabal2=$($CABALPLANLISTBIN cabal-install:exe:cabal) --trials=5 --packages=$SOLVEPKG --print-trials" +CMD="$($CABALLISTBIN solver-benchmarks:exe:hackage-benchmark) --cabal1=$CABAL --cabal2=$($CABALLISTBIN cabal-install:exe:cabal) --trials=5 --packages=$SOLVEPKG --print-trials" (cd Cabal && timed $CMD) || exit 1 } From b38aa307fc5bd8a9f297802b89a6afb81cc9d0e2 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Wed, 9 Feb 2022 11:51:42 +0800 Subject: [PATCH 19/34] Enable caching in the CI --- .github/workflows/linux.yml | 19 +++++++++++++++---- .github/workflows/macos.yml | 21 ++++++++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index eb86abba46e..0352b0a70b7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -12,7 +12,9 @@ on: jobs: validate: name: Validate ${{ matrix.ghc }} + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} strategy: matrix: @@ -44,16 +46,25 @@ jobs: cli: false steps: + - uses: actions/checkout@v2 - uses: haskell/actions/setup@v1 with: ghc-version: ${{ matrix.ghc }} - cabal-version: latest + cabal-version: latest # default, keeping for visibility - - name: Set PATH - run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH + # See the following link for a breakdown of the following step + # https://github.com/haskell/actions/issues/7#issuecomment-745697160 + - uses: actions/cache@v2 + with: + path: | + ${{ steps.setup-haskell.outputs.cabal-store }} + dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} + ${{ runner.os }}-${{ matrix.ghc }}- - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 85cde69dc9b..5de1f4b4d53 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,8 +11,10 @@ on: jobs: validate: - name: validate ghc-${{ matrix.ghc }} + name: Validate ghc-${{ matrix.ghc }} + runs-on: macos-latest + strategy: matrix: ghc: @@ -25,12 +27,25 @@ jobs: - "8.0.2" steps: + + - uses: actions/checkout@v2 + - uses: haskell/actions/setup@v1 with: ghc-version: ${{ matrix.ghc }} - cabal-version: latest + cabal-version: latest # default, keeping for visibility - - uses: actions/checkout@v2 + # See the following link for a breakdown of the following step + # https://github.com/haskell/actions/issues/7#issuecomment-745697160 + - uses: actions/cache@v2 + with: + path: | + ${{ steps.setup-haskell.outputs.cabal-store }} + dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} + ${{ runner.os }}-${{ matrix.ghc }}- - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-config From c9ff962bb3d0a4757cc77bd6ab345dd7a2756a55 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Wed, 9 Feb 2022 12:12:38 +0800 Subject: [PATCH 20/34] Fix typo --- .github/workflows/macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5de1f4b4d53..b7cd6c31f2e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -50,8 +50,8 @@ jobs: - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-config - - name: Validate print-tool-version - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-tool-version + - name: Validate print-tool-versions + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-tool-versions - name: Validate build run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s build From 8505cc53b0ff749fc98e1771e96d6100a7d333e0 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 10 Feb 2022 14:03:25 +0800 Subject: [PATCH 21/34] Remove continue-on-error until I figure it out --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 0352b0a70b7..ed76722bb1d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,10 +14,10 @@ jobs: name: Validate ${{ matrix.ghc }} runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} strategy: matrix: + ghc: [] include: - ghc: "9.2.1" flags: "" From f0c1e82d6209abcbc06d74a3bec6647e5c2fd6bf Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 10 Feb 2022 14:05:51 +0800 Subject: [PATCH 22/34] Keep naming consistent --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ed76722bb1d..b14e6149633 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -11,7 +11,7 @@ on: jobs: validate: - name: Validate ${{ matrix.ghc }} + name: Validate ghc-${{ matrix.ghc }} runs-on: ubuntu-latest From fb88bd4b6e53d464f7da688d980b3e19dd7f6319 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 10 Feb 2022 14:07:41 +0800 Subject: [PATCH 23/34] Temporarily disable 8.0.2 on macos --- .github/workflows/macos.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b7cd6c31f2e..43f635f26fb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -24,7 +24,9 @@ jobs: - "8.8.4" - "8.6.5" - "8.2.2" - - "8.0.2" + # - "8.0.2" disabled because no-cli suite + # TODO merge with linux.yml and use the same logic for both + # platforms steps: From 0b442947166b06c3837d05f2f5f81c7f760df433 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 11 Feb 2022 08:36:28 +0800 Subject: [PATCH 24/34] Add missing step id --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b14e6149633..c93b9921e36 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -50,6 +50,7 @@ jobs: - uses: actions/checkout@v2 - uses: haskell/actions/setup@v1 + id: setup-haskell with: ghc-version: ${{ matrix.ghc }} cabal-version: latest # default, keeping for visibility From 760ec1b8d15e4f3e35a7d1bef3645adaaabc4d2d Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Sat, 12 Feb 2022 23:44:21 +0800 Subject: [PATCH 25/34] Tweaks Remove workaround for nektos/act, it accidentally sneaked in. --- .github/workflows/linux.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c93b9921e36..766996cbbc0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -17,7 +17,6 @@ jobs: strategy: matrix: - ghc: [] include: - ghc: "9.2.1" flags: "" From f002769987ff18defb479ea7fa4d3374383974ff Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Sun, 13 Feb 2022 20:56:01 +0800 Subject: [PATCH 26/34] More tweaks --- .github/workflows/linux.yml | 24 ++++++++++----- .github/workflows/macos.yml | 61 ++++++++++++++++++++++++++----------- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 766996cbbc0..3f3387a2b45 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,35 +14,43 @@ jobs: name: Validate ghc-${{ matrix.ghc }} runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} strategy: matrix: include: - ghc: "9.2.1" - flags: "" cli: true experimental: true + flags: "" - ghc: "9.0.2" + cli: false + experimental: false flags: "" - cli: true - ghc: "8.10.7" - flags: "" cli: true + experimental: false + flags: "" - ghc: "8.8.4" - flags: "--solver-benchmarks" cli: true + experimental: false + flags: "--solver-benchmarks" - ghc: "8.6.5" - flags: "--complete-hackage-tests" cli: true + experimental: false + flags: "--complete-hackage-tests" - ghc: "8.4.4" - flags: "" cli: true - - ghc: "8.2.2" + experimental: false flags: "" + - ghc: "8.2.2" cli: true + experimental: false + flags: "" - ghc: "8.0.2" - flags: "--lib-only" cli: false + experimental: false + flags: "--lib-only" steps: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 43f635f26fb..85c94cb992f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,25 +14,50 @@ jobs: name: Validate ghc-${{ matrix.ghc }} runs-on: macos-latest + continue-on-error: ${{ matrix.experimental }} strategy: matrix: - ghc: - - "9.2.1" - - "9.0.2" - - "8.10.7" - - "8.8.4" - - "8.6.5" - - "8.2.2" - # - "8.0.2" disabled because no-cli suite - # TODO merge with linux.yml and use the same logic for both - # platforms + include: + - ghc: "9.2.1" + cli: true + experimental: true + flags: "" + - ghc: "9.0.2" + cli: false + experimental: false + flags: "" + - ghc: "8.10.7" + cli: true + experimental: false + flags: "" + - ghc: "8.8.4" + cli: true + experimental: false + flags: "--solver-benchmarks" + - ghc: "8.6.5" + cli: true + experimental: false + flags: "--complete-hackage-tests" + - ghc: "8.4.4" + cli: true + experimental: false + flags: "" + - ghc: "8.2.2" + cli: true + experimental: false + flags: "" + - ghc: "8.0.2" + cli: false + experimental: false + flags: "--lib-only" steps: - uses: actions/checkout@v2 - uses: haskell/actions/setup@v1 + id: setup-haskell with: ghc-version: ${{ matrix.ghc }} cabal-version: latest # default, keeping for visibility @@ -50,23 +75,25 @@ jobs: ${{ runner.os }}-${{ matrix.ghc }}- - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-config + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-tool-versions - name: Validate build - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s build + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s build - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s lib-tests + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s lib-tests - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s lib-suite + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s lib-suite - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s cli-tests + if: matrix.cli == true + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s cli-tests - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v -s cli-suite + if: matrix.cli == true + run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s cli-suite From 7ce9ab787981caee7966cf96c69f02097b77afd3 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Sun, 13 Feb 2022 21:19:42 +0800 Subject: [PATCH 27/34] Tweaks --- .github/workflows/linux.yml | 6 ++---- .github/workflows/macos.yml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3f3387a2b45..5191eac4ccd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -26,7 +26,7 @@ jobs: - ghc: "9.0.2" cli: false experimental: false - flags: "" + flags: "--lib-only" - ghc: "8.10.7" cli: true experimental: false @@ -70,9 +70,7 @@ jobs: ${{ steps.setup-haskell.outputs.cabal-store }} dist-newstyle key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} - ${{ runner.os }}-${{ matrix.ghc }}- + restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 85c94cb992f..23cfde4ce80 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,7 +26,7 @@ jobs: - ghc: "9.0.2" cli: false experimental: false - flags: "" + flags: "--lib-only" - ghc: "8.10.7" cli: true experimental: false @@ -70,9 +70,7 @@ jobs: ${{ steps.setup-haskell.outputs.cabal-store }} dist-newstyle key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} - ${{ runner.os }}-${{ matrix.ghc }}- + restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config From 77ae21aeb44d695f47b21117e9601b32dccea988 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 14 Feb 2022 11:28:40 +0800 Subject: [PATCH 28/34] Restore cabal-plan, temporarily mark everything experimental cabal list-bin doesn't seem to work like cabal-plan does. --- .github/workflows/linux.yml | 19 ++++++++++------- .github/workflows/macos.yml | 19 ++++++++++------- validate.sh | 41 ++++++++++++++++++++++--------------- 3 files changed, 49 insertions(+), 30 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5191eac4ccd..dff9cf21422 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -25,31 +25,31 @@ jobs: flags: "" - ghc: "9.0.2" cli: false - experimental: false + experimental: true # FIXME for quick testing false flags: "--lib-only" - ghc: "8.10.7" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "" - ghc: "8.8.4" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "--solver-benchmarks" - ghc: "8.6.5" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "--complete-hackage-tests" - ghc: "8.4.4" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "" - ghc: "8.2.2" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "" - ghc: "8.0.2" cli: false - experimental: false + experimental: true # FIXME for quick testing false flags: "--lib-only" steps: @@ -72,6 +72,11 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- + - name: Install cabal-plan + run: | + cd $(mktemp -d) + cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' + - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 23cfde4ce80..3b8b91815c6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -25,31 +25,31 @@ jobs: flags: "" - ghc: "9.0.2" cli: false - experimental: false + experimental: true # FIXME for quick testing false flags: "--lib-only" - ghc: "8.10.7" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "" - ghc: "8.8.4" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "--solver-benchmarks" - ghc: "8.6.5" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "--complete-hackage-tests" - ghc: "8.4.4" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "" - ghc: "8.2.2" cli: true - experimental: false + experimental: true # FIXME for quick testing false flags: "" - ghc: "8.0.2" cli: false - experimental: false + experimental: true # FIXME for quick testing false flags: "--lib-only" steps: @@ -72,6 +72,11 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- + - name: Install cabal-plan + run: | + cd $(mktemp -d) + cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' + - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config diff --git a/validate.sh b/validate.sh index a6bcddc11d9..ec08aef9657 100755 --- a/validate.sh +++ b/validate.sh @@ -6,6 +6,7 @@ HC=ghc-8.2.2 CABAL=cabal +CABALPLAN=cabal-plan JOBS=4 LIBTESTS=true CLITESTS=true @@ -43,6 +44,7 @@ Available options: --(no-)run-cli-suite Run cabal-testsuite with client -w, --with-compiler HC With compiler --with-cabal CABAL With cabal-install + --with-cabal-plan CABALPLAN With cabal-plan --extra-hc HC Extra compiler to run test-suite with --(no-)doctest Run doctest on library --(no-)solver-benchmarks Build and trial run solver-benchmarks @@ -188,6 +190,11 @@ while [ $# -gt 0 ]; do shift shift ;; + --with-cabal-plan) + CABALPLAN=$2 + shift + shift + ;; --extra-hc) EXTRAHCS="$EXTRAHCS $2" shift @@ -300,7 +307,7 @@ BUILDDIR=dist-newstyle-validate-$BASEHC CABAL_TESTSUITE_BDIR="$(pwd)/$BUILDDIR/build/$ARCH/$BASEHC/cabal-testsuite-3" CABALNEWBUILD="${CABAL} v2-build $JOBS -w $HC --builddir=$BUILDDIR --project-file=$PROJECTFILE" -CABALLISTBIN="${CABAL} list-bin --builddir=$BUILDDIR" +CABALPLANLISTBIN="${CABALPLAN} list-bin --builddir=$BUILDDIR" # header ####################################################################### @@ -312,6 +319,7 @@ cat < Date: Mon, 14 Feb 2022 11:44:57 +0800 Subject: [PATCH 29/34] Tweaks --- .github/workflows/linux.yml | 3 ++- .github/workflows/macos.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dff9cf21422..b8a57bde8e5 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -75,7 +75,8 @@ jobs: - name: Install cabal-plan run: | cd $(mktemp -d) - cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' + cabal install cabal-plan + echo "$HOME/.cabal/bin" >> $GITHUB_PATH - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3b8b91815c6..2c95a042d0e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -75,7 +75,8 @@ jobs: - name: Install cabal-plan run: | cd $(mktemp -d) - cabal v2-install cabal-plan --constraint='cabal-plan ^>=0.6.2.0' --constraint='aeson +fast' --constraint='cabal-plan +exe' + cabal install cabal-plan + echo "$HOME/.cabal/bin" >> $GITHUB_PATH - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config From 680e16b16ce7d1ed9af31a171a853473839195ff Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 14 Feb 2022 12:02:17 +0800 Subject: [PATCH 30/34] Ensure cabal-plan executable gets built --- .github/workflows/linux.yml | 5 ++++- .github/workflows/macos.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b8a57bde8e5..729ebf98319 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -72,10 +72,13 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- + # The '+exe' constraint below is important, otherwise cabal-install + # might decide to build the library but not the executable which is + # what we need. - name: Install cabal-plan run: | cd $(mktemp -d) - cabal install cabal-plan + cabal install cabal-plan --constraint='cabal-plan +exe' echo "$HOME/.cabal/bin" >> $GITHUB_PATH - name: Validate print-config diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2c95a042d0e..752c6857821 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -72,10 +72,13 @@ jobs: key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }} restore-keys: ${{ runner.os }}-${{ matrix.ghc }}- + # The '+exe' constraint below is important, otherwise cabal-install + # might decide to build the library but not the executable which is + # what we need. - name: Install cabal-plan run: | cd $(mktemp -d) - cabal install cabal-plan + cabal install cabal-plan --constraint='cabal-plan +exe' echo "$HOME/.cabal/bin" >> $GITHUB_PATH - name: Validate print-config From 662fcefb16c2efd7a31b487f36e4934bd19ad05d Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Mon, 14 Feb 2022 12:30:58 +0800 Subject: [PATCH 31/34] Install automake on MacOS --- .github/workflows/macos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 752c6857821..78be3805ffe 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -81,6 +81,11 @@ jobs: cabal install cabal-plan --constraint='cabal-plan +exe' echo "$HOME/.cabal/bin" >> $GITHUB_PATH + # Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs + - name: Install Autotools + run: | + brew install automake + - name: Validate print-config run: sh validate.sh -j 2 -w ghc-${{ matrix.ghc }} -v ${{ matrix.flags }} -s print-config From 1439b590b06d21018d33b44b78f2921467d04156 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Wed, 16 Feb 2022 22:56:48 +0800 Subject: [PATCH 32/34] Tweaks --- .github/workflows/linux.yml | 20 ++++++++++++-------- .github/workflows/macos.yml | 19 +++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 729ebf98319..c9f3f86ce80 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -21,35 +21,39 @@ jobs: include: - ghc: "9.2.1" cli: true - experimental: true + experimental: true # work to be done flags: "" - ghc: "9.0.2" cli: false - experimental: true # FIXME for quick testing false + experimental: true # failure to be investigated, see #7952 + flags: "--lib-only" + - ghc: "9.0.1" + cli: false + experimental: false flags: "--lib-only" - ghc: "8.10.7" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "" - ghc: "8.8.4" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "--solver-benchmarks" - ghc: "8.6.5" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "--complete-hackage-tests" - ghc: "8.4.4" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "" - ghc: "8.2.2" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "" - ghc: "8.0.2" cli: false - experimental: true # FIXME for quick testing false + experimental: false flags: "--lib-only" steps: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 78be3805ffe..58e9ca6c437 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -21,35 +21,38 @@ jobs: include: - ghc: "9.2.1" cli: true - experimental: true + experimental: true # work to be done flags: "" - ghc: "9.0.2" cli: false - experimental: true # FIXME for quick testing false + experimental: true # failure to be investigated, see #7952 + - ghc: "9.0.1" + cli: false + experimental: false flags: "--lib-only" - ghc: "8.10.7" cli: true - experimental: true # FIXME for quick testing false + experimental: true # failure to be investigated, see #7952 flags: "" - ghc: "8.8.4" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "--solver-benchmarks" - ghc: "8.6.5" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "--complete-hackage-tests" - ghc: "8.4.4" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "" - ghc: "8.2.2" cli: true - experimental: true # FIXME for quick testing false + experimental: false flags: "" - ghc: "8.0.2" cli: false - experimental: true # FIXME for quick testing false + experimental: true # failure to be investigated, see #7952 flags: "--lib-only" steps: From 776076b08bc8fcb6e67817cd567225a8dde47b6f Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 17 Feb 2022 12:12:36 +0800 Subject: [PATCH 33/34] Tweaks Link experimental flags to relative GitHub issues --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c9f3f86ce80..7093957d50d 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -25,7 +25,7 @@ jobs: flags: "" - ghc: "9.0.2" cli: false - experimental: true # failure to be investigated, see #7952 + experimental: true # see #7987 flags: "--lib-only" - ghc: "9.0.1" cli: false diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 58e9ca6c437..9d15be7fe0b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -25,14 +25,14 @@ jobs: flags: "" - ghc: "9.0.2" cli: false - experimental: true # failure to be investigated, see #7952 + experimental: true # see #7987 - ghc: "9.0.1" cli: false - experimental: false + experimental: true # see #7988 flags: "--lib-only" - ghc: "8.10.7" cli: true - experimental: true # failure to be investigated, see #7952 + experimental: true # see #7952 and #7988 flags: "" - ghc: "8.8.4" cli: true @@ -52,7 +52,7 @@ jobs: flags: "" - ghc: "8.0.2" cli: false - experimental: true # failure to be investigated, see #7952 + experimental: true # see #7988 and #7989 flags: "--lib-only" steps: From bc017df2ad30a0400fd680563408c1f849a662de Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Fri, 18 Feb 2022 15:13:15 +0800 Subject: [PATCH 34/34] Fix typo --- .github/workflows/bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 37456b0fa9b..62afaba3d5f 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -17,7 +17,7 @@ jobs: - ubuntu-latest - macos-latest name: Bootstrap ${{ matrix.os }} - runs-on: $${ matrix.os }} + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: bootstrap.py