Skip to content

Commit 3f21e54

Browse files
authored
Merge pull request #1353 from ucsd-progsys/phadej-ghc-8.4
Phadej ghc 8.4
2 parents b78152f + 17eaaef commit 3f21e54

File tree

695 files changed

+16680
-27369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

695 files changed

+16680
-27369
lines changed

.circleci/config.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2.0
44
jobs:
55
build:
66
docker:
7-
- image: fpco/stack-build:lts-10.0
7+
- image: fpco/stack-build:lts-12.2
88
steps:
99
- add_ssh_keys
1010
- run: apt-get install z3
@@ -31,13 +31,16 @@ jobs:
3131
name: Test
3232
command: |
3333
stack clean
34-
mkdir -p $CIRCLE_TEST_REPORTS/junit
35-
stack test liquidhaskell:test --flag liquidhaskell:include --flag liquidhaskell:devel --test-arguments="-t 1200s -j2 --xml=$CIRCLE_TEST_REPORTS/junit/main-test-results.xml": #--liquid-opts='--cores=1'":
36-
stack test liquidhaskell:liquidhaskell-parser --test-arguments="-j2 --xml=$CIRCLE_TEST_REPORTS/junit/parser-test-results.xml":
34+
mkdir -p /tmp/junit
35+
stack test liquidhaskell:test --flag liquidhaskell:include --flag liquidhaskell:devel --test-arguments="-t 1200s --xml=/tmp/junit/main-test-results.xml": #--liquid-opts='--cores=1'":
36+
stack test liquidhaskell:liquidhaskell-parser --test-arguments="--xml=/tmp/junit/parser-test-results.xml":
3737
stack sdist
38-
stack haddock liquidhaskell --flag liquidhaskell:-devel --no-haddock-deps --haddock-arguments="--no-print-missing-docs --odir=$CIRCLE_ARTIFACTS"
39-
mkdir -p $CIRCLE_TEST_REPORTS/tasty
40-
cp -r tests/logs/cur $CIRCLE_TEST_REPORTS/tasty/log
38+
# stack haddock liquidhaskell --flag liquidhaskell:-devel --no-haddock-deps --haddock-arguments="--no-print-missing-docs --odir=$CIRCLE_ARTIFACTS"
39+
stack haddock liquidhaskell --no-haddock-deps --haddock-arguments="--no-print-missing-docs"
40+
- store_test_results:
41+
path: /tmp/junit
42+
- store_artifacts:
43+
path: tests/logs/cur
4144
- run:
4245
name: Dist
4346
command: stack sdist

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NEXT
44

5+
## 0.8.4.0
6+
7+
- Support for GHC 8.4.3
8+
59
## 0.8.2.2
610

711
- Support for GHC 8.2.2

FAILING_TESTS.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,3 @@ tags:
110110
# hasktags -c src/
111111
# hasktags -e src/
112112

113-
ghcid:
114-
ghcid --command "stack ghci --main-is liquidhaskell:exe:liquid"

README.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,36 +58,35 @@ See [this file](NIX.md) for instructions on running inside a custom `nix`-shell.
5858
How To Run Regression Tests
5959
---------------------------
6060

61+
You can run all the tests by
62+
6163
$ stack test
6264

63-
To use threads to speed up the tests
65+
To pass in specific parameters and run a subset of the tests
6466

65-
$ make THREADS=30 test
67+
$ stack test liquidhaskell --fast --test-arguments "--liquid-opts --no-termination -p Unit"
6668

6769
Or your favorite number of threads, depending on cores etc.
6870

6971
You can directly extend and run the tests by modifying
7072

7173
tests/test.hs
7274

73-
To run the regression test *and* the benchmarks run
74-
75-
$ make all-test
76-
7775
How to Profile
7876
--------------
7977

8078
1. Build with profiling on
8179

