Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create happy-boot exe #212

Draft
wants to merge 1 commit into
base: release/1.21
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/haskell-ci.patch

This file was deleted.

30 changes: 16 additions & 14 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.13.20210606
# version: 0.13.20211011
#
# REGENDATA ("0.13.20210606",["github","happy.cabal"])
# REGENDATA ("0.13.20211011",["github","happy.cabal"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -94,7 +94,11 @@ jobs:
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME" cabal-install-3.4
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.16.2/x86_64-linux-ghcup-0.1.16.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -110,7 +114,7 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -196,7 +200,7 @@ jobs:
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v2
Expand All @@ -206,24 +210,22 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests and install
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests
run: |
$CABAL v2-install --reinstall --overwrite-policy=always --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: build
run: |
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
run: |
export HAPPY=$HOME/.cabal/bin/happy
export HC=$HC
$CABAL v2-test --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: cabal check
run: |
cd ${PKGDIR_happy} || false
${CABAL} -vnormal check
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
62 changes: 43 additions & 19 deletions happy.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ extra-source-files:
tests/rank2.y
tests/shift01.y

flag bootstrap
description: Optimize the implementation of happy using a pre-built happy
manual: True
default: True

source-repository head
type: git
location: https://github.com/simonmar/happy.git
Expand Down Expand Up @@ -187,20 +182,49 @@ executable happy
ParamRules
PrettyGrammar

if flag(bootstrap)
-- TODO put this back when Cabal can use it's qualified goals to better
-- understand bootstrapping, see
-- https://github.com/haskell/cabal/issues/7189
--build-tools: happy
cpp-options: -DHAPPY_BOOTSTRAP
other-modules:
ParseMonad.Bootstrapped
Parser.Bootstrapped
AttrGrammarParser
else
other-modules:
ParseMonad.Oracle
Parser.Oracle
ParseMonad.Bootstrapped
Parser.Bootstrapped
AttrGrammarParser

build-tool-depends: happy:happy-boot
cpp-options: -DHAPPY_BOOTSTRAP

executable happy-boot
hs-source-dirs: src
main-is: Main.lhs

build-depends: base < 5,
array,
containers >= 0.4.2,
mtl >= 2.2.1
-- mtl-2.2.1 added Control.Monad.Except

default-language: Haskell98
default-extensions: CPP, MagicHash, FlexibleContexts, NamedFieldPuns
ghc-options: -Wall
other-modules:
Paths_happy
AbsSyn
First
GenUtils
Grammar
Info
LALR
Lexer
ParseMonad
ParseMonad.Class
Parser
ProduceCode
ProduceGLRCode
NameSet
Tabular
Target
AttrGrammar
ParamRules
PrettyGrammar

ParseMonad.Oracle
Parser.Oracle


test-suite tests
Expand Down