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

cabal-install/tests/IntegrationTests2.hs is sensitive to local configuration #10187

Closed
geekosaur opened this issue Jul 8, 2024 · 3 comments · Fixed by #10205
Closed

cabal-install/tests/IntegrationTests2.hs is sensitive to local configuration #10187

geekosaur opened this issue Jul 8, 2024 · 3 comments · Fixed by #10205

Comments

@geekosaur
Copy link
Collaborator

Describe the bug
If my local cabal configuration contains documentation: True, running validate.sh locally fails with

Integration tests (internal)
  Regression tests
    program options scope all:                 FAIL (1.36s)
      tests/IntegrationTests2.hs:1560:
      q
      expected: Just ["-fno-full-laziness"]
       but got: Just ["-haddock"]
      Use -p '/program options scope all/' to rerun this test only.
    program options scope local:               FAIL (1.26s)
      tests/IntegrationTests2.hs:1585:
      q
      expected: Just ["-fno-full-laziness"]
       but got: Just ["-haddock"]
      Use -p '/program options scope local/' to rerun this test only.
    program options scope specific:            FAIL (1.33s)
      tests/IntegrationTests2.hs:1610:
      q
      expected: Nothing
       but got: Just ["-haddock"]
      Use -p '/program options scope specific/' to rerun this test only.

Validation succeeds if I comment out the documentation directive in my local config.

To Reproduce
Steps to reproduce the behavior:

$ vi ~/.config/cabal/config # and set "documentation: True"
$ git clone https://github.com/haskell/cabal
$ cd cabal
$ cabal build all
$ ./validate.sh --with-cabal=$(cabal list-bin cabal)

Expected behavior
Validation should succeed regardless of the local setting of documentation.

System information

  • Linux Ubuntu 22.04.3
  • cabal master HEAD as of 2024-07-08, ghc 9.6.6
@geekosaur
Copy link
Collaborator Author

Should validate.sh point to a default config file via CABAL_CONFIG, or does it need to use some other mechanism to avoid overriding test-specific config files?

@ulysses4ever
Copy link
Collaborator

dunno but perhaps if you do something wrong and override the test-specific configs it will fail horribly?..

@geekosaur
Copy link
Collaborator Author

It looks like IntegrationTests2 already has a default cabal config; it's just not using it, as far as I can tell, or at least isn't using it everywhere it needs to be used. I'm thinking that needs to be moved into validate.sh.

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

Successfully merging a pull request may close this issue.

2 participants