8280
```
83-
$ make pdeps && make prof
81+
$ stack build liquidhaskell --fast --profile
8482
```
8583
84+
8685
2. Run with profiling
8786
8887
```
89-
$ time liquid range.hs +RTS -hc -p
90-
$ time liquid range.hs +RTS -hy -p
88+
$ stack exec -- liquid range.hs +RTS -hc -p
89+
$ stack exec -- liquid range.hs +RTS -hy -p
9190
```
9291
9392
Followed by this which shows the stats file
@@ -111,7 +110,7 @@ How to Get Stack Traces On Exceptions
111110
1. Build with profiling on
112111
113112
```
114-
$ make pdeps && make prof
113+
$ stack build liquidhaskell --fast --profile
115114
```
116115
117116
2. Run with backtraces
@@ -120,6 +119,10 @@ How to Get Stack Traces On Exceptions
120119
$ liquid +RTS -xc -RTS foo.hs
121120
```
122121
122+
```
123+
stack exec -- liquid List00.hs +RTS -p -xc -RTS
124+
```
125+
123126
Working With Submodules
124127
-----------------------
125128
@@ -1464,3 +1467,36 @@ Suppose that the current version of Liquid Haskell is `A.B.C.D`:
14641467

14651468
+ The `A` component shall be updated at the sole discretion of the project owners.
14661469

1470+
Updating GHC
1471+
============
1472+
1473+
Here's a script to generate the diff for the `desugar` modules.
1474+
1475+
```
1476+
export GHCSRC=$HOME/Documents/ghc
1477+
1478+
# Checkout GHC-8.2.2
1479+
(cd $GHCSRC && git checkout ghc-8.2.2 && git pull)
1480+
1481+
# make a patch
1482+
diff -ur $GHCSRC/compiler/deSugar src/Language/Haskell/Liquid/Desugar > liquid.patch
1483+
1484+
# Checkout GHC-8.4.3
1485+
(cd $GHCSRC && git checkout ghc-8.2.2 && git pull)
1486+
1487+
# Copy GHC desugarer to temporary directory
1488+
cp -r $GHCSRC/compiler/deSugar .
1489+
1490+
# Patch
1491+
(cd deSugar && patch -p5 --merge --ignore-whitespace < ../liquid.patch)
1492+
1493+
# Copy stuff over
1494+
for i in src/Language/Haskell/Liquid/Desugar/*.*; do j=$(basename $i); echo $j; cp deSugar/$j src/Language/Haskell/Liquid/Desugar; done
1495+
```
1496+
1497+
1498+
Here's the magic diff that we did at some point that we keep bumping up to new GHC versions:
1499+
1500+
https://github.com/ucsd-progsys/liquidhaskell/commit/d380018850297b8f1878c33d0e4c586a1fddc2b8#diff-3644b76a8e6b3405f5492d8194da3874R224
1501+
1502+

TODO.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
### CallStack/Error
1+
# TODO
2+
3+
- [] Fix termination tests in fail.txt
4+
- [] Fix resolve tests in fail.txt
5+
- [] Fix eq-repr tests in fail.txt
6+
- [] Remove trace
7+
- [] Remove warnings
8+
- [] fix circle
9+
- [] merge PR
10+
11+
12+
## CallStack/Error
213

314
The use of `Prelude.error` gives a crazy performance hit
415
apparently even without cutvars being generated, this is
@@ -33,10 +44,6 @@ TODO
3344
Prune Unsorted Refs
3445
-------------------
3546

36-
* mergeDataConTypes
37-
* makeMeasureSpec'
38-
* meetDataConSpec
39-
4047
The below gives a nice SORT error
4148

4249
```haskell
@@ -1237,3 +1244,4 @@ GHC 7.10
12371244

12381245
- termination metrics are required in a few places where they were not previously
12391246
- my guess is that ghc's behaviour for grouping functions in a `Rec` binder have changed
1247+

benchmarks/bytestring-0.9.2.1/Data/ByteString.T.hs

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,11 @@ pack str = unsafeCreate (P.length str) $ \p -> go p str
468468

469469
#else /* hack away */
470470

471-
pack str = unsafeCreate (P.length str) $ \(Ptr p) -> stToIO (go p 0# str)
471+
pack str = unsafeCreate (P.length str) $ \(Ptr p) -> stToIO (goz str p 0# )
472472
where
473-
{-@ decrease go 3 @-}
474-
go _ _ [] = return ()
475-
go p i (W8# c:cs) = writeByte p i c >> go p (i +# 1#) cs
473+
{- goz :: _ -> _ -> cs:_ -> _ / [len cs] -}
474+
goz [] _ _ = return ()
475+
goz (W8# c:cs) p i = writeByte p i c >> goz cs p (i +# 1#)
476476

477477
writeByte p i c = ST $ \s# ->
478478
case writeWord8OffAddr# p i c s# of s2# -> (# s2#, () #)
@@ -2343,3 +2343,38 @@ findFromEndUntil f ps@(PS x s l) =
23432343
else findFromEndUntil f (PS x s (l-1))
23442344

23452345

2346+
2347+
-- // for unfoldrN
2348+
{-@ qualif PLenNat(v:GHC.Ptr.Ptr a): (0 <= plen v)
2349+
@-}
2350+
2351+
-- // for UnpackFoldrINLINED
2352+
{-@ qualif UnpackFoldrINLINED(v:List a, n:int, acc:List a): (len v = n + 1 + (len acc))
2353+
@-}
2354+
2355+
-- // for ByteString.inits
2356+
{-@ qualif BLenGt(v:Data.ByteString.Internal.ByteString, n:int): ((bLength v) > n)
2357+
@-}
2358+
2359+
-- // for ByteString.concat
2360+
{-@ qualif BLens(v:List Data.ByteString.Internal.ByteString) : (0 <= bLengths v)
2361+
@-}
2362+
2363+
{-@ qualif BLenLE(v:GHC.Ptr.Ptr a, bs:List Data.ByteString.Internal.ByteString): (bLengths bs <= plen v)
2364+
@-}
2365+
2366+
-- // for ByteString.splitWith
2367+
{-@ qualif SplitWith(v:List Data.ByteString.Internal.ByteString, l:int): ((bLengths v) + (len v) - 1 = l)
2368+
@-}
2369+
2370+
-- // for ByteString.unfoldrN
2371+
{-@ qualif PtrDiff(v:int, i:int, p:GHC.Ptr.Ptr a): (i - v <= plen p)
2372+
@-}
2373+
2374+
-- // for ByteString.split
2375+
{-@ qualif BSValidOff(v:int,l:int,p:GHC.ForeignPtr.ForeignPtr a): (v + l <= fplen p)
2376+
@-}
2377+
2378+
2379+
{-@ qualif SplitLoop(v:List Data.ByteString.Internal.ByteString, l:int, n:int): ((bLengths v) + (len v) - 1 = l - n)
2380+
@-}

0 commit comments

Comments
 (0)