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

haskell: Add documentationTarball to lib #103066

Merged
merged 1 commit into from Nov 8, 2020

Conversation

expipiplus1
Copy link
Contributor

Motivation for this change

It's nice to be able to build this kind of thing with nix.

I've been using something similar for a few weeks without issue.

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.

@cdepillabout
Copy link
Member

Nice! Would you be willing to add a test for this?

I'm imaging something similar to the shellFor test:

https://github.com/NixOS/nixpkgs/blob/126e5c1bd15a26688b387da1a33b8b20e058b15d/pkgs/test/haskell-shellFor/default.nix

*/
documentationTarball = pkg:
pkgs.lib.overrideDerivation pkg (drv: {
name = "${drv.pname}-${drv.version}-docs";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty small nitpick, but couldn't this be

Suggested change
name = "${drv.pname}-${drv.version}-docs";
name = "${drv.name}-docs";

And below as well.

@expipiplus1 expipiplus1 force-pushed the joe-hackage-docs branch 2 times, most recently from f364819 to 54f07f2 Compare November 7, 2020 12:44
@expipiplus1
Copy link
Contributor Author

Nice! Would you be willing to add a test for this?

I've added a test which checks for the presence of the haddocks themselves and the hyperlinked source.


in pkgs.runCommand "test haskell.lib.documentationTarball" { } ''
tar xvzf "${docs}/${drv.name}-docs.tar.gz"
files=$(find . -type f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this isn't being used anywhere?

Suggested change
files=$(find . -type f)

Other than this, this PR looks good!

@expipiplus1
Copy link
Contributor Author

expipiplus1 commented Nov 7, 2020 via email

Copy link
Member

@cdepillabout cdepillabout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for working on this!

@cdepillabout cdepillabout merged commit 7a1ec91 into NixOS:haskell-updates Nov 8, 2020
@expipiplus1 expipiplus1 deleted the joe-hackage-docs branch November 8, 2020 05:02
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

2 participants