From f256302ac1a6b6fffa0051cac1cdc3c0c69ba367 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 17 Nov 2021 10:06:00 +0900 Subject: [PATCH] Fix broken build due to happy-1.21.0 https://github.com/simonmar/happy/issues/211 [changelog skip] --- .github/workflows/build.yaml | 54 ++++++++++++++++-------------------- stack-ghc-8.10.yaml | 13 +++++++++ stack-ghc-8.8.yaml | 13 +++++++++ stack-ghc-9.0.yaml | 14 ++++++++++ stack-ghc-9.0.yaml.lock | 33 ++++++++++++++++++++++ stack.yaml | 16 +---------- 6 files changed, 98 insertions(+), 45 deletions(-) create mode 100644 stack-ghc-8.10.yaml create mode 100644 stack-ghc-8.8.yaml create mode 100644 stack-ghc-9.0.yaml create mode 100644 stack-ghc-9.0.yaml.lock mode change 100644 => 120000 stack.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c94671f1..e6188c30 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,10 +13,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, macos-10.15, windows-2019] - resolver: - - lts-16.31 - - lts-18.16 - - nightly-2021-11-06 + ghc-version: + - "8.8" + - "8.10" + - "9.0" + environment: + STACK_YAML: "${{ github.workspace }}/stack-ghc-${{ matrix.ghc-version }}" steps: - uses: actions/checkout@v2 - uses: dahlia/actions/setup-yq@main @@ -28,7 +30,7 @@ jobs: ~/.cabal/packages ~/.cabal/store ~/.stack - key: stack-${{ matrix.os }}-${{ matrix.resolver }} + key: stack-${{ matrix.os }}-ghc-${{ matrix.ghc-version }} - name: Cache Stack files (Windows) if: "startsWith(matrix.os, 'windows-')" uses: actions/cache@v2 @@ -37,25 +39,17 @@ jobs: %APPDATA%\cabal\packages %APPDATA%\cabal\store %APPDATA%\stack - key: stack-${{ matrix.os }}-${{ matrix.resolver }} + key: stack-${{ matrix.os }}-ghc-${{ matrix.version }} - name: Adjust Stack configuration - shell: bash + if: "!startsWith(matrix.os, 'windows-')" run: | - yq eval -i ' - .resolver = strenv(RESOLVER) - | .allow-newer = ( - .resolver | test("^lts-18.") or - .resolver | test("^nightly-") - ) - | .flags.seonbi.iconv = (strenv(OS) | test("^windows-") | not) - ' stack.yaml - env: - RESOLVER: ${{ matrix.resolver }} - OS: ${{ matrix.os }} + yq eval \ + -i \ + '.flags.seonbi.iconv = true' \ + stack-ghc-${{ matrix.ghc-version }}.yaml - name: Set up resolver shell: bash run: | - cat stack.yaml # Try 3 times because this sometimes fails due to network error # on GitHub Actions. stack setup || stack setup || stack setup @@ -72,9 +66,9 @@ jobs: [[ "$tag_ver" = "$pkg_ver" ]] ! grep -i "to be released" CHANGES.md - name: Resolve dependencies - run: stack install --only-dependencies + run: stack install --test --only-dependencies - name: Build - run: stack build + run: stack build --test - name: Test run: stack test - name: Package source distribution @@ -90,12 +84,12 @@ jobs: if: startsWith(matrix.os, 'ubuntu-') uses: actions/upload-artifact@v2 with: - name: sdist-${{ matrix.os }}-${{ matrix.resolver }} + name: sdist-${{ matrix.os }}-ghc-${{ matrix.ghc-version }} path: /tmp/sdist - name: Build docs if: >- startsWith(matrix.os, 'ubuntu-') && - startsWith(matrix.resolver, 'lts-18.') + matrix.ghc-version == '8.8' shell: bash run: | curl -L -o /tmp/pandoc.deb \ @@ -109,13 +103,13 @@ jobs: - name: Copy docs if: >- startsWith(matrix.os, 'ubuntu-') && - startsWith(matrix.resolver, 'lts-18.') + matrix.ghc-version == '8.8' shell: bash run: cp -r "$(stack path --dist-dir)/doc/html/seonbi" .docs - name: Save docs if: >- startsWith(matrix.os, 'ubuntu-') && - startsWith(matrix.resolver, 'lts-18.') + matrix.ghc-version == '8.8' uses: actions/upload-artifact@v2 with: name: docs @@ -134,7 +128,7 @@ jobs: - name: Save executable binaries uses: actions/upload-artifact@v2 with: - name: binaries-${{ matrix.os }}-${{ matrix.resolver }} + name: binaries-${{ matrix.os }}-ghc-${{ matrix.ghc-version }} path: .bin deno: @@ -153,7 +147,7 @@ jobs: deno-version: v1.x - uses: actions/download-artifact@v2 with: - name: binaries-${{ matrix.os }}-lts-16.31 + name: binaries-${{ matrix.os }}-ghc-8.8 path: ${{ runner.temp }}/bin - run: chmod +x ${{ runner.temp }}/bin/* if: "!startsWith(matrix.os, 'windows-')" @@ -271,11 +265,11 @@ jobs: steps: - uses: actions/download-artifact@v2 with: - name: binaries-macos-10.15-lts-16.31 + name: binaries-macos-10.15-ghc-8.8 path: /tmp/binaries-macos - uses: actions/download-artifact@v2 with: - name: binaries-windows-2019-lts-16.31 + name: binaries-windows-2019-ghc-8.8 path: /tmp/binaries-windows - uses: actions/download-artifact@v2 with: @@ -329,7 +323,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 with: - name: sdist-ubuntu-20.04-lts-16.31 + name: sdist-ubuntu-20.04-ghc-8.8 path: /tmp/sdist - uses: actions/download-artifact@v2 with: diff --git a/stack-ghc-8.10.yaml b/stack-ghc-8.10.yaml new file mode 100644 index 00000000..b4e60754 --- /dev/null +++ b/stack-ghc-8.10.yaml @@ -0,0 +1,13 @@ +resolver: lts-18.16 +packages: +- . +extra-deps: +- bytestring-trie-0.2.5.0 +- html-charset-0.1.0 +flags: + seonbi: + iconv: true +allow-newer: true +ghc-options: + "$locals": -fhide-source-paths +require-stack-version: ">=2.7.0" diff --git a/stack-ghc-8.8.yaml b/stack-ghc-8.8.yaml new file mode 100644 index 00000000..835e4ff3 --- /dev/null +++ b/stack-ghc-8.8.yaml @@ -0,0 +1,13 @@ +resolver: lts-16.31 +packages: +- . +extra-deps: +- bytestring-trie-0.2.5.0 +- html-charset-0.1.0 +flags: + seonbi: + iconv: true +allow-newer: false +ghc-options: + "$locals": -fhide-source-paths +require-stack-version: ">=2.7.0" diff --git a/stack-ghc-9.0.yaml b/stack-ghc-9.0.yaml new file mode 100644 index 00000000..4e71f87c --- /dev/null +++ b/stack-ghc-9.0.yaml @@ -0,0 +1,14 @@ +resolver: nightly-2021-11-15 +packages: +- . +extra-deps: +- bytestring-trie-0.2.5.0 +- html-charset-0.1.0 +- happy-1.20.0 # https://github.com/simonmar/happy/issues/211 +flags: + seonbi: + iconv: true +allow-newer: true +ghc-options: + "$locals": -fhide-source-paths +require-stack-version: ">=2.7.0" diff --git a/stack-ghc-9.0.yaml.lock b/stack-ghc-9.0.yaml.lock new file mode 100644 index 00000000..01664866 --- /dev/null +++ b/stack-ghc-9.0.yaml.lock @@ -0,0 +1,33 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +snapshots: +- original: nightly-2021-11-15 + completed: + sha256: 4eb51ee07b71a0e11a4a9d32020ce6a5305e5a2f17da739afecdf7e876c78fec + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/11/15.yaml + size: 596363 +packages: +- original: + hackage: bytestring-trie-0.2.5.0 + completed: + pantry-tree: + sha256: 4ce59841d2d44dc36634652c65560c467d98416e3b15280e1314a54eac18a8d7 + size: 705 + hackage: bytestring-trie-0.2.5.0@sha256:2ebdf9ab8bfa82b324592f0f203b41b57423912a4a9509b76cf22fc1cf344d7c,3427 +- original: + hackage: html-charset-0.1.0 + completed: + pantry-tree: + sha256: bde99226dbcbd034874ac4d0409b0faa8078538a947910d7be943762162fc1f4 + size: 490 + hackage: html-charset-0.1.0@sha256:0dca1097494d008599b71b519c160eb5e51808f9adc3da4942f7d05f99b83d1f,2314 +- original: + hackage: happy-1.20.0 + completed: + pantry-tree: + sha256: a90122967031e2feb99adbbacf57ddf8627a7c0444720402513d3f11ec7f990a + size: 8749 + hackage: happy-1.20.0@sha256:f99e612b29d68d784d7e193943a13466f0923de69452a2585081491efed0436b,5709 diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 4ae522b3..00000000 --- a/stack.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# The resolve and some configurations are adjusted during the workflow in -# GitHub Actions. See also .github/workflows/build.yaml script. -resolver: lts-16.31 -packages: -- . -extra-deps: -- bytestring-trie-0.2.5.0 -- html-charset-0.1.0 -flags: - seonbi: - iconv: true -allow-newer: false # should be turned on where resolver is lts-18.* or later -ghc-options: - "$locals": -fhide-source-paths -require-stack-version: ">=2.7.0" diff --git a/stack.yaml b/stack.yaml new file mode 120000 index 00000000..6c046eb3 --- /dev/null +++ b/stack.yaml @@ -0,0 +1 @@ +stack-ghc-8.8.yaml \ No newline at end of file