diff options
| author | John MacFarlane <[email protected]> | 2025-07-23 14:09:34 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-07-23 14:10:43 -0700 |
| commit | fb28952bec116fcf1b3d8e7848373004b66a4fe7 (patch) | |
| tree | 94db3a293b3c9047fa217d4e42b1fa3b706423eb | |
| parent | 7ec7efeee72a537a2a8519887321edff96551210 (diff) | |
Revise Makefile and CI treatment of `--ghc-options`.
Previously we set `--ghc-options` in Makefile and CI; but this
overrides the ghc-options set in the pandoc.cabal file.
Better to add options one-by-one using `--ghc-option`.
We no longer use GHC_OPTIONS and just put these extra options
in CABAL_OPTIONS.
| -rw-r--r-- | .github/workflows/ci.yml | 28 | ||||
| -rw-r--r-- | Makefile | 14 | ||||
| -rw-r--r-- | pandoc.cabal | 2 |
3 files changed, 15 insertions, 29 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c156e4967..00135c94d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,36 +50,28 @@ jobs: versions: - ghc: '8.10' cabal: 'latest' - cabalopts: '' - ghcopts: '-Werror' + cabalopts: '--ghc-option=-Werror' - ghc: '9.0' cabal: 'latest' - cabalopts: '' - ghcopts: '-Werror' + cabalopts: '--ghc-option=-Werror' - ghc: '9.2' cabal: 'latest' - cabalopts: '' - ghcopts: '-Werror' + cabalopts: '--ghc-option=-Werror' - ghc: '9.4' cabal: 'latest' - cabalopts: '' - ghcopts: '-Werror' + cabalopts: '--ghc-option=-Werror' - ghc: '9.6' cabal: 'latest' - cabalopts: '' - ghcopts: '-Werror' + cabalopts: '--ghc-option=-Werror' - ghc: '9.8' cabal: 'latest' - cabalopts: '' - ghcopts: '-Werror' + cabalopts: '--ghc-option=-Werror' - ghc: '9.10' cabal: 'latest' - cabalopts: '' - ghcopts: '' + cabalopts: '--ghc-option=-Werror' - ghc: '9.12' cabal: 'latest' - cabalopts: '--allow-newer' - ghcopts: '' + cabalopts: '--allow-newer --ghc-option=-Werror' steps: - uses: actions/checkout@v4 @@ -120,8 +112,8 @@ jobs: - name: Build and test run: | - cabal build ${{ matrix.versions.cabalopts }} --enable-tests --disable-optimization --ghc-options="${{ matrix.verisons.ghcopts }}" all - cabal test ${{ matrix.versions.cabalopts }} --disable-optimization --ghc-options="${{ matrix.verisons.ghcopts }}" all + cabal build ${{ matrix.versions.cabalopts }} --enable-tests --disable-optimization all + cabal test ${{ matrix.versions.cabalopts }} --disable-optimization all linux-stack: @@ -12,8 +12,7 @@ BASELINECMD= else BASELINECMD=--baseline $(BASELINE) endif -GHCOPTS=-fwrite-ide-info -fdiagnostics-color=always -Wall -j +RTS -A8m -RTS -CABALOPTS?=--disable-optimization -f-export-dynamic +CABALOPTS?=--disable-optimization -f-export-dynamic --ghc-option=-fwrite-ide-info --ghc-option=-fdiagnostics-color=always --ghc-option=-j WEBSITE=../../web/pandoc.org REVISION?=1 BENCHARGS?=--csv bench_$(TIMESTAMP).csv $(BASELINECMD) --timeout=6 +RTS -T --nonmoving-gc -RTS $(if $(PATTERN),--pattern "$(PATTERN)",) @@ -24,7 +23,6 @@ all: build test binpath ## build executable and run tests build: ## build executable cabal build \ - --ghc-options='$(GHCOPTS)' \ $(CABALOPTS) pandoc-cli .PHONY: build @@ -33,7 +31,7 @@ prof: ## build with profiling and optimizations .PHONY: prof binpath: ## print path of built pandoc executable - @cabal list-bin -v0 $(CABALOPTS) --ghc-options='$(GHCOPTS)' pandoc-cli + @cabal list-bin -v0 $(CABALOPTS) pandoc-cli .PHONY: binpath ghcid: ## run ghcid @@ -52,14 +50,12 @@ linecounts: ## print line counts for each module # make test TESTARGS='--accept' test: ## unoptimized build and run tests with cabal cabal test \ - --ghc-options='$(GHCOPTS)' \ $(CABALOPTS) \ --test-options="--hide-successes --ansi-tricks=false $(TESTARGS)" all .PHONY: test quick-stack: ## unoptimized build and tests with stack stack install \ - --ghc-options='$(GHCOPTS)' \ --system-ghc --flag 'pandoc:embed_data_files' \ --fast \ --test \ @@ -149,7 +145,7 @@ latex-package-dependencies: ## print packages used by default latex template coverage: ## code coverage information cabal test \ - --ghc-options='-fhpc $(GHCOPTS)' \ + --ghc-option=-fhpc \ $(CABALOPTS) \ --test-options="--hide-successes --ansi-tricks=false $(TESTARGS)" hpc markup --destdir=coverage test/test-pandoc.tix @@ -169,8 +165,7 @@ debpkg: ## create linux package -v `pwd`/linux/artifacts:/artifacts \ --user $(id -u):$(id -g) \ -e REVISION=$(REVISION) \ - -e GHCOPTS="-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread" \ - -e CABALOPTS="-f-export-dynamic -fembed_data_files -fserver -flua --enable-executable-static -j4" \ + -e CABALOPTS="-f-export-dynamic -fembed_data_files -fserver -flua --enable-executable-static -j4 --ghc-option=-j4 --ghc-option=-split-sections --ghc-option=-optc-Os --ghc-option=-optl=-pthread" \ -w /mnt \ --memory=0 \ --rm \ @@ -317,7 +312,6 @@ help: ## display this help @echo @echo "Environment variables with default values:" @printf "%-16s%s\n" "CABALOPTS" "$(CABALOPTS)" - @printf "%-16s%s\n" "GHCOPTS" "$(GHCOPTS)" @printf "%-16s%s\n" "TESTARGS" "$(TESTARGS)" @printf "%-16s%s\n" "BASELINE" "$(BASELINE)" @printf "%-16s%s\n" "REVISION" "$(REVISION)" diff --git a/pandoc.cabal b/pandoc.cabal index 98493dc85..d045f49f7 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -451,7 +451,7 @@ common common-options -Wpartial-fields -Wmissing-signatures -fhide-source-paths - -- -Wmissing-export-lists + -Wmissing-export-lists if impl(ghc >= 8.10) ghc-options: -Wunused-packages |
