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

Modularize happy #191

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
1b2bdba
Create frontend package
knothed Apr 30, 2021
f1c2c1b
Create middleend package
knothed May 1, 2021
d94c4dd
Create backend package
knothed May 1, 2021
13afe4a
Fix name shadowing warnings
knothed May 1, 2021
155bcf5
Create main package (happy)
knothed May 1, 2021
bed8653
Re-add debugging options
knothed May 1, 2021
67fe0a8
Add changeLog entry
knothed May 3, 2021
e8a864a
Fix test suite
knothed May 3, 2021
463c610
Small modifications for RAD package
knothed May 5, 2021
9fccd01
Outsource cli flag declaration into respective packages
knothed May 8, 2021
2277ed7
Don't require an unnamed argument (like filename)
knothed May 8, 2021
2ee6ea8
OptionParsing: add sorting and duplication checking
knothed May 10, 2021
ab273a8
Supply `version` from Main.hs
knothed May 10, 2021
8cf532c
Prefix packages with `happy-`
knothed May 10, 2021
1a7e8f1
Create happy-core package
knothed May 11, 2021
5f0e1c7
Move tests into happy-test package
knothed May 12, 2021
a101f3d
Replace Makefile with Test.hs to allow for customised test setups
knothed May 15, 2021
5899364
Fix tests which failed to signalise failure
knothed May 15, 2021
acd2296
Add `stopOnFailure` option to happy-test
knothed May 16, 2021
f8dc26f
Some fixes; remove `make sdist`
knothed May 16, 2021
8d6fa5d
Undo bogus change
knothed May 17, 2021
8412424
Remove makefile from happy.cabal
knothed May 21, 2021
7ab584c
Remove build-windows-dist.sh
knothed May 21, 2021
7a6021d
Disable stdout-buffering for cabal test
knothed May 24, 2021
0264bdd
Improve Test.hs
knothed May 25, 2021
0507f52
Reintroduce `make sdist-test`
knothed May 27, 2021
89a7e68
Use `make sdist-test` for travis and appveyor
knothed May 27, 2021
04ba22b
Remove redundant dependencies
knothed May 28, 2021
1fd5f90
Use sequence_
knothed May 31, 2021
38588fa
Add explicit version requirements
knothed Jun 3, 2021
ea9c902
Custom `dropWhileEnd` (for GHC < 7.4)
knothed Jun 3, 2021
0442ee7
CI: just perform `cabal build`
knothed Jun 3, 2021
e884419
Don't require Data.Bifunctor
knothed Jun 3, 2021
f8240b5
Custom `Functor OptDescr` (for GHC < 7.6)
knothed Jun 3, 2021
144006e
Functor OptDescr seems to exist since base-4.7.0.0
knothed Jun 3, 2021
dcead12
Windows-specific shell adjustments
knothed Jun 8, 2021
33b7ded
Pin exact sub-package versions
knothed Jun 8, 2021
d10ea68
GHC 7.0-specific things
knothed Jun 8, 2021
6c04aaf
Use absolute path for calling the exe
knothed Jun 8, 2021
e72c4aa
Use correct parentheses
knothed Jun 8, 2021
5b30076
CI: run make-sdist on GHC ≥ 8.0
knothed Jun 8, 2021
be14d21
Use mapM_ instead of sequence_ (map • •)
knothed Jun 11, 2021
fb641ce
Change CI script again
knothed Jun 11, 2021
09c735f
Don't use `catchIOError` (GHC 7.0 doesn't have it)
knothed Jun 11, 2021
e75af81
Fix test grammars for GHC 7.0
knothed Jun 11, 2021
3501c68
Remove `(.*)` and `(..*)`
knothed Jun 16, 2021
3600a14
Organize modules into Happy.* hierarchy
knothed Jun 16, 2021
85f3fa4
Fix testing
knothed Jun 16, 2021
676f94a
Remove type of test parse function
knothed Jul 12, 2021
da196f4
Remove unnecessary `IO` annotations
knothed Jul 12, 2021
a2a25ba
Remove misleading `Eq` instance
knothed Jul 19, 2021
f70dc19
Remove useless ErrorHandlerType' type
knothed Jul 20, 2021
886c88e
Minor things
knothed Jul 20, 2021
179b16b
Update ChangeLog.md
knothed Jul 22, 2021
ea59588
AttrGrammarParser -> AttrGrammar.Parser
Ericson2314 Jul 21, 2021
f6dc01e
Move happy package into packages/happy
knothed Jul 22, 2021
5084f06
Update Readme
knothed Jul 22, 2021
eec989c
isBootstrapped -> supportsParsingAttributeGrammars
knothed Jul 22, 2021
accf5c7
Remove disable-benchmarks flags
knothed Jul 22, 2021
6401925
Fix package path
knothed Jul 22, 2021
4bd9ecd
Don't install all
knothed Jul 22, 2021
4fffee8
Try ghc=HC
knothed Jul 22, 2021
fff4ca4
Put ghc-dir in path
knothed Jul 22, 2021
6ce8962
Unify cabal files
knothed Jul 23, 2021
4566fc8
Fix appveyor
knothed Jul 23, 2021
44ff6ed
Update haskell-ci.patch
knothed Jul 23, 2021
fd8d833
Fix silly mistake
knothed Jul 23, 2021
5f5b163
Fix some examples
knothed Jul 23, 2021
088f01b
Split off GLRBackend
knothed Jul 23, 2021
25ef214
Remove `defaultArguments` for testing
knothed Jul 23, 2021
df4d156
Remove `elem` parsing functions
knothed Jul 23, 2021
e2d5a75
Implement GLR option parsing
knothed Jul 23, 2021
7cd8704
Update packages/test/data/monad002.ly
knothed Jul 23, 2021
3411489
Update haskell-ci.yml
knothed Jul 23, 2021
a2d6f3f
Fixes and adaptions
knothed Jul 23, 2021
1bf9dca
Move glr-backend's characteristic flag to top-level
knothed Jul 26, 2021
f640745
Rename middleend to tabular
knothed Aug 21, 2021
0633fc9
Split happy-core into happy-cli and happy-grammar
knothed Aug 21, 2021
08a53f2
Fix rebase issues
knothed Aug 25, 2021
9db33f3
Liquidate GenUtils
knothed Aug 27, 2021
b6def85
Declare `die` for GHC 7.8 and below
knothed Aug 27, 2021
0e235b4
Remove GLR datas file accidentally coppied instead of moved
Ericson2314 Oct 1, 2021
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
5 changes: 1 addition & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ install:
- "cabal --version"
- "ghc --version"
- "cabal %CABOPTS% v2-update -vverbose+nowrap"
- "cabal %CABOPTS% v2-install alex --bindir=/hsbin"
Ericson2314 marked this conversation as resolved.
Show resolved Hide resolved
- "alex --version"

build: off

test_script:
- "cd %APPVEYOR_BUILD_FOLDER%"
- "make sdist"
- "make sdist-test-only"
- "cabal %CABOPTS% v2-test happy -f -bootstrap"
36 changes: 25 additions & 11 deletions .github/haskell-ci.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
--- workflows/haskell-ci.yml 2021-07-14 19:49:44.000000000 +0200
+++ workflows/haskell-ci.yml-patched 2021-07-14 19:49:28.000000000 +0200
@@ -196,7 +196,7 @@
--- workflows/haskell-ci.yml
+++ workflows/haskell-ci.yml
@@ -107,6 +107,7 @@ jobs:
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HCDIR/bin/$HCKIND
+ echo "$HCDIR/bin" >> "$GITHUB_PATH"
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
@@ -226,7 +227,7 @@ jobs:
cat cabal.project.local
- name: dump install plan
run: |
Expand All @@ -9,19 +17,19 @@
cabal-plan
- name: cache
uses: actions/cache@v2
@@ -206,17 +206,19 @@
@@ -236,17 +237,25 @@ jobs:
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
- $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
+ $CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
+ $CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests --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
run: |
- $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
+ $CABAL v2-install --reinstall --overwrite-policy=always --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks all
+ $CABAL v2-install --reinstall --overwrite-policy=always --flags=-bootstrap $ARG_COMPILER --disable-tests happy
- name: build
run: |
- $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
Expand All @@ -30,14 +38,20 @@
run: |
- $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
+ 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
+ export HC
+ export CABAL
+ if [[ $(ghc --numeric-version) == "8.10.1" ]]
+ then
+ make sdist-test
+ else
+ $CABAL v2-test --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
+ fi
- name: cabal check
run: |
cd ${PKGDIR_happy} || false
@@ -224,4 +226,4 @@
cd ${PKGDIR_happy_frontend} || false
@@ -267,4 +276,4 @@ jobs:
- name: unconstrained build
run: |
rm -f cabal.project.local
- $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
+ $CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks all
+ $CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests all
86 changes: 76 additions & 10 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'happy.cabal'
# haskell-ci 'github' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.13.20210606
# version: 0.13.20210621
#
# REGENDATA ("0.13.20210606",["github","happy.cabal"])
# REGENDATA ("0.13.20210621",["github","cabal.project"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -107,6 +107,7 @@ jobs:
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HCDIR/bin/$HCKIND
echo "$HCDIR/bin" >> "$GITHUB_PATH"
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -169,7 +170,14 @@ jobs:
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/frontend" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/tabular" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/backend" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/backend-glr" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/grammar" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/cli" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/test" >> cabal.project
echo "packages: $GITHUB_WORKSPACE/source/packages/happy" >> cabal.project
cat cabal.project
- name: sdist
run: |
Expand All @@ -181,17 +189,52 @@ jobs:
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
- name: generate cabal.project
run: |
PKGDIR_happy_frontend="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-frontend-[0-9.]*')"
echo "PKGDIR_happy_frontend=${PKGDIR_happy_frontend}" >> "$GITHUB_ENV"
PKGDIR_happy_tabular="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-tabular-[0-9.]*')"
echo "PKGDIR_happy_tabular=${PKGDIR_happy_tabular}" >> "$GITHUB_ENV"
PKGDIR_happy_backend="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-backend-[0-9.]*')"
echo "PKGDIR_happy_backend=${PKGDIR_happy_backend}" >> "$GITHUB_ENV"
PKGDIR_happy_backend_glr="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-backend-glr-[0-9.]*')"
echo "PKGDIR_happy_backend_glr=${PKGDIR_happy_backend_glr}" >> "$GITHUB_ENV"
PKGDIR_happy_cli="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-cli-[0-9.]*')"
echo "PKGDIR_happy_cli=${PKGDIR_happy_cli}" >> "$GITHUB_ENV"
PKGDIR_happy_grammar="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-grammar-[0-9.]*')"
echo "PKGDIR_happy_grammar=${PKGDIR_happy_grammar}" >> "$GITHUB_ENV"
PKGDIR_happy_test="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-test-[0-9.]*')"
echo "PKGDIR_happy_test=${PKGDIR_happy_test}" >> "$GITHUB_ENV"
PKGDIR_happy="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happy-[0-9.]*')"
echo "PKGDIR_happy=${PKGDIR_happy}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_happy_frontend}" >> cabal.project
echo "packages: ${PKGDIR_happy_tabular}" >> cabal.project
echo "packages: ${PKGDIR_happy_backend}" >> cabal.project
echo "packages: ${PKGDIR_happy_backend_glr}" >> cabal.project
echo "packages: ${PKGDIR_happy_grammar}" >> cabal.project
echo "packages: ${PKGDIR_happy_cli}" >> cabal.project
echo "packages: ${PKGDIR_happy_test}" >> cabal.project
echo "packages: ${PKGDIR_happy}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-frontend" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-tabular" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-backend" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-backend-glr" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-grammar" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-cli" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy-test" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happy" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(containers|happy|mtl|transformers)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(containers|happy|happy-backend|happy-backend-glr|happy-grammar|happy-cli|happy-frontend|happy-tabular|happy-test|mtl|transformers)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand All @@ -206,24 +249,47 @@ 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 --disable-tests --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
run: |
$CABAL v2-install --reinstall --overwrite-policy=always --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks all
$CABAL v2-install --reinstall --overwrite-policy=always --flags=-bootstrap $ARG_COMPILER --disable-tests happy
- name: build
run: |
$CABAL v2-build --flags=-bootstrap $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
export HC
export CABAL
if [[ $(ghc --numeric-version) == "8.10.1" ]]
then
make sdist-test
else
$CABAL v2-test --flags=-bootstrap $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
fi
- name: cabal check
run: |
cd ${PKGDIR_happy_frontend} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy_tabular} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy_backend} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy_backend_glr} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy_grammar} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy_cli} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy_test} || false
${CABAL} -vnormal check
cd ${PKGDIR_happy} || false
${CABAL} -vnormal check
- name: haddock
run: |
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests --disable-benchmarks all
$CABAL v2-build --flags=-bootstrap $ARG_COMPILER --disable-tests all
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased - 1.21.0

- Split `happy` into multiple packages

## 1.20.0

* Fix #121: the -i flag produces an .info file even if the `%expect`
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CI on GitHub Actions

The GHC workflow file `.github/workflows/haskell-ci.yml` is generated by:

haskell-ci github happy.cabal
haskell-ci github packages/happy/happy.cabal
patch --input=.github/haskell-ci.patch .github/workflows/haskell-ci.yml

The patch introduces happy specifics to the build and test process that
Expand Down
61 changes: 13 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,13 @@
CABAL = cabal

HAPPY_VER = `awk '/^version:/ { print $$2 }' happy.cabal`

ALEX = alex
ALEX_OPTS = -g

SDIST_DIR=dist-newstyle/sdist

sdist ::
@case "`$(CABAL) --numeric-version`" in \
2.[2-9].* | [3-9].* ) ;; \
* ) echo "Error: needs cabal 2.2.0.0 or later (but got : `$(CABAL) --numeric-version`)" ; exit 1 ;; \
esac
@if [ "`git status -s`" != '' ]; then \
echo "Error: Tree is not clean"; \
exit 1; \
fi
$(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; \
fi
git checkout .
git clean -f

sdist-test :: sdist sdist-test-only
@rm -rf "${SDIST_DIR}/happy-${HAPPY_VER}/"

sdist-test-only ::
@if [ ! -f "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" ]; then \
echo "Error: source tarball not found: ${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz"; \
exit 1; \
fi
rm -rf "${SDIST_DIR}/happy-$(HAPPY_VER)/"
tar -xf "${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz" -C ${SDIST_DIR}/
echo "packages: ." > "${SDIST_DIR}/happy-$(HAPPY_VER)/cabal.project"
echo "tests: True" >> "${SDIST_DIR}/happy-$(HAPPY_VER)/cabal.project"
cd "${SDIST_DIR}/happy-$(HAPPY_VER)/" \
&& cabal v2-build all --flag -bootstrap \
&& cabal v2-install --flag -bootstrap --installdir="./bootstrap-root" \
&& cabal v2-test all -j --flag -bootstrap \
&& export PATH=./bootstrap-root:$$PATH \
&& cabal v2-build all --flag +bootstrap \
&& cabal v2-test all -j --flag +bootstrap
@echo ""
@echo "Success! ${SDIST_DIR}/happy-$(HAPPY_VER).tar.gz is ready for distribution!"
@echo ""
ENV = .local.env
HC ?= ghc
CABAL ?= cabal

EXECUTABLE = "happy"
PACKAGES = ["happy", "happy-cli", "happy-grammar", "happy-frontend", "happy-tabular", "happy-backend", "happy-test"]
BOOTSTRAPPING = True

sdist-test ::
rm -f ${ENV}
$(CABAL) v2-install --lib happy-test --package-env ${ENV}
$(HC) -package-env ${ENV} -e 'Happy.Test.SDist.sdist_test "${CABAL}" "$(shell pwd)" ${EXECUTABLE} ${PACKAGES} ${BOOTSTRAPPING}'
rm -f ${ENV}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ Happy is a parser generator for Haskell 98 (and later).

Happy is built using Cabal. First install GHC, then:
```
$ cabal install
$ cabal install happy
```
If you obtained the development version from https://github.com/simonmar/happy/,
install via:
If you don't have a local version of `happy` (yet), you can also install a non-bootstrapped version via:
```
$ make sdist && cabal install
$ cabal install happy -f -bootstrap
```

Complete documentation can be found in the directory 'doc', in
Expand Down
18 changes: 0 additions & 18 deletions build-windows-dist.sh

This file was deleted.

9 changes: 8 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
packages:
./
packages/backend,
packages/backend-glr,
packages/cli,
packages/frontend,
packages/grammar,
packages/happy,
packages/tabular,
packages/test
2 changes: 1 addition & 1 deletion examples/Calc.ly
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
> {
> module Calc where
> import Char
> import Data.Char
> }

First thing to declare is the name of your parser,
Expand Down
2 changes: 1 addition & 1 deletion examples/ErrorTest.ly
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Test for monadic Happy Parsers, Simon Marlow 1996.

> {
> import Char
> import Data.Char
> }

> %name calc
Expand Down
2 changes: 1 addition & 1 deletion examples/LexerTest.ly
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Test for monadic Happy Parsers, Simon Marlow 1996.

> {
> import Char
> import Data.Char
> }

> %name calc
Expand Down
2 changes: 1 addition & 1 deletion examples/MonadTest.ly
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Tests %monad without %lexer.

> {
> import Char
> import Data.Char
> }

> %name calc
Expand Down
1 change: 1 addition & 0 deletions packages/backend-glr/LICENSE
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading