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 --enable-coverage doesn't install mix in findable location, causing hpc to fail when those ids are mentioned #3684

Closed
ezyang opened this issue Aug 9, 2016 · 4 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Aug 9, 2016

If we do this, then GHC will generate tix for those modules, but Cabal doesn't know how to find them:

ezyang@sabre:~/Dev/labs/map-syntax$ /opt/cabal/1.24/bin/cabal test -v
Component build order: test suite 'testsuite'
creating dist/build
creating dist/build/autogen
/usr/bin/ghc-pkg init dist/package.conf.inplace
Preprocessing test suite 'testsuite' for map-syntax-0.2.0.1...
Building test suite testsuite...
creating dist/build/testsuite
creating dist/build/testsuite/testsuite-tmp
/usr/bin/ghc --make -no-link -fbuilding-cabal-package -O -fhpc -hpcdir dist/hpc/vanilla/mix/testsuite -j1 -static -outputdir dist/build/testsuite/testsuite-tmp -odir dist/build/testsuite/testsuite-tmp -hidir dist/build/testsuite/testsuite-tmp -stubdir dist/build/testsuite/testsuite-tmp -i -idist/build/testsuite/testsuite-tmp -isrc -itest -idist/build/autogen -Idist/build/autogen -Idist/build/testsuite/testsuite-tmp -optP-include -optPdist/build/autogen/cabal_macros.h -hide-all-packages -package-db dist/package.conf.inplace -package-id HUnit-1.3.0.0-904109a490c85ff643c14c4cfbe058fb -package-id QuickCheck-2.8.1-2cs6jeUUZX9ZLDN6ycKJHM -package-id base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d -package-id containers-0.5.6.2-59326c33e30ec8f6afd574cbac625bbb -package-id deepseq-1.4.1.1-614b63b36dd6e29d2b35afff57c25311 -package-id hspec-2.2.3-26H6GBDRpLQCyZpmHWBtcW -package-id mtl-2.2.1-378RFoja0lduCvzTAM9NPi -package-id transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 -XHaskell2010 test/TestSuite.hs -Wall -fwarn-tabs
[1 of 4] Compiling Data.Map.Syntax  ( src/Data/Map/Syntax.hs, dist/build/testsuite/testsuite-tmp/Data/Map/Syntax.o )
[2 of 4] Compiling Data.Map.Syntax.Util ( test/Data/Map/Syntax/Util.hs, dist/build/testsuite/testsuite-tmp/Data/Map/Syntax/Util.o )
[3 of 4] Compiling Data.Map.Syntax.Tests ( test/Data/Map/Syntax/Tests.hs, dist/build/testsuite/testsuite-tmp/Data/Map/Syntax/Tests.o )

test/Data/Map/Syntax/Tests.hs:10:1: Warning:
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
[4 of 4] Compiling Main             ( test/TestSuite.hs, dist/build/testsuite/testsuite-tmp/Main.o )
Linking...
/usr/bin/ghc --make -fbuilding-cabal-package -O -fhpc -hpcdir dist/hpc/vanilla/mix/testsuite -static -outputdir dist/build/testsuite/testsuite-tmp -odir dist/build/testsuite/testsuite-tmp -hidir dist/build/testsuite/testsuite-tmp -stubdir dist/build/testsuite/testsuite-tmp -i -idist/build/testsuite/testsuite-tmp -isrc -itest -idist/build/autogen -Idist/build/autogen -Idist/build/testsuite/testsuite-tmp -optP-include -optPdist/build/autogen/cabal_macros.h -hide-all-packages -package-db dist/package.conf.inplace -package-id HUnit-1.3.0.0-904109a490c85ff643c14c4cfbe058fb -package-id QuickCheck-2.8.1-2cs6jeUUZX9ZLDN6ycKJHM -package-id base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d -package-id containers-0.5.6.2-59326c33e30ec8f6afd574cbac625bbb -package-id deepseq-1.4.1.1-614b63b36dd6e29d2b35afff57c25311 -package-id hspec-2.2.3-26H6GBDRpLQCyZpmHWBtcW -package-id mtl-2.2.1-378RFoja0lduCvzTAM9NPi -package-id transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 -XHaskell2010 test/TestSuite.hs -o dist/build/testsuite/testsuite -Wall -fwarn-tabs
Linking dist/build/testsuite/testsuite ...
Running 1 test suites...
Test suite testsuite: RUNNING...
dist/build/testsuite/testsuite
Test suite testsuite: PASS
Test suite logged to: dist/test/map-syntax-0.2.0.1-testsuite.log
/srv/prod/bin/hpc markup dist/hpc/vanilla/tix/testsuite/testsuite.tix '--destdir=dist/hpc/vanilla/html/testsuite' '--hpcdir=dist/hpc/vanilla/mix/testsuite' '--hpcdir=dist/hpc/vanilla/mix/map-syntax-0.2.0.1' '--exclude=Data.Map.Syntax' '--exclude=Data.Map.Syntax.Util' '--exclude=Data.Map.Syntax.Tests' '--exclude=Main'
hpc: can not find 5Dy4335KtNp12MnuUhJwf2/Test.Hspec.Timer in ./.hpc, ./dist/hpc/vanilla/mix/map-syntax-0.2.0.1, ./dist/hpc/vanilla/mix/testsuite
CallStack (from ImplicitParams):
  error, called at libraries/hpc/Trace/Hpc/Mix.hs:119:15 in hpc-0.6.0.2:Trace.Hpc.Mix

Originally discovered when trying to reproduce #3682

@ezyang
Copy link
Contributor Author

ezyang commented Aug 16, 2016

Actually, maybe we should just install the mix files in this case? Basically, every package you enable coverage for should show up in the coverage report. That ought to work!

@ezyang ezyang changed the title cabal install --enable-coverage should not actually install things built with -fhpc cabal install --enable-coverage doesn't install mix in findable location, causing hpc to fail when those ids are mentioned Aug 16, 2016
@ezyang ezyang added this to the _|_ milestone Aug 16, 2016
@ezyang
Copy link
Contributor Author

ezyang commented Aug 16, 2016

We're not planning on fixing this unless it actually affects someone.

@cartazio
Copy link
Contributor

@davean is this the problem we hit?

@Mikolaj
Copy link
Member

Mikolaj commented Jul 24, 2021

This is superseded by #5213. If we fix this, it will be in v2- commands, not v1-. Closing

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

3 participants