Skip to content

Commit

Permalink
Merge pull request #182 from simonmar/sync-build-infra
Browse files Browse the repository at this point in the history
Sync build infra with Alex
  • Loading branch information
Ericson2314 authored Dec 27, 2020
2 parents ef418a0 + 9d1e29a commit 33b552e
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 24 deletions.
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# language: haskell

# Keep the list of tested GHC versions in sync with `tested-with` in `alex.cabal`.
env:
- GHCVER=8.8.1
- GHCVER=8.6.5
- GHCVER=8.4.4
- GHCVER=8.2.2
- GHCVER=8.0.2
- GHCVER=7.10.3
- GHCVER=7.8.4
- GHCVER=7.6.3
- GHCVER=7.0.4
- GHCVER=7.4.2
- GHCVER=7.6.3
- GHCVER=7.8.4
- GHCVER=7.10.3
- GHCVER=8.0.2
- GHCVER=8.2.2
- GHCVER=8.4.4
- GHCVER=8.6.5
- GHCVER=8.8.3
- GHCVER=8.10.1

before_install:
- sudo add-apt-repository -y ppa:hvr/ghc
- sudo apt-get update
- sudo apt-get install alex-3.1.7 happy-1.19.5 cabal-install-3.0 ghc-$GHCVER
- export PATH=/opt/cabal/3.0/bin:/opt/ghc/$GHCVER/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH
- sudo apt-get install alex-3.1.7 happy-1.19.5 cabal-install-3.4 ghc-$GHCVER
- export PATH=/opt/cabal/3.4/bin:/opt/ghc/$GHCVER/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH

install:
- cabal update
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ sdist ::
* ) echo "Error: needs cabal 2.2.0.0 or later (but got : `$(CABAL) --numeric-version`)" ; exit 1 ;; \
esac
@if [ "`git status -s`" != '' ]; then \
echo Tree is not clean; \
echo "Error: Tree is not clean"; \
exit 1; \
fi
$(HAPPY) $(HAPPY_OPTS) src/Parser.ly -o src/Parser.hs
$(HAPPY) $(HAPPY_OPTS) src/AttrGrammarParser.ly -o src/AttrGrammarParser.hs
mv src/Parser.ly src/Parser.ly.boot
mv src/AttrGrammarParser.ly src/AttrGrammarParser.ly.boot
$(CABAL) v2-run gen-happy-sdist
cabal v2-sdist
$(CABAL) v2-run gen-happy-sdist
$(CABAL) v2-sdist
@if [ ! -f "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" ]; then \
echo "Error: source tarball not found: dist/happy-$(HAPPY_VER).tar.gz"; \
exit 1; \
Expand Down
17 changes: 11 additions & 6 deletions happy.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ Description:
grammar. Happy works in a similar way to the @yacc@ tool for C.

tested-with:
GHC==7.10.3,
GHC==8.0.2,
GHC==8.2.2,
GHC==8.4.4,
GHC==8.6.5,
GHC==8.8.1
GHC == 7.0.4
GHC == 7.4.2
GHC == 7.6.3
GHC == 7.8.4
GHC == 7.10.3
GHC == 8.0.2
GHC == 8.2.2
GHC == 8.4.4
GHC == 8.6.5
GHC == 8.8.3
GHC == 8.10.1

data-dir: data/

Expand Down
5 changes: 3 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NOTE: `cabal test` will take care to build the local `happy`
# executable and place it into $PATH for us to pick up.
#
# executable and place it into $PATH for us to pick up.
#
# If it doesn't look like the alex binary in $PATH comes from the
# build tree, then we'll fall back to pointing to
# ../dist/build/alex/alex to support running tests via "runghc
Expand All @@ -11,6 +11,7 @@ ifeq "$(filter $(dir $(shell pwd))%,$(HAPPY))" ""
HAPPY=../dist/build/happy/happy
endif

# NOTE: This assumes that a working `ghc` is on $PATH; this may not necessarily be the same GHC used by `cabal` for building `alex`.
HC = ghc
HC_OPTS=-Wall -Werror

Expand Down
5 changes: 4 additions & 1 deletion tests/monaderror-explist.y
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
{-# LANGUAGE FunctionalDependencies, FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
-- For ancient GHC 7.0.4
{-# LANGUAGE MultiParamTypeClasses #-}
module Main where

import Data.Char
Expand Down
5 changes: 4 additions & 1 deletion tests/monaderror.y
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
{-# LANGUAGE FunctionalDependencies, FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
-- For ancient GHC 7.0.4
{-# LANGUAGE MultiParamTypeClasses #-}
module Main where

import Control.Monad (when)
Expand Down
6 changes: 5 additions & 1 deletion tests/typeclass_monad_lexer.y
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
{-# LANGUAGE FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleInstances #-}
-- For ancient GHC 7.0.4
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
import Control.Monad (liftM, ap)
import Control.Applicative as A
}
Expand Down

0 comments on commit 33b552e

Please sign in to comment.