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
haddock-project --local does not copy non-boot dependencies to output dir #8958
Describe the bug
At least the blog post indicates that all dependencies (not just boot deps) should be supported:
This command will build ./haddocks directory which you can serve with a http server. It will contain documentation of all the local packages and its dependencies. You can even control which dependencies should be included via documentation option.
Note that resourcet (a dependency of the test project) is not present.
Expected behavior
I would expect all dependencies to be copied to the output, or alternatively an indication in the documentation that it only works for boot deps.
The build plan which haddock-project is using requires resourcet-1.3.0-2a5777eca76f6caa1882bf381159a0bbfdefefbd08e4ce5550597937130edf11, but cabal-plan info reports resourcet-1.3.0-3327d742b734f4daace7f3299ff166ecb34971a1c063326e8ca093a3dddffa26. The former doesn't exist in cabal store, the latter does.
@amesgen could you check if #8919 fixes the bug for you (in that branch you don't need to pass the --local flag).
I think direct dependencies (like resourcet above) are now copied, but transitive non-direct dependencies (like primitive or unliftio-core above) are still not copied; I also get corresponding warnings:
Warning: haddocks of
"primitive-0.8.0.0-ad645076af9195e65e5c77d3a3850c7fb7f4153156656431f6be749f834f8371"
not found in the store
Warning: haddocks of
"unliftio-core-0.2.1.0-ece7185c67bc94e7897e24d7cd1b3064100b73a194a2cca37863ee3222df8808"
not found in the store
Full logs
$ cabal haddock-project
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: haddock-project command is experimental, it might break in the future
Resolving dependencies...
Build profile: -w ghc-9.6.1 -O1
In order, the following will be built (use -v for more details):
- primitive-0.8.0.0 (lib) (requires build)
- unliftio-core-0.2.1.0 (lib) (requires build)
- resourcet-1.3.0 (lib) (requires build)
- stuff-0.1.0.0 (lib) (first run)
Build profile: -w ghc-9.6.1 -O1
In order, the following will be built (use -v for more details):
- primitive-0.8.0.0 (lib) (requires build)
- unliftio-core-0.2.1.0 (lib) (requires build)
- resourcet-1.3.0 (lib) (requires build)
- stuff-0.1.0.0 (lib) (first run)
Starting unliftio-core-0.2.1.0 (lib)
Starting primitive-0.8.0.0 (lib)
Building unliftio-core-0.2.1.0 (lib)
Building primitive-0.8.0.0 (lib)
Installing unliftio-core-0.2.1.0 (lib)
Completed unliftio-core-0.2.1.0 (lib)
Installing primitive-0.8.0.0 (lib)
Completed primitive-0.8.0.0 (lib)
Starting resourcet-1.3.0 (lib)
Building resourcet-1.3.0 (lib)
Haddock resourcet-1.3.0 (lib)
Installing resourcet-1.3.0 (lib)
Completed resourcet-1.3.0 (lib)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring library for stuff-0.1.0.0..
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing library for stuff-0.1.0.0..
Building library for stuff-0.1.0.0..
[1 of 1] Compiling MyLib ( src/MyLib.hs, /tmp/tmp.7zfdHszbqs/stuff/dist-newstyle/build/x86_64-linux/ghc-9.6.1/stuff-0.1.0.0/build/MyLib.o, /tmp/tmp.7zfdHszbqs/stuff/dist-newstyle/build/x86_64-linux/ghc-9.6.1/stuff-0.1.0.0/build/MyLib.dyn_o )
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing library for stuff-0.1.0.0..
Running Haddock on library for stuff-0.1.0.0..
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: primitive-0.8.0.0,
unliftio-core-0.2.1.0
0% ( 0 / 2) in 'MyLib'
Missing documentation for:
Module header
someFunc (src/MyLib.hs:5)
Documentation created:
/tmp/tmp.7zfdHszbqs/stuff/dist-newstyle/build/x86_64-linux/ghc-9.6.1/stuff-0.1.0.0/doc/html/stuff/
Build profile: -w ghc-9.6.1 -O1
In order, the following will be built (use -v for more details):
- primitive-0.8.0.0 (lib) (requires build)
- unliftio-core-0.2.1.0 (lib) (requires build)
- resourcet-1.3.0 (lib) (requires build)
- stuff-0.1.0.0 (lib) (configuration changed)
Starting unliftio-core-0.2.1.0 (lib)
Starting primitive-0.8.0.0 (lib)
Building unliftio-core-0.2.1.0 (lib)
Building primitive-0.8.0.0 (lib)
Haddock unliftio-core-0.2.1.0 (lib)
Installing unliftio-core-0.2.1.0 (lib)
Completed unliftio-core-0.2.1.0 (lib)
Haddock primitive-0.8.0.0 (lib)
Installing primitive-0.8.0.0 (lib)
Completed primitive-0.8.0.0 (lib)
Starting resourcet-1.3.0 (lib)
Building resourcet-1.3.0 (lib)
Haddock resourcet-1.3.0 (lib)
Installing resourcet-1.3.0 (lib)
Completed resourcet-1.3.0 (lib)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring library for stuff-0.1.0.0..
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing library for stuff-0.1.0.0..
Running Haddock on library for stuff-0.1.0.0..
Warning: --source-* options are ignored when --hyperlinked-source is enabled.
0% ( 0 / 2) in 'MyLib'
Missing documentation for:
Module header
someFunc (src/MyLib.hs:5)
Documentation created:
/tmp/tmp.7zfdHszbqs/stuff/dist-newstyle/build/x86_64-linux/ghc-9.6.1/stuff-0.1.0.0/doc/html/stuff/
Warning: haddocks of
"primitive-0.8.0.0-ad645076af9195e65e5c77d3a3850c7fb7f4153156656431f6be749f834f8371"
not found in the store
Warning: haddocks of
"unliftio-core-0.2.1.0-ece7185c67bc94e7897e24d7cd1b3064100b73a194a2cca37863ee3222df8808"
not found in the store
Documentation created: haddocks/index.html
$ ls haddocks/
array containers doc-index.html exceptions ghc-boot-th haddock-bundle.min.js linuwial.css pretty quick-jump.min.js stm synopsis.png transformers
base deepseq doc-index.json ghc-bignum ghc-prim index.html mtl quick-jump.css resourcet stuff-0.1.0.0-inplace template-haskell
Ah right, thanks, no wonder it did not work as I only enabled documentation for resourcet in the example above 🤦 Confirming that it works fine with your suggestion, or alternatively
Activity
ulysses4ever commentedon May 19, 2023
Thanks for the report! Any thoughts, @coot?
coot commentedon May 20, 2023
The build plan which
haddock-projectis using requiresresourcet-1.3.0-2a5777eca76f6caa1882bf381159a0bbfdefefbd08e4ce5550597937130edf11, butcabal-plan inforeportsresourcet-1.3.0-3327d742b734f4daace7f3299ff166ecb34971a1c063326e8ca093a3dddffa26. The former doesn't exist in cabal store, the latter does.Fixes #8958
coot commentedon May 20, 2023
@amesgen could you check if #8919 fixes the bug for you (in that branch you don't need to pass the
--localflag).amesgen commentedon May 20, 2023
Thanks for the quick reply ❤️
I think direct dependencies (like
resourcetabove) are now copied, but transitive non-direct dependencies (likeprimitiveorunliftio-coreabove) are still not copied; I also get corresponding warnings:Full logs
Fixes #8958
coot commentedon May 26, 2023
I think it will if you add
amesgen commentedon May 29, 2023
Ah right, thanks, no wonder it did not work as I only enabled documentation for
resourcetin the example above 🤦 Confirming that it works fine with your suggestion, or alternativelypackage * documentation: TrueFixes #8958
Fixes #8958
Fixes #8958
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
Build dependencies with haddock-project
haddock-packages fixes (#9213)