Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal haddock rebuilds (all?) the dependencies since cabal-install-3.9.0.0 (or 3.8?) #8707

Closed
phadej opened this issue Jan 27, 2023 · 12 comments
Labels

Comments

@phadej
Copy link
Collaborator

phadej commented Jan 27, 2023

E.g. trying with tree-diff

% ~/.ghcup/bin/cabal-3.9.0.0 build   
Up to date

but then

% ~/.ghcup/bin/cabal-3.9.0.0 haddock
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - StateVar-1.2.2 (lib) (requires build)
 - attoparsec-0.14.4 (lib:attoparsec-internal) (requires build)
 - base-compat-0.12.2 (lib) (requires build)
 - base-orphans-0.8.7 (lib) (requires build)
 - bytestring-builder-0.10.8.2.0 (lib) (requires build)
 - colour-2.3.5 (lib) (requires build)
 - data-array-byte-0.1.0.1 (lib) (requires build)
 - dlist-1.0 (lib) (requires build)
 - generically-0.1 (lib) (requires build)
 - indexed-traversable-0.1.2 (lib) (requires build)
 - integer-logarithms-1.0.3.1 (lib) (requires build)
 - primitive-0.7.4.0 (lib) (requires build)
 - splitmix-0.1.0.4 (lib) (requires build)
 - tagged-0.8.6.1 (lib) (requires build)
 - th-abstraction-0.4.5.0 (lib) (requires build)
 - transformers-compat-0.7.2 (lib) (requires build)
 - vector-stream-0.1.0.0 (lib) (requires build)
 - contravariant-1.5.5 (lib) (requires build)
 - ansi-terminal-0.11.4 (lib) (requires build)
 - hashable-1.4.2.0 (lib) (requires build)
 - random-1.2.1.1 (lib) (requires build)
 - distributive-0.6.2.1 (lib) (requires build)
 - vector-0.13.0.0 (lib) (requires build)
 - ansi-wl-pprint-0.6.9 (lib) (requires build)
 - unordered-containers-0.2.19.1 (lib) (requires build)
 - time-compat-1.9.6.1 (lib) (requires build)
 - text-short-0.1.5 (lib) (requires build)
 - scientific-0.3.7.0 (lib) (requires build)
 - data-fix-0.3.2 (lib) (requires build)
 - OneTuple-0.3.1 (lib) (requires build)
 - uuid-types-1.0.5 (lib) (requires build)
 - QuickCheck-2.14.2 (lib) (requires build)
 - comonad-5.0.8 (lib) (requires build)
 - charset-0.3.9 (lib) (requires build)
 - attoparsec-0.14.4 (lib) (requires build)
 - indexed-traversable-instances-0.1.1.1 (lib) (requires build)
 - base-compat-batteries-0.12.2 (lib) (requires build)
 - bifunctors-5.5.14 (lib) (requires build)
 - parsers-0.12.11 (lib) (requires build)
 - witherable-0.4.2 (lib) (requires build)
 - semigroupoids-5.3.7 (lib) (requires build)
 - assoc-1.0.2 (lib) (requires build)
 - these-1.1.1.1 (lib) (requires build)
 - strict-0.4.0.1 (lib) (requires build)
 - semialign-1.2.0.1 (lib) (requires build)
 - aeson-2.1.1.0 (lib) (requires build)
 - tree-diff-0.2.2 (lib) (configuration changed)
Starting     base-orphans-0.8.7 (lib)
Starting     bytestring-builder-0.10.8.2.0 (lib)
Starting     data-array-byte-0.1.0.1 (lib)
Starting     colour-2.3.5 (lib)
...

This is bad regression. (I didn't use 3.8.1.0 as it was broken otherwise, so cannot tell if it's already broken too).

@phadej
Copy link
Collaborator Author

phadej commented Jan 27, 2023

Oh, it tries to build haddocks for all the dependencies too? And then occasionally fails when they are not buildable. :O

like (with GHC-8.4.4 - older GHCs have buggier haddocks):

Error: cabal-3.9.0.0: Failed to build documentation for vector-0.13.0.0 (which is required by test:cabal-parsers-golden from cabal-install-parsers-0.5, bench:cabal-parsers-bench from cabal-install-parsers-0.5 and others).

@phadej
Copy link
Collaborator Author

phadej commented Jan 27, 2023

So I guess this is intentional https://github.com/haskell/cabal/blob/master/changelog.d/issue-7462, but how to not do this, changelog doesn't tell.

@Mikolaj
Copy link
Member

Mikolaj commented Jan 27, 2023

Guessing: "--disable-documentation"? Perhaps the PR has some discussion.

@Mikolaj
Copy link
Member

Mikolaj commented Jan 27, 2023

But agreed, this needs to be spelled out.

@phadej
Copy link
Collaborator Author

phadej commented Jan 27, 2023

#7462 (comment) says that --disable-documentation doesn't work. Let's see what CI setup reports if I add --disable-documentation.

@Mikolaj
Copy link
Member

Mikolaj commented Jan 27, 2023

#8330 supposedly fixes it.

@phadej
Copy link
Collaborator Author

phadej commented Jan 27, 2023

Ok, seems that issue is lacking documentation (in the changelog). The --disable-documentation reverts the behavior to previous (which is what I want in CI).

I'm not a fan of #7462 change, as you can control that by having documentation: True in ~/.cabal/config (or at least you should ). As building dependencies always with documentation would save you building them twice.

I wouldn't changed the default for cabal haddock, but I guess that ship has sailed.

I'm sad there is no way to control the cabal haddock default behavior, I expect to mostly use --disable-documentation, as I use cabal haddock to check that formatting is correct, and appreciate fast (initial) feedback. (I lookup docs on Hackage, not that much locally, tbh).

@phadej phadej closed this as completed Jan 27, 2023
@Mikolaj
Copy link
Member

Mikolaj commented Jan 27, 2023

Thank you for the investigation. I've noted down to improve this bit of release notes (mention --disable-documentation) at release time.

@ulysses4ever
Copy link
Collaborator

Can someone explain me why #7462 is mentioned here while the OP does not mention cabal haddock but rather cabal build. #7462 is supposed to only affect cabal haddock. Does it affect cabal build somehow?

@Mikolaj
Copy link
Member

Mikolaj commented Jan 30, 2023

@ulysses4ever: the second code snippet has cabal haddock.

@ulysses4ever
Copy link
Collaborator

@Mikolaj oh, my bad, thank you! I think I will change the title of the issue so that it mentions haddock too.

@ulysses4ever ulysses4ever changed the title cabal-install-3.9.0.0 rebuilds (all?) the dependencies cabal haddock rebuilds (all?) the dependencies since cabal-install-3.9.0.0 (or 3.8?) Jan 30, 2023
@mouse07410
Copy link
Collaborator

I recall this problem occurring when rebuilding Agda, without haddock getting involved.

@andreasabel andreasabel added the re: enable-documentation Concerning option/field {en,dis}able-documentation label Feb 3, 2023
pgrange added a commit to cardano-scaling/hydra that referenced this issue Jun 22, 2023
pgrange added a commit to cardano-scaling/hydra that referenced this issue Jun 26, 2023
ch1bo pushed a commit to cardano-scaling/hydra that referenced this issue Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants