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 run -O0 seems to use wrong executable #6994

Open
sjakobi opened this issue Jul 27, 2020 · 3 comments
Open

cabal run -O0 seems to use wrong executable #6994

sjakobi opened this issue Jul 27, 2020 · 3 comments

Comments

@sjakobi
Copy link
Member

sjakobi commented Jul 27, 2020

While working on https://github.com/dhall-lang/dhall-haskell, I've run into a weird issue where cabal run -O0 seems to use an executable that doesn't incorporate the latest source changes. Without the -O0 flag, cabal run behaves as expected.

Is this a known issue?

System information

$ cabal --version
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library 
@sjakobi
Copy link
Member Author

sjakobi commented Jul 27, 2020

Hmm. After switching between cabal run -O0 -- dhall:dhall format and cabal run -O0 dhall:dhall format, the issue has gone away. Very weird.

EDIT: No, sorry.

@gbaz gbaz added the type: bug label Aug 28, 2021
@sjakobi
Copy link
Member Author

sjakobi commented Apr 25, 2022

I've run into this again while working on haskell-unordered-containers/unordered-containers#435. I was using cabal run tests -O0 -- --quickcheck-tests 100000 -p union to test my code and getting somewhat mystified that I didn't get any test failures. Subsequent runs with cabal test -O1 finally revealed the bugs. After running cabal test -O0, cabal run tests -O0 started showing the test failures too.

There was a ghcid process running in the same project. Could this have confused cabal in some way?!

In any case this makes me very hesitant to rely on cabal run going forward, which is sad, because I really like its ergonomics!

$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library 

@Mikolaj
Copy link
Member

Mikolaj commented Apr 25, 2022

I have no idea how the hack of cabal run in place of cabal test actually works. Perhaps it fails to consider some dependencies. I'm afraid, for now,

cabal test tests -O0 --test-options='--quickcheck-tests 100000 -p "Short CI MNIST tests"'

may be the only trustworthy option. @pranaysashank in #8093 attempts to make it less fragile, but IIRC we hit some Windows eccentricity problems.

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

4 participants