Closed LeventErkok closed 2 years ago
Did you compile your library first? https://github.com/dfithian/prune-juice#known-issues
Yes; this is done right after a clean build via cabal new-build
. (I don't use stack, but as I understand this shouldn't be a problem.)
I'm using GHC 9.2.1; if that makes a difference.
Okay. Your ghc version could be the issue. I’ll try to get to this soon, I’m sorry you’re having the issue.
Ps, I’m not sure if using -Wunused-packages will work for you, but that’s a new ghc feature and it could help. I’ll look into it regardless.
I already use that option; and it doesn't complain..
Oh, okay, then I’m curious why you are using prune juice? Is it to apply the changes?
When I first heard of prune-juice
I misunderstood its goal; thought it would tell me if I defined a function in my package yet never used it anywhere else. Now I understand that's not what it does.
So yeah, I don't really need it I guess, given the existence of -Wunused-packages
. But thought you'd wanna know regardless.
Great, I appreciate you filing the issue and I will look into it.
What’s your cabal version?
$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
Okay the issue seems to be that your cabal file is missing hs-source-dirs
. I'll fix that assumption.
This is the output I get now on the master
branch of sbv
:
$ prune-juice
Some unused dependencies for benchmark SBVBench in package sbv
bench-show
gauge
silently
Some unused dependencies for benchmark SBVBenchmark in package sbv
bench-show
gauge
silently
Not sure how these are used... but you may want to check the "known issues" section if these are still needed: https://github.com/dfithian/prune-juice#known-issues
After running cabal build --enable-tests --enable-benchmarks
(I get a lot of compile errors), I can now run prune-juice
and there are no issues.
Thanks.. It does make sense that these extra ones come from the benchmarks. (Which fail to compile due to dependency failures, but that's totally a separate issue.)
Thanks for building this tool; something that was missing in the toolchain.
I tried to give it a try, but either it seems to produce incorrect results, or I'm not quite sure how to interpret the output. I tried it on this package: https://hackage.haskell.org/package/sbv
And it told me (amongst other things):
I was skeptical, but still gave it a try after removing
array
from thecabal
file dependencies, and of course the project no longer compiles due to the missing dependency.Am I using the tool incorrectly?