input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
557 stars 239 forks source link

Include standalone haddock derivation for a project #737

Open michaelpj opened 4 years ago

michaelpj commented 4 years ago

This would require a bit of hacking, but I think probably worth it (see e.g. https://github.com/input-output-hk/haskell.nix/issues/735).

We can copy my hack in https://github.com/input-output-hk/plutus/blob/master/nix/haddock-combine.nix, however I think we should:

For the latter one, I can see two approaches:

  1. Copy any store paths which are referenced in URLs into a "fake store" directory in the bundle, and rewrite any paths to point to that directory. We'd have to do this repeatedly, and it would use up lots of space, but if we want it to be standalone I think it's what we need to do.
  2. Point them to Hackage where possible (maybe fall back to 1. if we can't find the package version).

Related issues so I remember:

Support in cabal: https://github.com/haskell/cabal/issues/5383 Support in haddock: https://github.com/haskell/haddock/issues/1086, https://github.com/haskell/haddock/issues/1126 Existing standalone-haddock tool is outdated: https://github.com/ktvoelker/standalone-haddock/issues/30

michaelpj commented 3 years ago

Maybe https://github.com/haskell/haddock/pull/1277 will help if/when it gets in.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

michaelpj commented 2 years ago

Could use https://github.com/haskell/cabal/pull/8162 now, potentially. Although I don't think it's in a released cabal version.

michaelpj commented 2 years ago

That probably also needs a newer haddock, so may only work with new enough GHCs.

michaelpj commented 1 year ago

We probably can't actually use haddock-project, because that will try and build the haddocks itself. But we should be able to mimic what it does, starting from about here: https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/CmdHaddockProject.hs#L252