Skip to content

Commit

Permalink
Merge pull request #4827 from ilyakooo0/lts-15.3
Browse files Browse the repository at this point in the history
Migrated to lts-15.3
  • Loading branch information
melted committed Mar 20, 2020
2 parents ccbdb4b + dba5ef4 commit c6c928f
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 83 deletions.
37 changes: 23 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

matrix:
include:
- env: CABALVER="2.4" GHCVER="8.6.5" STACKVER="14.15" STYLISH=YES
- env: CABALVER="2.4" GHCVER="8.6.5" STACKVER="15.4" STYLISH=YES
addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.5,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.2.2" TESTS="lib_doc doc"
compiler: ": #GHC 8.2.2"
Expand All @@ -19,18 +19,26 @@ matrix:
- env: CABALVER="2.4" GHCVER="8.2.2" TESTS="test_c"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.2" IDRIS2=YES
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.2], sources: [hvr-ghc]}}

# - env: CABALVER="3.0" GHCVER="8.8.1" TESTS="lib_doc doc"
# compiler: ": #GHC 8.8.1"
# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="3.0" GHCVER="8.8.1" TESTS="test_js"
# compiler: ": #GHC 8.8.1"
# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="3.0" GHCVER="8.8.1" TESTS="test_c"
# compiler: ": #GHC 8.8.1"
# addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.4.4" TESTS="lib_doc doc"
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.4.4,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.4.4" TESTS="test_js"
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.4.4,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.4.4" TESTS="test_c"
compiler: ": #GHC 8.4.4"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.4.4,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" TESTS="lib_doc doc"
compiler: ": #GHC 8.8.3"
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" TESTS="test_js"
compiler: ": #GHC 8.8.3"
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" TESTS="test_c"
compiler: ": #GHC 8.8.3"
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="3.0" GHCVER="8.8.3" IDRIS2=YES
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.3], sources: [hvr-ghc]}}
fast-finish: true

cache:
Expand Down Expand Up @@ -119,7 +127,7 @@ install:
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
fi


before_script:
- ORIGINAL_DIR=$(pwd)
Expand All @@ -128,6 +136,7 @@ before_script:
- tar -xf ${ORIGINAL_DIR}/dist/${PKGNAME}*.tar.gz
- cd ${PKGNAME}*
script:
- export LD_PRELOAD=/opt/ghc/${GHCVER}/lib/ghc-${GHCVER}/rts/libffi.so.7
###
- echo 'Configure...' && echo -en 'travis_fold:start:script.configure\\r'
- cabal v1-configure -f FFI -f CI --enable-tests
Expand Down
13 changes: 11 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig stack build
## Issue with GHC on Ubuntu/Fedora

There is an upstream issue with GHC on some Ubuntu and Fedora machines.
The issue is that for GHC versions greater than 8.4.X linking to libFFI is broken.
The issue is that for GHC versions greater than 8.4.X linking to libFFI uses the version of libFFI shipped with GHC, instead of the system version.

See the following GHC issue page for more information:

<https://gitlab.haskell.org/ghc/ghc/issues/15397>
Expand All @@ -141,4 +142,12 @@ Specifically, one will see an error message along the lines of:

> error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
We have supplied an alternative stack configuration file (`stack-alt.yaml`) that will use a version of GHC prior to the upstream issue being introduced.
A workround for this bug is to override the used libffi version (this is what we use on CI):

```bash
export LD_PRELOAD=/opt/ghc/${GHCVER}/lib/ghc-${GHCVER}/rts/libffi.so.7
```

## GHC 8.6

For reasons that haven't been investigated building the Idris compiler with GHC 8.6 leads to a compiler which doesn't pass test.
46 changes: 31 additions & 15 deletions idris.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@ Build-type: Custom

Tested-With: GHC == 7.10.3, GHC == 8.0.1

