Repository navigation
Labels
cabal-install: v2-build systemAffecting v2-build and related commands that use v2-architecture (aka "nix local builds").type: bug
Description
Preprocessing test suite 'testsuite' for simple-server-0.1.0.0..
Building test suite 'testsuite' for simple-server-0.1.0.0..
Running 1 test suites...
Test suite testsuite: RUNNING...
Tests
core unit tests
testing storeInsert empty: OK
testing storeInsert when already in small: OK
testing storeInsert when already in commit: OK
testing storeInsert when data is in both: OK
testing isSecondaryIndexed when in store: OK
testing isSecondaryIndexed when not in store: OK
testing secondaryLookup when not in secondary: OK
testing secondaryLookup when in small: OK
testing secondaryLookup when in commit: OK
testing secondaryInsert when not in secondary: OK
testing read (ReadAll) when not in store: OK
testing read (lookup) when in small store: OK
testing read (lookup) when in commit store: OK
testing write successfully in small store: OK
testing write unsuccessfully (duplicate) in small store: OK
testing write unsuccessfully (duplicate) in commit store: OK
testing write failure in store (somehow): OK
testing write failure in secondary (already in store somehow): OK
testing write failure in store (already in secondary somehow): OK
All 19 tests passed (0.00s)
Test suite testsuite: PASS
Test suite logged to:
/Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/test/simple-server-0.1.0.0-testsuite.log
hpc: can not find simple-server-0.1.0.0-inplace/Data.API.Read in ./.hpc, /Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/mix/simple-server-0.1.0.0, /Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/mix/testsuite
CallStack (from HasCallStack):
error, called at libraries/hpc/Trace/Hpc/Mix.hs:122:15 in hpc-0.6.0.3:Trace.Hpc.Mix
cabal: Tests failed for test:testsuite from simple-server-0.1.0.0.
@cartazio was looking through this with me and can reproduce the same issue
we are using ghc 8.2.1 and cabal new-build / new-test
cabal --version
cabal-install version 2.0.0.0
compiled using version 2.0.0.2 of the Cabal library
a verbose (-v3) output would be as follows
te testsuite: PASS
Test suite logged to:
/Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/test/simple-server-0.1.0.0-testsuite.log
Environment: [("Apple_PubSub_Socket_Render","/private/tmp/com.apple.launchd.Q3JKpyPRfN/Render"),("COLORFGBG","7;0"),("COLORTERM","truecolor"),("HASKELL_DIST_DIR","/Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite"),("HOME","/Users/cyj"),("ITERM_PROFILE","Default"),("ITERM_SESSION_ID","w0t2p0:F80CC278-087E-4137-B59D-639A0978E05D"),("LANG","en_US.UTF-8"),("LOGNAME","cyj"),("PATH","/Users/cyj/.ghc-installs/ghc-8.2.1-hq/bin:/Users/cyj/.cabal/bin:/Users/cyj/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/cyj/.cabal/bin:/Users/cyj/.cabal/bin"),("PWD","/Users/cyj/Documents/simple-server"),("SECURITYSESSIONID","186a6"),("SHELL","/bin/bash"),("SHLVL","1"),("SSH_AUTH_SOCK","/private/tmp/com.apple.launchd.AaBcIdWfTT/Listeners"),("TERM","xterm-256color"),("TERM_PROGRAM","iTerm.app"),("TERM_PROGRAM_VERSION","3.1.2"),("TERM_SESSION_ID","w0t2p0:F80CC278-087E-4137-B59D-639A0978E05D"),("TMPDIR","/var/folders/fp/_6rb74hd3j39xp_scrxxf4ww0000gn/T/"),("USER","cyj"),("XPC_FLAGS","0x0"),("XPC_SERVICE_NAME","0"),("__CF_USER_TEXT_ENCODING","0x1F5:0x0:0x0")]
/Users/cyj/.ghc-installs/ghc-8.2.1-hq/bin/hpc markup /Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/tix/testsuite/testsuite.tix '--destdir=/Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/html/testsuite' '--hpcdir=/Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/mix/testsuite' '--hpcdir=/Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/mix/simple-server-0.1.0.0' '--exclude=Main'
hpc: can not find simple-server-0.1.0.0-inplace/Data.API.Read in ./.hpc, /Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/mix/simple-server-0.1.0.0, /Users/cyj/Documents/simple-server/dist-newstyle/build/x86_64-osx/ghc-8.2.1/simple-server-0.1.0.0/c/testsuite/hpc/vanilla/mix/testsuite
CallStack (from HasCallStack):
error, called at libraries/hpc/Trace/Hpc/Mix.hs:122:15 in hpc-0.6.0.3:Trace.Hpc.Mix
/Users/cyj/.ghc-installs/ghc-8.2.1-hq/bin/hpc returned ExitFailure 1
packages definitely up to date: simple-server-0.1.0.0-inplace
packages previously probably up to date: simple-server-0.1.0.0-inplace, simple-server-0.1.0.0-inplace-simple-server-scotty, simple-server-0.1.0.0-inplace-simple-server-snap
packages now probably up to date: simple-server-0.1.0.0-inplace, simple-server-0.1.0.0-inplace-simple-server-scotty, simple-server-0.1.0.0-inplace-simple-server-snap
packages newly up to date:
packages out to date: simple-server-0.1.0.0-inplace-testsuite
packages invalid due to dep change: simple-server-0.1.0.0-inplace-testsuite
packages invalid due to build failure: simple-server-0.1.0.0-inplace-testsuite
CallStack (from HasCallStack):
die', called at ./Distribution/Client/ProjectOrchestration.hs:782:8 in main:Distribution.Client.ProjectOrchestration
cabal: Tests failed for simple-server-0.1.0.0-inplace-testsuite.
we can make the simple application code available to any cabal maintainer privately (well, @cartazio will deal with that), but can't make it public at the moment, (its a pretty small project, but minimizing this failure would require more ideas about how cabal works than we do! :) )
Metadata
Metadata
Assignees
Labels
cabal-install: v2-build systemAffecting v2-build and related commands that use v2-architecture (aka "nix local builds").type: bug
Activity
cartazio commentedon Sep 27, 2017
pinging @ttuegel and @hvr and @bgamari and @23Skidoo :)
i want my program coverage magic!
it does seem to correctly generate mix and tix files ... i think ... but i never have tried coverage checking plus new build before :(
23Skidoo commentedon Sep 27, 2017
@ttuegel is the one most knowledgeable about these bits of Cabal.
cartazio commentedon Sep 28, 2017
cartazio commentedon Sep 30, 2017
@23Skidoo @ttuegel lemme know if theres any way i can help
... should i use cabal with stack trace, or dig into the two source locations with those errors?
EButlerIV commentedon Sep 30, 2017
@cartazio
I just replicated it myself, and I don't think it's project- or local settings-dependent. This is what happened when I ran it against a freshly downloaded package from hackage.
The test suite log doesn't contain any errors, but my build dir definitely doesn't contain a
.hpcdirectory. It's likely that any coverage files generated are being stored somewhere else.E: Manually moving the files to the expected location results in successful generation of coverage reports. It looks like this is the issue.:
EButlerIV commentedon Sep 30, 2017
Ok, last update. It looks like the real issue is caused by bad arguments in this use of hpc markup. The last
hpcdirargument appears to be incorrect.This is what it uses
/Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/c/hspec-suite/hpc/prof/mix/u2f-0.1.0.1This is what it should actually be
/Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/hpc/prof/mix/Incorrect invocation in full
/Users/eugene/.installed-ghc/ghc-8.0.2/bin/hpc markup /Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/c/hspec-suite/hpc/prof/tix/hspec-suite/hspec-suite.tix --destdir=/Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/c/hspec-suite/hpc/prof/html/hspec-suite --hpcdir=/Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/c/hspec-suite/hpc/prof/mix/hspec-suite --hpcdir=/Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/hpc/prof/mix/u2f-0.1.0.1 --exclude=MainE: Can confirm that normal
cabal testdoes run and create coverage reports without issue when coverage is enabled.cartazio commentedon Sep 30, 2017
so either
a) ghc isn't being told where to write the mix files correctly by cabal
b) cabal isn't telling hpc where to read the mix files correctly ?
cartazio commentedon Sep 30, 2017
it seems that cabal new-test didn't adjust how args/paths are passed to the the markup routines that invoke hpc... though @EButlerIV and i are really just poking around and guessing atm :)
that is: when we build ghc programs with coverage, /Users/eugene/Development/Personal/blah/u2f-0.1.0.1/dist-newstyle/build/x86_64-osx/ghc-8.0.2/u2f-0.1.0.1/c/hspec-suite/hpc/prof/mix/u2f-0.1.0.1 should be setup properly ... or something
cartazio commentedon Sep 30, 2017
@23Skidoo would fixing this be also a bug fix for 2.0 series cabal :)
cartazio commentedon Sep 30, 2017
a) possible culprit: program coverage flags not set correctly for new build in general?
shouldn't these two definitions of hpc dir
is the results of
distBuildDirectorynot being passed correctly somewhere?23Skidoo commentedon Oct 1, 2017
It depends on how hard it will be to backport.
ttuegel commentedon Oct 12, 2017
The root of this issue is that the wrong build directory is being passed to the test phase. The test phase is getting
dist-newstyle/build/x86_64-linux/ghc-8.0.2/u2f-0.1.0.1/t/hspec-suitewhen it should be gettingdist-newstyle/build/x86_64-linux/ghc-8.0.2/u2f-0.1.0.1. I have no idea why or where this happens because I still cannot wrap my head around thenew-*phases.ttuegel commentedon Oct 12, 2017
One more thing: even if I can fix that, there is the underlying problem that each component now has a different build directory, which is incompatible with the existing API of
hpcDir. In other words, I could not backport this hypothetical bug fix to Cabal 2.0.cartazio commentedon Oct 12, 2017
ezyang commentedon Oct 12, 2017
Oh, I guess the problem here makes sense: for a non-Custom setup, new-test will create separate build directories for the library and test (like, literally separate, with each having their own LocalBuildInfo). And I guess the coverage mechanism was never clued in about how to deal with this. So this is more of a feature request.
One way to work around the problem, then, is to turn off per-component build. I think there are some knobs for this, but you can at least easily check by changing the build-type to Custom.
62 remaining items
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
Per-component multi-package builds with coverage enabled
HPC artifacts are written and read from pkg-db
Per-component multi-package builds with coverage enabled
HPC artifacts are written and read from pkg-db
HPC artifacts are written and read from pkg-db
Per-component multi-package builds with coverage enabled
HPC artifacts are written and read from pkg-db