Skip to content

Commit 5a0361c

Browse files
committed
Makefile rule to build Cabal with GHC-7.6
1 parent c364c5d commit 5a0361c

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

Makefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ LEXER_HS:=Cabal/Distribution/Fields/Lexer.hs
66
SPDX_LICENSE_HS:=Cabal/Distribution/SPDX/LicenseId.hs
77
SPDX_EXCEPTION_HS:=Cabal/Distribution/SPDX/LicenseExceptionId.hs
88

9-
CABALBUILD := cabal new-build --enable-tests
10-
CABALRUN := cabal new-run --enable-tests
9+
CABALBUILD := cabal v2-build
10+
CABALRUN := cabal v2-run
1111

1212
# default rules
1313

@@ -19,6 +19,10 @@ lib : $(LEXER_HS)
1919
exe : $(LEXER_HS)
2020
$(CABALBUILD) cabal-install:exes
2121

22+
# Build library with oldest supported GHC
23+
lib-ghc-7.6 :
24+
$(CABALBUILD) --project-file=cabal.project.libonly --with-compiler=ghc-7.6.3 Cabal:libs
25+
2226
# source generation: Lexer
2327

2428
lexer : $(LEXER_HS)
@@ -33,10 +37,10 @@ $(LEXER_HS) : boot/Lexer.x
3337
spdx : $(SPDX_LICENSE_HS) $(SPDX_EXCEPTION_HS)
3438

3539
$(SPDX_LICENSE_HS) : boot/SPDX.LicenseId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDX.hs license-list-data/licenses-3.0.json license-list-data/licenses-3.2.json
36-
cabal new-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-spdx -- boot/SPDX.LicenseId.template.hs license-list-data/licenses-3.0.json license-list-data/licenses-3.2.json license-list-data/licenses-3.6.json $(SPDX_LICENSE_HS)
40+
cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-spdx -- boot/SPDX.LicenseId.template.hs license-list-data/licenses-3.0.json license-list-data/licenses-3.2.json license-list-data/licenses-3.6.json $(SPDX_LICENSE_HS)
3741

3842
$(SPDX_EXCEPTION_HS) : boot/SPDX.LicenseExceptionId.template.hs cabal-dev-scripts/src/GenUtils.hs cabal-dev-scripts/src/GenSPDXExc.hs license-list-data/exceptions-3.0.json license-list-data/exceptions-3.2.json
39-
cabal new-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-spdx-exc -- boot/SPDX.LicenseExceptionId.template.hs license-list-data/exceptions-3.0.json license-list-data/exceptions-3.2.json license-list-data/exceptions-3.6.json $(SPDX_EXCEPTION_HS)
43+
cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-spdx-exc -- boot/SPDX.LicenseExceptionId.template.hs license-list-data/exceptions-3.0.json license-list-data/exceptions-3.2.json license-list-data/exceptions-3.6.json $(SPDX_EXCEPTION_HS)
4044

4145
# cabal-install.cabal file generation
4246

@@ -59,21 +63,21 @@ cabal-install-monolithic : cabal-install/cabal-install.cabal.pp
5963
gen-extra-source-files : gen-extra-source-files-lib gen-extra-source-files-cli
6064

6165
gen-extra-source-files-lib :
62-
cabal new-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-extra-source-files -- $$(pwd)/Cabal/Cabal.cabal
66+
cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-extra-source-files -- $$(pwd)/Cabal/Cabal.cabal
6367

6468
# We need to generate cabal-install-dev so the test modules are in .cabal file!
6569
gen-extra-source-files-cli :
6670
$(MAKE) cabal-install-dev
67-
cabal new-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-extra-source-files -- $$(pwd)/cabal-install/cabal-install.cabal.pp $$(pwd)/cabal-install/cabal-install.cabal
71+
cabal v2-run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-extra-source-files -- $$(pwd)/cabal-install/cabal-install.cabal.pp $$(pwd)/cabal-install/cabal-install.cabal
6872
$(MAKE) cabal-install-prod
6973

7074
# ghcid
7175

7276
ghcid-lib :
73-
ghcid -c 'cabal new-repl Cabal'
77+
ghcid -c 'cabal v2-repl Cabal'
7478

7579
ghcid-cli :
76-
ghcid -c 'cabal new-repl cabal-install'
80+
ghcid -c 'cabal v2-repl cabal-install'
7781

7882
# doctests (relies on .ghc.environment files)
7983

@@ -83,7 +87,7 @@ doctest :
8387
# tests
8488

8589
check-tests :
86-
$(CABALRUN) --enable-tests check-tests -- --cwd Cabal ${TEST}
90+
$(CABALRUN) check-tests -- --cwd Cabal ${TEST}
8791

8892
parser-tests :
8993
$(CABALRUN) parser-tests -- --cwd Cabal ${TEST}

cabal.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
packages: Cabal/ cabal-testsuite/ cabal-install/ solver-benchmarks/
2+
packages: Cabal/ cabal-testsuite/
3+
packages: cabal-install/ solver-benchmarks/
4+
tests: True
25

36
-- Uncomment to allow picking up extra local unpacked deps:
47
--optional-packages: */

cabal.project.libonly

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
packages: Cabal/ cabal-testsuite/
2+
tests: True
3+
4+
-- Uncomment to allow picking up extra local unpacked deps:
5+
--optional-packages: */
6+
7+
program-options
8+
-- So us hackers get all the assertion failures early:
9+
--
10+
-- NOTE: currently commented out, see
11+
-- https://github.com/haskell/cabal/issues/3911
12+
--
13+
-- ghc-options: -fno-ignore-asserts
14+
--
15+
-- as a workaround we specify it for each package individually:
16+
package Cabal
17+
ghc-options: -fno-ignore-asserts
18+
package cabal-testsuite
19+
ghc-options: -fno-ignore-asserts

0 commit comments

Comments
 (0)