-- NOTE: due to https://github.com/haskell/cabal/issues/6125 the use of ** is
-- heavily discouraged.
Data-files: idrisdoc/styles.css
jsrts/**/*.js
jsrts/jsbn/*.js
jsrts/*.js
jsrts/jsbn/LICENSE
rts/Makefile
rts/**/*.c
rts/**/*.h
rts/*.c
rts/seL4/*.c
rts/arduino/*.c
rts/windows/*.c
rts/windows/*.h
rts/*.h
rts/seL4/CMakeLists.txt
rts/seL4/README.md

Expand All @@ -64,24 +71,34 @@ Extra-doc-files:
RELEASE-CHECKS.md
idris-tutorial.pdf
man/idris.1
samples/**/*.idr
samples/**/*.lidr
samples/effects/*.idr
samples/misc/*.idr
samples/tutorial/*.idr
samples/ST/*.idr
samples/ST/Graphics/*.idr
samples/ST/Net/*.idr
samples/misc/*.lidr

-- extra-source-files is generated by Setup.hs using `git --ls-files`.
Extra-source-files:
Makefile
config.mk
custom.mk-alldeps
mkpkg.sh
stack-alt.yaml
stack-shell.nix
stack.yaml
stylize.sh
win-release.sh

benchmarks/*.pl
benchmarks/**/*.idr
benchmarks/**/*.ipkg
benchmarks/fasta/*.idr
benchmarks/fasta/*.ipkg
benchmarks/pidigits/*.idr
benchmarks/pidigits/*.ipkg
benchmarks/quasigroups/*.idr
benchmarks/quasigroups/*.ipkg
benchmarks/trivial/*.idr
benchmarks/trivial/*.ipkg
benchmarks/quasigroups/board

icons/*.png
Expand Down Expand Up @@ -304,13 +321,13 @@ Library
Build-depends: base >=4 && <5
, aeson >= 0.6 && < 1.5
, annotated-wl-pprint >= 0.7 && < 0.8
, ansi-terminal < 0.10
, ansi-terminal < 0.11
, ansi-wl-pprint < 0.7
, array >= 0.4.0.1 && < 0.6
, base64-bytestring < 1.1
, binary >= 0.8.4.1 && < 0.9
, blaze-html >= 0.6.1.3 && < 0.10
, blaze-markup >= 0.5.2.1 && < 0.9
, blaze-markup >= 0.5.2.1 && < 0.10
, bytestring < 0.11
, cheapskate >= 0.1.1.2 && < 0.2
, code-page >= 0.1 && < 0.3
Expand All @@ -321,9 +338,9 @@ Library
, fingertree >= 0.1.4.1 && < 0.2
, haskeline >= 0.7 && < 0.8
, ieee754 >= 0.7 && < 0.9
, megaparsec >= 7.0.4 && < 8
, megaparsec >= 7.0.4 && < 9
, mtl >= 2.1 && < 2.3
, network >= 2.7 && < 2.9
, network >= 2.7 && < 3.1.2
, optparse-applicative >= 0.13 && < 0.16
, parser-combinators >= 1.0.0
, pretty < 1.2
Expand All @@ -341,7 +358,7 @@ Library
, vector < 0.13
, vector-binary-instances < 0.3
, zip-archive > 0.2.3.5 && < 0.5
, fsnotify >= 0.2 && < 2.2
, fsnotify >= 0.2 && < 0.4
, async < 2.3

if !impl(ghc >= 8.0)
Expand Down Expand Up @@ -459,4 +476,3 @@ Executable idris-codegen-node
Default-Language: Haskell2010
ghc-prof-options: -auto-all -caf-all
ghc-options: -threaded -rtsopts -funbox-strict-fields

15 changes: 14 additions & 1 deletion src/Idris/Parser/Stack.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description : Idris parser stack and its primitives.
License : BSD3
Maintainer : The Idris Community.
-}
{-# LANGUAGE ConstraintKinds, FlexibleContexts, MultiParamTypeClasses #-}
{-# LANGUAGE CPP, ConstraintKinds, FlexibleContexts, MultiParamTypeClasses #-}
module Idris.Parser.Stack
( -- * Parsing
Parser(..)
Expand Down Expand Up @@ -77,19 +77,32 @@ parseErrorOffset = P.errorOffset . parseError
instance Message ParseError where
messageExtent err = sourcePositionFC pos
where
#if MIN_VERSION_megaparsec(8,0,0)
P.PosState {P.pstateSourcePos = pos} =
P.reachOffsetNoLine (parseErrorOffset err) (parseErrorPosState err)
#else
(pos, _) = P.reachOffsetNoLine (parseErrorOffset err) (parseErrorPosState err)
#endif
messageText = PP.text . init . P.parseErrorTextPretty . parseError
messageSource err = Just sline
where
#if MIN_VERSION_megaparsec(8,0,0)
(sline, _) = P.reachOffset (parseErrorOffset err) (parseErrorPosState err)
#else
(_, sline, _) = P.reachOffset (parseErrorOffset err) (parseErrorPosState err)
#endif

-- | A fully formatted parse error, with caret and bar, etc.
prettyError :: ParseError -> String
prettyError = P.errorBundlePretty . unParseError

{- * Mark and restore -}

#if MIN_VERSION_megaparsec(8,0,0)
type Mark = P.State String Void
#else
type Mark = P.State String
#endif

-- | Retrieve the parser state so we can restart from this point later.
mark :: Parsing m => m Mark
Expand Down
21 changes: 21 additions & 0 deletions stack-11.22.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#recheck extra-deps next on resolver or cabal file change
resolver: lts-11.22

extra-deps:
- cheapskate-0.1.1.2
- megaparsec-7.0.5
- Cabal-2.4.1.0
- network-3.1.1.1
- parser-combinators-1.0.0

flags:
idris:
FFI: true
GMP: true

ghc-options:
idris: -fwarn-unused-imports -fwarn-unused-binds

nix:
enable: false
shell-file: stack-shell.nix
20 changes: 20 additions & 0 deletions stack-12.26.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#recheck extra-deps next on resolver or cabal file change
resolver: lts-12.26

extra-deps:
- cheapskate-0.1.1.2
- megaparsec-7.0.5
- Cabal-2.4.1.0
- network-3.1.1.1

flags:
idris:
FFI: true
GMP: true

ghc-options:
idris: -fwarn-unused-imports -fwarn-unused-binds

nix:
enable: false
shell-file: stack-shell.nix
17 changes: 17 additions & 0 deletions stack-15.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#recheck extra-deps next on resolver or cabal file change
resolver: lts-15.3

extra-deps:
- cheapskate-0.1.1.2

flags:
idris:
FFI: true
GMP: true

ghc-options:
idris: -fwarn-unused-imports -fwarn-unused-binds

nix:
enable: false
shell-file: stack-shell.nix
17 changes: 17 additions & 0 deletions stack-15.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#recheck extra-deps next on resolver or cabal file change
resolver: lts-15.4

extra-deps:
- cheapskate-0.1.1.2

flags:
idris:
FFI: true
GMP: true

ghc-options:
idris: -fwarn-unused-imports -fwarn-unused-binds

nix:
enable: false
shell-file: stack-shell.nix
25 changes: 0 additions & 25 deletions stack-alt.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions stack.yaml

This file was deleted.

1 change: 1 addition & 0 deletions stack.yaml

0 comments on commit c6c928f

Please sign in to comment.