When running
cabal haddock --executables
the command fails with
cabal: internal error when calculating transitive package dependencies.
Debug info: []
I have tagged my source code tree where this problem exists:
https://github.com/massysett/penny/tree/cabal_error
This is cabal-install version 1.20.0.2.
@kosmikus: I have prepared a minimal Cabal package reproducing this error.
With GHC 7.8.2 and cabal 1.20.0.2:
$ git clone https://github.com/mietek/cabal-fail-one.git
$ cd cabal-fail-one
$ make
cabal sandbox init
Writing a default package environment file to
/Users/mietek/Projects/Haskell/cabal-fail-one/cabal.sandbox.config
Creating a new sandbox at
/Users/mietek/Projects/Haskell/cabal-fail-one/.cabal-sandbox
cabal install \
--dependencies-only \
--enable-documentation \
--enable-tests \
--reorder-goals
Resolving dependencies...
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.
cabal configure --enable-tests
Resolving dependencies...
Configuring cabal-fail-one-0.1...
cabal test --show-details=streaming
Building cabal-fail-one-0.1...
Preprocessing library cabal-fail-one-0.1...
[1 of 1] Compiling Cabal.Fail.One ( src/lib/Cabal/Fail/One.hs, dist/build/Cabal/Fail/One.o )
In-place registering cabal-fail-one-0.1...
Preprocessing executable 'cabal-fail-one' for cabal-fail-one-0.1...
[1 of 1] Compiling Main ( src/cabal-fail-one.hs, dist/build/cabal-fail-one/cabal-fail-one-tmp/Main.o )
Linking dist/build/cabal-fail-one/cabal-fail-one ...
Preprocessing test suite 'test' for cabal-fail-one-0.1...
[1 of 1] Compiling Main ( test/test.hs, dist/build/test/test-tmp/Main.o )
Linking dist/build/test/test ...
Running 1 test suites...
Test suite test: RUNNING...
Test suite test: PASS
Test suite logged to: dist/test/cabal-fail-one-0.1-test.log
1 of 1 test suites (1 of 1 test cases) passed.
cabal haddock --executables
Running Haddock for cabal-fail-one-0.1...
Preprocessing library cabal-fail-one-0.1...
Haddock coverage:
0% ( 0 / 1) in 'Cabal.Fail.One'
Documentation created: dist/doc/html/cabal-fail-one/index.html
Preprocessing executable 'cabal-fail-one' for cabal-fail-one-0.1...
cabal: internal error when calculating transitive package dependencies.
Debug info: []
make: *** [doc] Error 1
Seeing this error on one of my projects as well.
I can confirm this error as well with the --executable flag.
I've tracked this error down to the dependencyClosure function. https://github.com/haskell/cabal/blob/5c70361b362e41b3c13d48b58b46224d42f401dc/cabal-install/Distribution/Client/PackageIndex.hs#L346
From the local documentation:
Note that if the result is @Right []@ it is because at least one of the original given
'PackageIdentifier's do not occur in the index.
It seems to be a problem resolving the inplace package dependency of the local library. When I remove that dependency I am able to generate the haddocks for the executable.
Would anyone familiar with the cabal code be able to give me anymore pointers for digging into this more? I don't mind spending more time to fix this.
Has any progress been made on this issue? We have some projects with significant code in the modules which only appear in the executable and it would be great if documentation could be generated for those as well. Of course removing the dependency on the local library is not really an option.
This problem still occurs with 1.24.0.0.
I'm running into this error, and like @taladar says, removing the dependency on the local library (or convenience library) fixes haddock generation, but I need the dependency nonetheless for projects that depend on the main library (else I have link-time errors).
Has anyone found a workaround for this issue?
Thanks!
This problem is also present in 2.2.0.1.
I think this is fixed with latest Cabal.
Christopher Lewis notifications@github.com schrieb am Sa., 27. Okt. 2018,
06:54:
This problem is also present in 2.2.0.1.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/haskell/cabal/issues/1919#issuecomment-433564023, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AByiie6zza8agAdypNbxg2ile2qvVlkBks5uo5KNgaJpZM4CA20M
.
FWIW, this bug still exists for the v1-haddock command in cabal-install 2.4.1.0. It occurs when an executable depends on the library defined in the current package.
My cabal-fail-one repository is now named cabal-issue-1919.
Note that new-haddock is affected by a different issue that also causes executable documentation to not be built in some cases (including @mietek's repository, I think): #5890.
I get the same error when I use cabal haddock on a package with internal libraries with Cabal 2.4.1.0. Since Stack currently supports up to Cabal 2.4, I imagine this affects some number of people.
Is the only workaround to just not use internal libraries? Does anyone have an idea where to start poking to work towards a patch?
FYI I'm getting this on darcs 2.16.2:
$ cabal unpack darcs-2.16.2
Unpacking to darcs-2.16.2\
$ cd darcs-2.16.2
$ cabal v2-haddock test:darcs-test --enable-tests --enable-documentation --haddock-tests
[...]
Running Haddock on test suite 'darcs-test' for darcs-2.16.2..
setup.exe: internal error when calculating transitive package dependencies.
Debug info: []
I'm using cabal-install 3.2 on Windows:
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
Most helpful comment
I get the same error when I use
cabal haddockon a package with internal libraries with Cabal 2.4.1.0. Since Stack currently supports up to Cabal 2.4, I imagine this affects some number of people.Is the only workaround to just not use internal libraries? Does anyone have an idea where to start poking to work towards a patch?