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

Is the use of doctests in validate.sh up to date? #9623

Open
philderbeast opened this issue Jan 18, 2024 · 1 comment
Open

Is the use of doctests in validate.sh up to date? #9623

philderbeast opened this issue Jan 18, 2024 · 1 comment

Comments

@philderbeast
Copy link
Collaborator

philderbeast commented Jan 18, 2024

Is the use of doctests in validate.sh up to date? In Makefile we're using;

DOCTEST := cabal repl --with-ghc=doctest --repl-options="-w" --project-file=cabal.project.doctest

cabal/Makefile

Lines 93 to 98 in 28e2926

doctest :
$(DOCTEST) Cabal-syntax
$(DOCTEST) Cabal-described
$(DOCTEST) --build-depends=QuickCheck Cabal
$(DOCTEST) cabal-install-solver
$(DOCTEST) cabal-install

The doctest step is not using the cabal repl --with-ghc=doctest method but shouldn't it since that is now the recommended way, #8504 (comment)?

cabal/validate.sh

Lines 387 to 392 in 28e2926

step_doctest() {
print_header "Cabal: doctest"
cabal-env --name doctest-Cabal --transitive QuickCheck
cabal-env --name doctest-Cabal array bytestring containers deepseq directory filepath pretty process time binary unix text parsec mtl
timed doctest -package-env=doctest-Cabal --fast Cabal/Distribution Cabal/Language
}

If I --help, --list-steps and then walk through the steps in order, all with the --doctest option, it fails at the doctest step;

$ sh validate.sh --help
./validate.sh - build & test

Usage: ./validate.sh [options]
  A script which runs all the tests.

Available options:
  -j, --jobs JOBS                   cabal build -j argument (default:  24)
      --libonly                     Test only Cabal-the-library
      --cli                         Test both Cabal-the-library and cabal-install
      --(no-)run-lib-tests          Run library tests
      --(no-)run-cli-tests          Run client tests
      --(no-)run-lib-suite          Run cabal-testsuite with library
      --(no-)run-cli-suite          Run cabal-testsuite with client
  -w, --with-compiler HC            With compiler
      --with-cabal CABAL            With cabal-install
      --extra-hc HC                 Extra compiler to run test-suite with
      --(no-)doctest                Run doctest on library
      --(no-)solver-benchmarks      Build and trial run solver-benchmarks
      --complete-hackage-tests      Run hackage-tests on complete Hackage data
      --partial-hackage-tests       Run hackage-tests on parts of Hackage data
  -v, --verbose                     Verbose output
  -q, --quiet                       Less output
  -s, --step STEP                   Run only specific step (can be specified multiple times)
      --list-steps                  List steps and build-targets and exit
      --help                        Print this message and exit
      
$ sh validate.sh --list-steps --doctest
Targets: Cabal cabal-testsuite Cabal-tests Cabal-QuickCheck Cabal-tree-diff Cabal-described cabal-install cabal-install-solver cabal-benchmarks
Steps:   print-config print-tool-versions build doctest lib-tests lib-suite cli-tests cli-suite time-summary

$ sh validate.sh -s print-config --doctest
=== print-config ============================================================= 11:51:30 ===
compiler:            ghc
runhaskell:          ghc
cabal-install:       cabal
jobs:                -j24
Cabal tests:         true
cabal-install tests: true
cabal-testsuite:     true
library only:        false
dependencies only:   false
doctest:             true
benchmarks:          false
verbose:             false
extra compilers:     

$ sh validate.sh -s print-tool-versions --doctest
=== print-tool-versions ====================================================== 11:51:51 ===
ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.4.8
<<< ghc --version (0/0 sec) 

cabal --version
cabal-install version 3.11.0.0
compiled using version 3.11.0.0 of the Cabal library 
<<< cabal --version (0/0 sec) 

$ sh validate.sh -s build --doctest
...

=== Step Build: actual build ================================================= 11:52:36 ===
cabal build -j24 -w ghc --builddir=dist-newstyle-validate-ghc-9.4.8 --project-file=cabal.project.validate Cabal cabal-testsuite Cabal-tests Cabal-QuickCheck Cabal-tree-diff Cabal-described cabal-install cabal-install-solver cabal-benchmarks
Up to date
<<< cabal build -j24 -w ghc --builddir=dist-newstyle-validate-ghc-9.4.8 --project-file=cabal.project.validate Cabal cabal-testsuite Cabal-tests Cabal-QuickCheck Cabal-tree-diff Cabal-described cabal-install cabal-install-solver cabal-benchmarks (0/0 sec)

$ sh validate.sh -j 24 -s doctest --doctest
=== Cabal: doctest =========================================================== 11:53:14 ===
validate.sh: 389: cabal-env: not found
validate.sh: 390: cabal-env: not found
doctest -package-env=doctest-Cabal --fast Cabal/Distribution Cabal/Language
doctest: Package environment "doctest-Cabal" not found
<<< doctest -package-env=doctest-Cabal --fast Cabal/Distribution Cabal/Language (0/0 sec, 1) 
<<< doctest -package-env=doctest-Cabal --fast Cabal/Distribution Cabal/Language (0/0 sec, 1)
@philderbeast
Copy link
Collaborator Author

The validate script can be changed to work using --with-ghc=doctest;

$ sh validate.sh -s doctest
=== Install doctest ========================================================== 13:12:38 ===
Resolving dependencies...
Symlinking 'doctest' to '~/.cabal/bin/doctest'
=== Doctest: Cabal-syntax ==================================================== 13:12:40 ===
cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest Cabal-syntax

when making flags consistent: warning:
    Optimization flags conflict with --interactive; optimization flags ignored.
Examples: 134  Tried: 134  Errors: 0  Failures: 0
<<< cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest Cabal-syntax (16/18 sec) 

=== Doctest: Cabal-described ================================================= 13:12:56 ===
cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest Cabal-described
Examples: 11  Tried: 11  Errors: 0  Failures: 0
<<< cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest Cabal-described (7/25 sec) 

=== Doctest: Cabal =========================================================== 13:13:03 ===
cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest --build-depends=QuickCheck Cabal
Examples: 26  Tried: 26  Errors: 0  Failures: 0
<<< cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest --build-depends=QuickCheck Cabal (12/37 sec) 

=== Doctest: cabal-install-solver ============================================ 13:13:15 ===
cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest cabal-install-solver
Examples: 21  Tried: 21  Errors: 0  Failures: 0
<<< cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest cabal-install-solver (8/45 sec) 

=== Doctest: cabal-install =================================================== 13:13:23 ===
cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest cabal-install
Examples: 27  Tried: 27  Errors: 0  Failures: 0
<<< cabal repl --verbose=0 --builddir=dist-newstyle-validate-ghc-9.4.8 --with-ghc=doctest --repl-options=-w --ghc-options=-Wwarn --allow-newer=False --project-file=cabal.project.doctest cabal-install (15/60 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant