Closed brandonchinn178 closed 1 month ago
@brandonchinn178, many thanks for the report and the diagnosis. EDIT: It seems to me that the code should be using ghc-pkg field {pkg} {field}
if it wants to get a specific field for a package in a package database.
@brandonchinn178, I think #6579 will fix this (on Unix-like operating systems; Windows has unrelated problems with long file paths). I also reason that it should not introduce any significant hit to performance (despite making use of ghc-pkg field
). However, if there is anything you could do to test it 'in the field', that would be appreciated.
@brandonchinn178, my post above was premature - I need to work out why the CI is failing.
@brandonchinn178, after that false start, the CI on #6579 is now green (and, if not using GHCup to maange Stack, available via stack upgrade --source-only --git-branch re6574
).
hm I'm running into an unrelated issue: how do I run just one specific test suite with coverage? I'm doing stack test package-foo --coverage
, but its building all the binaries and other test suites with -hpc
as well. This is an issue because we build a binary that we use as a preprocessor for other test suites, and running the preprocessor fails:
Hpc failure: module mismatch with .tix/.mix file hash number
(perhaps remove my-preprocessor.tix file?)
But after commenting out the problematic test suite, I was able to repro the failure with my normal stack, and verified the bug is fixed running the same command with stack built from this branch!
@brandonchinn178, many thanks. I've merged that into the master
branch.
General summary/comments (optional)
When running
stack test --coverage
with a long package name, Stack shows an error:This happens because when package names are really long, Cabal puts the
id
field on the next line:This fails when Stack parses this file line-by-line: https://github.com/commercialhaskell/stack/blob/1dcce74ee5e9f78c5e4442d1e01afbe3768a1768/src/Stack/Coverage.hs#L619
Steps to reproduce
stack new my-really-long-package-name-that-breaks-coverage
cd my-really-long-package-name-that-breaks-coverage
stack test --coverage
Expected
Should work
Actual
Failed
Stack version
Method of installation
Platform
Your platform (machine architecture and operating system)