-
Notifications
You must be signed in to change notification settings - Fork 701
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
Add Haddock flags to package hash #5395
Conversation
Very cool, thanks @alexbiehl! I tested this out on the package in #5341 (comment) and it works quite well for my use case. I have one question: once this change is in place, will it still be possible to build a package's Haddocks without having to build the Haddocks for all of its libraries? The use case for this feature would be something like |
I ran out of time to test unfortunately but my understanding is that passing --enable-documentation should only haddock local packages. Could you verify? If it doesn't we should fix that. |
This wasn't my experience. Running |
Ok. I will see what I can do. Meanwhile on my local machine: Trying to build cabal with this patch enbled:
I will investigate here. |
Out of curiosity, if |
I have a small time frame left, I will write something up in a minute
hopefully.
Ryan Scott <[email protected]> schrieb am So., 24. Juni 2018, 19:48:
… Out of curiosity, if --enable-documentation alone is intended to just be
for local packages, how do you envision someone specifying that the
documentation should be built for *all* packages?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5395 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AByiiTZvgKmGahMd4Hg_kX3J2jgsuTYUks5t_9EFgaJpZM4U1HFK>
.
|
@hvr @RyanGlScott @23Skidoo Here is a (hopefully complete) list on how to pass
Does it make sense/is it what we want? Once we agree what packages should be affected when I can make cabal compliant. |
Fwiw, an invariant that ought to hold is:
@RyanGlScott btw, for the purpose of haskell-ci, why do you think that having |
For the same reason that I wouldn't want
Caching exists, but it doesn't change the fact that on a from-scratch build, you're now going to have to build every single dependency twice. For large projects like |
@RyanGlScott I'm still confused about the need to compile things twice during CI -- just build everything always (& once) w/ enable-docs? However, what's the purpose of building haddocks during haskell-ci to begin with, if you're only building partial docs? isn't the intent of buidling haddocks as part of CI in order to validate that all haddock-links are valid (which requires having transitive deps being haddocked as well)? |
Ah, never mind. For some reason, my mind was stuck in the old paradigm of building the package, then building documentation separately. I forgot that you could just enable In that case, please ignore my ramblings above. |
The downside of this PR seems to be that if I build a package, then rebuild it with |
@merijn that's correct; the ideal solution would be to implement "lazy haddocks" which would require to somehow model haddocks into either a companion-component or some other hack (and fwiw, Hi Haddock may provide us with a totally different approach to this issue). That, however, might require more time and effort to achieve, and in the meantime we'd be stuck with the current stateful situation that the nix-style does not track haddocks resulting in an imho even worse user experience, as you'd still end up requiring to rebuild everything if you realise you need the docs, except it's not being tracked in the nix-style hash -- current situation is worst of both worlds IMO, and this PR at least makes the situation more Nix-principled... |
@alexbiehl also double check how things interact with https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Program/Builtin.hs#L319 When I was asking which flags to filter I was initially told haddock flags shouldn't affect the hash, so that filters them out. It's called from
cabal/cabal-install/Distribution/Client/ProjectBuilding.hs Lines 334 to 359 in 2ce4858
cabal/cabal-install/Distribution/Client/ProjectPlanning.hs Lines 3564 to 3593 in 2ce4858
|
Indeed, the rationale was according to the rule-of-thumb, that they wouldn't affect the compiled |
@bgamari is asking for a release branch, @23Skidoo said this should go in. What's the state of this PR? Ping @alexbiehl. @merijn could you verify that interactions are ok? |
Ugh. I just saw #5395 (comment). @merijn is this still a thing? Should I update my patch to remove haddock flags from your filter? |
I didn't actually touch the filtering I added for Haddock flags, on account of being to busy. It looks like @alexbiehl added custom fields to the package hash, but I'm not sure if anyone looked at the interaction? For safety's sake my change in Cabal should probably be reverted? This should be simple enough to do, the relevant line is: https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Program/Builtin.hs#L319 This function just has to be changed to return it's 3rd argument (the list of args) unchanged, so |
(Yay for proper design resulting in only a single trivial change to avoid any problems! ;)) |
Merged, thanks! Sorry for taking so long. |
This should help with #5341
This adds haddock flags and arguments to the package hash. Changing haddock flags for non-local packages will retrigger a build of these.
I view this as a quick fix. I think we really want documentation to be treated as a separate component.