Skip to content

cabal test sometimes builds with the wrong flags. How to control its flags? #2182

Closed
@rrnewton

Description

@rrnewton

We typically run Jenkins testing jobs with large matrices of configuration options.

We have been assuming that the following series of commands would guarantee that A and B only get built once, and only with -fmyflag

cabal install ./A ./B --enable-tests -fmyflag
(cd A; cabal test)
(cd B; cabal test)

(BTW, I don't know if there is any such "algebra" of command sequences that carry guarantees! But it would help to have "cabal laws", because I currently have no idea what the "semantics" of cabal test is.)

Unfortunately, it seems that cabal test is sometimes causing a recompile of the packages. When it does that the package seems like it gets built without the right flags.

  • Why not pass -fmyflag to cabal test? Well, it doesn't support flag arguments!
  • Why not do everything from one cabal install line with --run-tests. Two reasons:
    • Sometimes we need extra logic in the script to determine if a particular test suite can run
    • We want to get the testing output in the logs. We really like
      --show-details=always, but as far as I can tell we cannot get that through cabal install.

So install doesn't take arguments meant for test and test doesn't take arguments meant for cabal. But these different modes call eachother! Fixing our problem could be accomplished either by fixing these argument limitations or guaranteeing that cabal test won't reinstall.

This is tangentially related to tickets: #1647, #2058, #2075, #2176

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions