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

yadm: add missing dependencies #73615

Merged
merged 2 commits into from Nov 29, 2019
Merged

yadm: add missing dependencies #73615

merged 2 commits into from Nov 29, 2019

Conversation

ilikeavocadoes
Copy link
Contributor

Motivation for this change

Yadm was missing a runtime dependency on git.

Things done

Added git to buildInputs

  • 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 nix-review --run "nix-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.
Notify maintainers

Copy link
Member

@Br1ght0ne Br1ght0ne left a comment

Choose a reason for hiding this comment

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

Seems reasonable.

By the way, what about yadm encrypt, that relies on GnuPG? Should it be an optional?

@ilikeavocadoes
Copy link
Contributor Author

Seems reasonable.

By the way, what about yadm encrypt, that relies on GnuPG? Should it be an optional?

I'm not really sure. Git is really needed for basic functionality but GPG could be considered to be extra? What is the general Nixpkgs policy regarding optional dependencies?

@ryantm
Copy link
Member

ryantm commented Nov 18, 2019

I'm not sure if there is an official policy, but my feeling is that it is nice to get everything to work by default unless there is some good reason not to, like the optional dependency causes a significant performance overhead.

@ilikeavocadoes ilikeavocadoes changed the title yadm: add missing dependency on git yadm: add missing dependencies Nov 20, 2019
@ilikeavocadoes
Copy link
Contributor Author

ilikeavocadoes commented Nov 20, 2019

I also think that when installing a package, everything should work by default. Thus, I added also gpg to buildInputs. Also, maybe the Nixpkgs manual needs to have some mention of optional dependencies, even if a full-on policy would be exaggerating?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/84

Copy link
Contributor

@c0bw3b c0bw3b left a comment

Choose a reason for hiding this comment

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

I also notice that this package doesn't produce any log when built and the man page isn't compressed. This is because of the custom buildCommand

You could replace the whole buildCommand with:

  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall
    install -Dt $out/bin $src/yadm
    install -Dt $out/share/man/man1 $src/yadm.1
    install -D $src/completion/yadm.zsh_completion $out/share/zsh/site-functions/_yadm
    install -D $src/completion/yadm.bash_completion $out/share/bash-completion/completions/yadm.bash
    runHook postInstall
  '';

Then the normal fixup phase would automatically patch any shebang and compress man pages.
Plus the build gets logged which could be useful for checks on Hydra.

This let the fixup phase compress man pages and patch shebangs
@c0bw3b c0bw3b merged commit 6c6abf4 into NixOS:master Nov 29, 2019
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

5 participants