Skip to content

Commit

Permalink
Fix broken build due to happy-1.21.0
Browse files Browse the repository at this point in the history
haskell/happy#211

[changelog skip]
  • Loading branch information
dahlia committed Nov 17, 2021
1 parent aa44d24 commit f256302
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 45 deletions.
54 changes: 24 additions & 30 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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-')"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions stack-ghc-8.10.yaml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 13 additions & 0 deletions stack-ghc-8.8.yaml
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 14 additions & 0 deletions stack-ghc-9.0.yaml
Original file line number Diff line number Diff line change
@@ -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"
33 changes: 33 additions & 0 deletions stack-ghc-9.0.yaml.lock
Original file line number Diff line number Diff line change
@@ -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
15 changes: 0 additions & 15 deletions stack.yaml

This file was deleted.

1 change: 1 addition & 0 deletions stack.yaml

0 comments on commit f256302

Please sign in to comment.