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.tldr: fix build, add as a top-level package #29328

Merged
merged 2 commits into from Sep 15, 2017

Conversation

therealpxc
Copy link
Contributor

Motivation for this change

The package previously did not work (on any platform)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


# the tests for shell-conduit on Darwin illegitimatey assume non-GNU echo
# see: https://github.com/psibi/shell-conduit/issues/12
doCheck = !pkgs.stdenv.hostPlatform.isDarwin;
Copy link
Member

Choose a reason for hiding this comment

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

It might be possible to remedy this issue by adding pkgs.coreutils into testToolDepends for this package so that GNU echo is in $PATH. It's not essential ... just an idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is the reverse: because GNU echo is on the path, the tests don't find the behavior they expect on Darwin with Nix.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. Sorry, I misread the comment above.

# shell-conduit determines what commands are available at compile-time, so
# that tldr will not compile unless the shell-conduit it uses is compiled
# with git in its environment.
buildInputs = oldAttrs.buildInputs ++ [ pkgs.git ];
Copy link
Member

Choose a reason for hiding this comment

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

Please use lib.addBuildTool to accomplish this instead of overrideAttrs.

@therealpxc
Copy link
Contributor Author

Thanks for your review! I've fixed it up now.

J/w: besides making the code look better (simpler and more consistent), which is definitely worth something, are there additional benefits of using the addBuiltTool function here?

@peti
Copy link
Member

peti commented Sep 15, 2017

I don't think there's any major benefit except readability.

@peti peti merged commit d2f206c into NixOS:master Sep 15, 2017
@therealpxc
Copy link
Contributor Author

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants