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

Compile with GHC 8.8 #4808

Merged
merged 12 commits into from
Jan 25, 2020
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 24 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist: trusty
sudo: false
dist: xenial

language: c

Expand All @@ -11,33 +10,25 @@ matrix:
include:
- env: CABALVER="2.4" GHCVER="8.6.5" STACKVER="14.15" STYLISH=YES
addons: {apt: {packages: [cabal-install-2.4,ghc-8.6.5,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.2" GHCVER="7.10.3" TESTS="test_c"
compiler: ": #GHC 7.10.3"
addons: {apt: {packages: [cabal-install-2.2,ghc-7.10.3,cppcheck,hscolour], sources: [hvr-ghc]}}
# Disabled because it's always timing out
# - env: CABALVER="1.24" GHCVER="8.0.1" TESTS="test_c"
# compiler: ": #GHC 8.0.1"
# addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.0" GHCVER="8.2.2" TESTS="lib_doc doc"
- env: CABALVER="2.4" GHCVER="8.2.2" TESTS="lib_doc doc"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.0" GHCVER="8.2.2" TESTS="test_js"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.2.2" TESTS="test_js"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.0" GHCVER="8.2.2" TESTS="test_c"
addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
- env: CABALVER="2.4" GHCVER="8.2.2" TESTS="test_c"
compiler: ": #GHC 8.2.2"
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,cppcheck,hscolour], sources: [hvr-ghc]}}
#TODO: The idris built with those fails due to libffi dynamic linking version mismatch.
# Caused by the GHC backport to Trusty?
# - env: CABALVER="2.2" GHCVER="8.4.1" TESTS="lib_doc doc"
# compiler: ": #GHC 8.4.1"
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="2.2" GHCVER="8.4.1" TESTS="test_js"
# compiler: ": #GHC 8.4.1"
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,cppcheck,hscolour], sources: [hvr-ghc]}}
# - env: CABALVER="2.2" GHCVER="8.4.1" TESTS="test_c"
# compiler: ": #GHC 8.4.1"
# addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.1,cppcheck,hscolour], sources: [hvr-ghc]}}
addons: {apt: {packages: [cabal-install-2.4,ghc-8.2.2,cppcheck,hscolour], 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]}}
fast-finish: true

cache:
Expand Down Expand Up @@ -88,7 +79,7 @@ install:
# causing cabal's default configuration (jobs: $ncpus)
# to run into the GHC #9221 bug which can result in longer build-times.
- $SED -i -r 's/(^jobs:).*/\1 2/' $HOME/.cabal/config
- cabal install -f FFI --only-dependencies --enable-tests --dry -v > installplan.txt
- cabal v1-install -f FFI --only-dependencies --enable-tests --dry -v > installplan.txt
- $SED -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
# check whether current requested install-plan matches cached package-db snapshot
- if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
Expand All @@ -101,7 +92,7 @@ install:
echo "cabal build-cache MISS";
rm -rf $HOME/.cabsnap;
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
cabal install -f FFI --only-dependencies --enable-tests;
cabal v1-install -f FFI --only-dependencies --enable-tests;
fi
# snapshot package-db on cache miss
- if [ ! -d $HOME/.cabsnap ];
Expand All @@ -114,26 +105,26 @@ install:

before_script:
- ORIGINAL_DIR=$(pwd)
- cabal sdist
- cabal v1-sdist
- cd ..
- tar -xf ${ORIGINAL_DIR}/dist/${PKGNAME}*.tar.gz
- cd ${PKGNAME}*
script:
###
- echo 'Configure...' && echo -en 'travis_fold:start:script.configure\\r'
- cabal configure -f FFI -f CI --enable-tests
- cabal v1-configure -f FFI -f CI --enable-tests
- echo -en 'travis_fold:end:script.configure\\r'
###
- echo 'Build...' && echo -en 'travis_fold:start:script.build\\r'
- cabal build
- cabal v1-build
- echo -en 'travis_fold:end:script.build\\r'
###
- echo 'Copy...' && echo -en 'travis_fold:start:script.copy\\r'
- cabal copy
- cabal v1-copy
- echo -en 'travis_fold:end:script.copy\\r'
###
- echo 'Register...' && echo -en 'travis_fold:start:script.register\\r'
- cabal register
- cabal v1-register
- echo -en 'travis_fold:end:script.register\\r'
###
- echo 'Cppcheck...' && echo -en 'travis_fold:start:script.cppcheck\\r'
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# New since last release
+ Updated to work with GHC 8.8 and cabal 3.0

