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

haskellPackages.servant: stop building documentation #107858

Closed

Conversation

cdepillabout
Copy link
Member

Motivation for this change

This PR stops including the upstream servant documentation in the haskellPackages.servant derivation.

Users that want to see the documentation can get it from the servant repo, or read it online: https://docs.servant.dev/en/stable/

This is for #107455.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

peti and others added 9 commits December 25, 2020 21:01
This update was generated by hackage2nix v2.15.5-37-g13ffc58 from Hackage revision
commercialhaskell/all-cabal-hashes@7c122b0.
This update was generated by hackage2nix v2.15.6 from Hackage revision
commercialhaskell/all-cabal-hashes@8d62f5b.
This update was generated by hackage2nix v2.15.6 from Hackage revision
commercialhaskell/all-cabal-hashes@cb1cd20.
Commit 1998b95 “haskellPackages:
update default compiler from ghc 8.10.2 to version 8.10.3” broke Agda
because Agda.cabal incorrectly declares a transformers dependency only
for ghc < 8.10.3:

    if impl(ghc >= 8.6.4) && impl(ghc < 8.10.3)
      build-depends: transformers == 0.5.6.2

    if impl(ghc >= 8.4) && impl(ghc < 8.6.4)
      build-depends: transformers == 0.5.5.0

    if impl(ghc < 8.4)
      build-depends: transformers == 0.5.2.0

leading to this error:

    src/full/Agda/Utils/Maybe.hs:13:1: error:
    Could not load module ‘Control.Monad.Trans.Maybe’
    It is a member of the hidden package ‘transformers-0.5.6.2’.
    Perhaps you need to add ‘transformers’ to the build-depends in your .cabal file.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
       |
    13 | import Control.Monad.Trans.Maybe
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This update was generated by hackage2nix v2.15.6 from Hackage revision
commercialhaskell/all-cabal-hashes@d89eff1.
haskellPackages.Agda: Fix build for ghc 8.10.2 → 8.10.3 upgrade
@cdepillabout
Copy link
Member Author

@GrahamcOfBorg build cachix haskellPackages.servant haskellPackages.servant-docs haskellPackages.servant-server

@cdepillabout
Copy link
Member Author

Here's my arguments for completely removing this documentation (as opposed to continuing to bump the documentation hash):

  1. The documentation hash has to be bumped every time a new version of servant comes out. In the past various people have done this. From looking through the git history, it appears that @Profpatsch added this documentation generation, and it has subsequently been bumped by @peti, @Izorkin, and @basvandijk,

    However, after a new servant release, it appears that this hash goes quite a long time without being fixed. There doesn't appear to be anybody actively maintaining this. Over the past few years, this hash appears to be broken significantly longer than it has actually been working.

  2. If you enable the binary cache, you often don't realize this isn't working (because you get the documentation from the binary cache), but in that case you often get documentation from an old version of Servant. Given that the Servant API still occasionally has big changes, I imagine it would be quite confusing to get old documentation.

Given that there doesn't seem to be anyone actively keeping up with bumping this hash after every Servant release, and that having old documentation can be very confusing, I think it would be better to just completely remove the documentation generation as I have done in this PR.


If someone does feel strongly about providing this documentation from nixpkgs, I'd suggest creating a separate derivation that just contains the documentation. This could be maintained separately from haskellPackages.servant.

@AndersonTorres
Copy link
Member

Is this documentation hard to be built? Or it is just a matter of updating a hash?

@teto
Copy link
Member

teto commented Dec 29, 2020

I find a bit sad to remove it. Can't we hardcode the doc version and assert that the hardocded version matches super.servant.version ? The doc could be made optional so that it doesn't break the build. Putting it in another derivation can be confusing: harder to find and is that a servant package or just the servant doc ?

@cdepillabout
Copy link
Member Author

cdepillabout commented Dec 30, 2020

@AndersonTorres

Is this documentation hard to be built? Or it is just a matter of updating a hash?

It is not hard to build the documentation. The code that I have removed in this PR is responsible for building the documentation. It is relatively straightforward.

The only hard part is keeping the hash updated. In #107858 (comment) I try to make the argument that since no one seems to be keeping this hash updated, we should just remove the documentation generation.

Although please keep in mind that there are two sets of documentation for Servant. There are the haddocks (https://hackage.haskell.org/package/servant-0.18.2/docs/Servant-API.html), as well as the tutorials site (https://docs.servant.dev/en/stable/cookbook/index.html).

This PR is removing the tutorials site, not the Haddocks.

Upstream doesn't distribute tutorials site along with the servant package, so I don't think it is too crazy that we wouldn't either.


@teto

Can't we hardcode the doc version and assert that the hardcoded version matches super.servant.version?

Yes, we could do that.

I think @maralorn tried something like that for some other derivations in haskellPackages, but he ended up removing it. Maybe it was annoying to always keep updated?

We definitely want servant to always be buildable in nixpkgs (because it is used by important tools like cachix), and I'm worried about increasing any friction in keeping it working.

If there was someone that reliably bumped this servant docs hash, I would be much less eager to remove it. However, in the past couple years, there hasn't been.

The doc could be made optional so that it doesn't break the build.

Hmm, I can't quite imagine how this would work. How would you go about writing something like this?

Putting it in another derivation can be confusing: harder to find and is that a servant package or just the servant doc?

I completely agree. Having the documentation be in a separate derivation would be more confusing.

However, my argument is that it would be worth it in order to reduce the maintenance burden. If we moved the documentation to a separate derivation, and then someone started always updating the hash in a timely manner, I would feel much better about adding the documentation back to the main haskellPackages.servant derivation.

(Another possibility would be restructuring the derivations in a way that the ryantm bot would do the updates for us. I'm not sure what would need to happen for this to work.)

@maralorn
Copy link
Member

I think @maralorn tried something like that for some other derivations in haskellPackages, but he ended up removing it. Maybe it was annoying to always keep updated?

I did stuff like that and it worked. The point is, that I have never done it as a permanent solution only as a temporary reminder as a "fix this once we can". I think putting asserts into the code to break eval on update is a great way to enforce timely action on an issue. But in reality this just means we write it on @peti s todo-list. I assume bumping this hash is around five minutes of work evry time. So this would only be worth it if people actually use this documentation. Do you still @Profpatsch? Because I am pretty sure I wouldn‘t even know about it and just look at it online.

An alternative would be to insert something in the doCheck phase that asserts the documentation and package versions match. That would be the cleaner approach. But it would break servant regularly. While noticing and fixing that would be slower, in theory it could have the benefit on not relying alone no petis intervention.

@peti peti force-pushed the haskell-updates branch 3 times, most recently from ba32886 to c9e5a3f Compare January 2, 2021 18:58
@peti
Copy link
Member

peti commented Jan 15, 2021

Merged in 4827826.

@peti peti closed this Jan 15, 2021
@cdepillabout cdepillabout deleted the remove-servant-docs branch January 16, 2021 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants