You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[3.12.0.0] Failed to find the installed unit #10046
Building a package with cabal 3.12.0.0, I encountered this error:
> cabal test all
...
Error: [Cabal-9341]
Failed to find the installed unit 'cardano-submit-api-3.2.2-inplace' in package database stack.
...
Error: [Cabal-7125]
Tests failed for test:unit from cardano-submit-api-3.2.2.
❯ cabal --version && ghc --version
cabal-install version 3.11.0.0
compiled using version 3.12.0.0 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 9.8.2
Additional context
In this same scenario I saw a paraphrasing of the following error (but I lost the terminal output, I will make a proper issue if I see it again, but maybe it is helpful to guess the cause):
When building ouroboros-consensus-cardano:
Encountered private or missing dependencies:
diff-containers >= 1.1
A cabal clean && cabal build all solved it. Perhaps cabal clean would not have been needed.
I'm pretty sure Cabal-7125 is for failed test-suite, nothing to do with the other error:
~\code\aa via λ 9.8.2 took 6s
➜ cabal test
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
- aa-0.1.0.0 (test:aa-test) (first run)
Preprocessing test suite 'aa-test' for aa-0.1.0.0...
Building test suite 'aa-test' for aa-0.1.0.0...
[1 of 1] Compiling Main ( test\Main.hs, C:\Users\Javier\code\aa\dist-newstyle\build\x86_64-windows\ghc-9.8.2\aa-0.1.0.0\t\aa-test\build\aa-test\aa-test-tmp\Main.o )
[2 of 2] Linking C:\\Users\\Javier\\code\\aa\\dist-newstyle\\build\\x86_64-windows\\ghc-9.8.2\\aa-0.1.0.0\\t\\aa-test\\build\\aa-test\\aa-test.exe
Running 1 test suites...
Test suite aa-test: RUNNING...
Test suite aa-test: FAIL
Test suite logged to:
C:\Users\Javier\code\aa\dist-newstyle\build\x86_64-windows\ghc-9.8.2\aa-0.1.0.0\t\aa-test\test\aa-0.1.0.0-aa-test.log
0 of 1 test suites (0 of 1 test cases) passed.
Error: [Cabal-7125]
Tests failed for test:aa-test from aa-0.1.0.0.
~\code\aa via λ 9.8.2 took 2s
❯ cat test/Main.hs
module Main (main) where
import System.Exit
main :: IO ()
main = exitFailure
Note that aa-test doesn't depend on aa. I chose Agda because I wanted something that would make compilation for the library take more time than the test-suite building process. This is the outcome:
❯ cabal test all
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
- QuickCheck-2.15.0.1 (lib) (requires build)
- STMonadTrans-0.4.8 (lib) (requires download & build)
- aa-0.1.0.0 (test:aa-test) (first run)
- base-compat-0.14.0 (lib) (requires download & build)
- blaze-builder-0.4.2.3 (lib) (requires build)
- case-insensitive-1.2.1.0 (lib) (requires build)
- data-hash-0.2.0.1 (lib) (requires download & build)
- murmur-hash-0.1.0.10 (lib) (requires download & build)
- parallel-3.2.2.0 (lib) (requires build)
- peano-0.1.0.2 (lib) (requires download & build)
- split-0.2.5 (lib) (requires build)
- transformers-base-0.4.6 (lib) (requires build)
- utf8-string-1.0.2 (lib) (requires build)
- vector-hashtables-0.1.2.0 (lib) (requires download & build)
- aeson-2.2.3.0 (lib) (requires build)
- equivalence-0.4.1 (lib) (requires download & build)
- gitrev-1.3.1 (lib) (requires download & build)
- blaze-markup-0.8.3.0 (lib) (requires build)
- boxes-0.1.5 (lib) (requires download & build)
- monad-control-1.0.3.1 (lib) (requires build)
- uri-encode-1.5.0.7 (lib) (requires download & build)
- blaze-html-0.9.2.0 (lib) (requires build)
- Agda-2.6.4.3 (lib:Agda) (requires download & build)
- aa-0.1.0.0 (lib) (first run)
- aa-0.1.0.0 (test:bb-test) (first run)
...
Preprocessing test suite 'aa-test' for aa-0.1.0.0...
Building test suite 'aa-test' for aa-0.1.0.0...
...
[1 of 1] Compiling Main ( test\Main.hs, C:\Users\Javier\aa\dist-newstyle\build\x86_64-windows\ghc-9.8.2\aa-0.1.0.0\t\aa-test\build\aa-test\aa-test-tmp\Main.o )
...
[2 of 2] Linking C:\\Users\\Javier\\aa\\dist-newstyle\\build\\x86_64-windows\\ghc-9.8.2\\aa-0.1.0.0\\t\\aa-test\\build\\aa-test\\aa-test.exe
...
Error: [Cabal-9341]
Failed to find the installed unit 'aa-0.1.0.0-inplace' in package database stack.
@ulysses4ever I think it is indeed a regression. It seems cabal build all && cabal test all is a workaround. I am surprised no-one else has faced this issue. If you run the example above do you get the same result?
I took a look at this today. It seems that the problem is that cabal-install passes --coverage-for=aa-inplace... to the Cabal library invocation when compiling the aa-test component despite aa-test not depending on aa.
We are encountering this issue in the plutus repo, when running cabal test on a package following cabal clean. The workaround mentioned above - running cabal build all first - does work, but it's a bit inconvenient.
Activity
jasagredo commentedon Jun 5, 2024
Another instance of the same problem at commit 55172e6ab25522853826fc95f4f2e26d2f2d8176 in https://github.com/IntersectMBO/ouroboros-consensus
jasagredo commentedon Jul 9, 2024
I have not encountered this again, and no one else has. So let's close this issue.
stephen-smith commentedon Jul 15, 2024
Saw Cabal-7125 twice today in 3.12.1.0, but the repo I was on is private, so I'm not sure if there's any useful information I can contribute.
jasagredo commentedon Jul 15, 2024
I'm pretty sure Cabal-7125 is for failed test-suite, nothing to do with the other error:
jasagredo commentedon Aug 6, 2024
I was able to reproduce this error I started seeing again in my code. This is a minimal example:
with the following files:
Note that
aa-testdoesn't depend onaa. I chose Agda because I wanted something that would make compilation for the library take more time than the test-suite building process. This is the outcome:ulysses4ever commentedon Aug 6, 2024
So, this looks like a regression in 3.12, correct?
jasagredo commentedon Aug 7, 2024
@ulysses4ever I think it is indeed a regression. It seems
cabal build all && cabal test allis a workaround. I am surprised no-one else has faced this issue. If you run the example above do you get the same result?alt-romes commentedon Aug 7, 2024
Thanks for the reproducer @jasagredo.
I took a look at this today. It seems that the problem is that
cabal-installpasses--coverage-for=aa-inplace...to the Cabal library invocation when compiling theaa-testcomponent despiteaa-testnot depending onaa.2 remaining items
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries
zliu41 commentedon Sep 25, 2024
We are encountering this issue in the plutus repo, when running
cabal teston a package followingcabal clean. The workaround mentioned above - runningcabal build allfirst - does work, but it's a bit inconvenient.Fix CI: specify cabal 3.10
Fix CI
Fix CI: specify cabal 3.10 (#474)
hpc: Don't cover non-dependency libraries
hpc: Don't cover non-dependency libraries