# New in 1.3.2
+ Documentation added to proof section

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ stylize:
./stylize.sh

test_c:
$(CABAL) test $(ARGS) --test-options \
$(CABAL) v1-test $(ARGS) --test-options \
"$(TEST-ARGS) --rerun-update +RTS -N$(TEST-JOBS) -RTS"

test_js:
$(CABAL) test $(ARGS) --test-options \
$(CABAL) v1-test $(ARGS) --test-options \
"$(TEST-ARGS) --node --rerun-update +RTS -N$(TEST-JOBS) -RTS"

test_update:
$(CABAL) test $(ARGS) --test-options \
$(CABAL) v1-test $(ARGS) --test-options \
"$(TEST-ARGS) --accept +RTS -N$(TEST-JOBS) -RTS"

test_clean:
Expand All @@ -56,7 +56,7 @@ linecount:

#Note: this doesn't yet link to Hackage properly
doc: dist/setup-config
$(CABAL) haddock --hyperlink-source --html --hoogle --html-location="https://hackage.haskell.org/packages/archive/\$$pkg/latest/doc/html" --haddock-options="--title Idris"
$(CABAL) v1-haddock --hyperlink-source --html --hoogle --html-location="https://hackage.haskell.org/packages/archive/\$$pkg/latest/doc/html" --haddock-options="--title Idris"

lib_doc:
$(MAKE) -C libs IDRIS=../../dist/build/idris/idris doc
Expand Down
33 changes: 0 additions & 33 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -215,36 +215,6 @@ idrisConfigure _ flags pkgdesc local = do
autogenComponentModulesDir lbi _ = autogenModulesDir lbi
#endif

idrisPreSDist args flags = do
let dir = S.fromFlag (S.sDistDirectory flags)
let verb = S.fromFlag (S.sDistVerbosity flags)
generateVersionModule verb "src" True
generateBuildFlagsModule verb "src" []
generateTargetModule verb "src" "./libs"
generateToolchainModule verb "src" Nothing
preSDist simpleUserHooks args flags

idrisSDist sdist pkgDesc bi hooks flags = do
pkgDesc' <- addGitFiles pkgDesc
sdist pkgDesc' bi hooks flags
where
addGitFiles :: PackageDescription -> IO PackageDescription
addGitFiles pkgDesc = do
files <- gitFiles
return $ pkgDesc { extraSrcFiles = extraSrcFiles pkgDesc ++ files}
gitFiles :: IO [FilePath]
gitFiles = liftM lines (readProcess "git" ["ls-files"] "")

idrisPostSDist args flags desc lbi = do
Control.Exception.catch (do let file = "src" </> "Version_idris" Px.<.> "hs"
let targetFile = "src" </> "Target_idris" Px.<.> "hs"
putStrLn $ "Removing generated modules:\n "
++ file ++ "\n" ++ targetFile
removeFile file
removeFile targetFile)
(\e -> let e' = (e :: SomeException) in return ())
postSDist simpleUserHooks args flags desc lbi

#if !(MIN_VERSION_Cabal(2,0,0))
rewriteFileEx :: Verbosity -> FilePath -> String -> IO ()
rewriteFileEx _ = rewriteFile
Expand Down Expand Up @@ -353,8 +323,5 @@ main = defaultMainWithHooks $ simpleUserHooks
, postInst = \_ flags pkg local ->
idrisInstall (S.fromFlag $ S.installVerbosity flags)
NoCopyDest pkg local
, preSDist = idrisPreSDist
, sDistHook = idrisSDist (sDistHook simpleUserHooks)
, postSDist = idrisPostSDist
, testHook = idrisTestHook
}
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
version: 1.0.{build}
init:
- ps: >-
choco install cabal --version=2.4.1.0 --no-progress
choco install cabal --no-progress

mkdir C:\ghc

Invoke-WebRequest "https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-x86_64-unknown-mingw32.tar.xz" -OutFile C:\ghc\ghc.tar.xz -UserAgent "Curl"
Invoke-WebRequest "https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-unknown-mingw32.tar.xz" -OutFile C:\ghc\ghc.tar.xz -UserAgent "Curl"

7z x C:\ghc\ghc.tar.xz -oC:\ghc

7z x C:\ghc\ghc.tar -oC:\ghc

$env:PATH="$env:PATH;c:\ghc\ghc-8.4.3\bin;$HOME\AppData\Roaming\cabal\bin"
$env:PATH="$env:PATH;c:\ghc\ghc-8.8.2\bin;$HOME\AppData\Roaming\cabal\bin"

cabal v1-update

Expand Down
Loading