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

Add dnscrypt-proxy2 package. #43227

Merged
merged 3 commits into from Jul 10, 2018
Merged

Conversation

waynr
Copy link
Contributor

@waynr waynr commented Jul 8, 2018

I am adding a new package instead of simply bumping the version of the old one for two reasons:

  • The 1.x series of dnscrypt-proxy is written in C whereas the 2.x series is written in golang
  • 2.x has different configuration conventions than 1.x; replacing the existing dnscrypt-proxy package with a backwards incompatible version would eventually break someone's preferred encrypted DNS setup.

I was reading some blog posts about encrypted DNS which recommended the 2.x series of dnscrypt rather than the 1.x. I also wanted an excuse to make my first contribution to this repository.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@waynr
Copy link
Contributor Author

waynr commented Jul 8, 2018

@joachifm @jgeerds since you two are maintainers on dnscrypt-proxy 1.x, I thought you might want to review this.

@waynr waynr force-pushed the add-dnscrypt-proxy2-package branch from 6f71796 to 638b5b2 Compare July 8, 2018 16:52
Copy link
Member

@pSub pSub 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 to me.

@Mic92
Copy link
Member

Mic92 commented Jul 8, 2018

Should we keep the old version at all? It does not seem that it is maintained.

@Mic92
Copy link
Member

Mic92 commented Jul 8, 2018

@GrahamcOfBorg build dnscrypt-proxy2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: dnscrypt-proxy2

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/1acx0cf3flyam6rzyw3wbxns66bsrl2m-dnscrypt-proxy2-2.0.15-bin/bin
patching script interpreter paths in /nix/store/1acx0cf3flyam6rzyw3wbxns66bsrl2m-dnscrypt-proxy2-2.0.15-bin
checking for references to /build in /nix/store/1acx0cf3flyam6rzyw3wbxns66bsrl2m-dnscrypt-proxy2-2.0.15-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/c8d0ydamyzy92x6hc04wkxvs09bb7a9v-dnscrypt-proxy2-2.0.15
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/c8d0ydamyzy92x6hc04wkxvs09bb7a9v-dnscrypt-proxy2-2.0.15
/nix/store/c8d0ydamyzy92x6hc04wkxvs09bb7a9v-dnscrypt-proxy2-2.0.15/share/go/src/github.com/jedisct1/dnscrypt-proxy/vendor/github.com/coreos/go-systemd/test: interpreter directive changed from "/bin/bash -e" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash -e"
/nix/store/c8d0ydamyzy92x6hc04wkxvs09bb7a9v-dnscrypt-proxy2-2.0.15/share/go/src/github.com/jedisct1/dnscrypt-proxy/vendor/github.com/kardianos/service/linux-test-su.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/c8d0ydamyzy92x6hc04wkxvs09bb7a9v-dnscrypt-proxy2-2.0.15...
/nix/store/1acx0cf3flyam6rzyw3wbxns66bsrl2m-dnscrypt-proxy2-2.0.15-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: dnscrypt-proxy2

Partial log (click to expand)

/private/tmp/nix-build-dnscrypt-proxy2-2.0.15.drv-0
post-installation fixup
strip is /nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/26zc6gnzhmisz7bp0qj0zmkrpg06pg9n-dnscrypt-proxy2-2.0.15-bin/bin
patching script interpreter paths in /nix/store/26zc6gnzhmisz7bp0qj0zmkrpg06pg9n-dnscrypt-proxy2-2.0.15-bin
strip is /nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/905gbckr6kwyzg7wkb02s3bx3x72vdks-dnscrypt-proxy2-2.0.15
/nix/store/905gbckr6kwyzg7wkb02s3bx3x72vdks-dnscrypt-proxy2-2.0.15/share/go/src/github.com/jedisct1/dnscrypt-proxy/vendor/github.com/coreos/go-systemd/test: interpreter directive changed from "/bin/bash -e" to "/nix/store/q2wqq1k20v8kc3vckapqf5nws30brnni-bash-4.4-p23/bin/bash -e"
/nix/store/905gbckr6kwyzg7wkb02s3bx3x72vdks-dnscrypt-proxy2-2.0.15/share/go/src/github.com/jedisct1/dnscrypt-proxy/vendor/github.com/kardianos/service/linux-test-su.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/q2wqq1k20v8kc3vckapqf5nws30brnni-bash-4.4-p23/bin/bash"
/nix/store/26zc6gnzhmisz7bp0qj0zmkrpg06pg9n-dnscrypt-proxy2-2.0.15-bin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: dnscrypt-proxy2

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/sfy52y5bid53gwrpmv085sb8raxkdbns-dnscrypt-proxy2-2.0.15-bin/bin
patching script interpreter paths in /nix/store/sfy52y5bid53gwrpmv085sb8raxkdbns-dnscrypt-proxy2-2.0.15-bin
checking for references to /build in /nix/store/sfy52y5bid53gwrpmv085sb8raxkdbns-dnscrypt-proxy2-2.0.15-bin...
shrinking RPATHs of ELF executables and libraries in /nix/store/4fvaj3r3f6vqlbwayjbjifqipzhlzi7f-dnscrypt-proxy2-2.0.15
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/4fvaj3r3f6vqlbwayjbjifqipzhlzi7f-dnscrypt-proxy2-2.0.15
/nix/store/4fvaj3r3f6vqlbwayjbjifqipzhlzi7f-dnscrypt-proxy2-2.0.15/share/go/src/github.com/jedisct1/dnscrypt-proxy/vendor/github.com/coreos/go-systemd/test: interpreter directive changed from "/bin/bash -e" to "/nix/store/p0vy17dp9jk2mvqsxsqnb14s3797lay7-bash-4.4-p23/bin/bash -e"
/nix/store/4fvaj3r3f6vqlbwayjbjifqipzhlzi7f-dnscrypt-proxy2-2.0.15/share/go/src/github.com/jedisct1/dnscrypt-proxy/vendor/github.com/kardianos/service/linux-test-su.sh: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/p0vy17dp9jk2mvqsxsqnb14s3797lay7-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/4fvaj3r3f6vqlbwayjbjifqipzhlzi7f-dnscrypt-proxy2-2.0.15...
/nix/store/sfy52y5bid53gwrpmv085sb8raxkdbns-dnscrypt-proxy2-2.0.15-bin

@waynr
Copy link
Contributor Author

waynr commented Jul 8, 2018

@Mic92 I have no opinion on that; I didn't remove it because I didn't want to disrupt anyone who might be using it currently and it doesn't seem like much effort to just add a second package. @joachifm or @jgeerds might have an opinion on the matter.

@@ -0,0 +1,26 @@
{ stdenv, buildGoPackage, fetchFromGitHub, go }:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need go here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'm trying to rebuild without it but removing it doesn't seem to invalidate the already-built binary.

@worldofpeace
Copy link
Contributor

worldofpeace commented Jul 9, 2018

Isn't it standard to use a goDeps = ./deps.nix; in go packages? Especially one that is using dep.

@worldofpeace
Copy link
Contributor

@Mic92 There's a nixos module and tests
for the original, so I don't think anyone wants that removed.

@waynr
Copy link
Contributor Author

waynr commented Jul 9, 2018

Isn't it standard to use a goDeps = ./deps.nix; in go packages?

Do you have a link to what the expected contents of ./deps.nix would be? Based on the name, it sounds like the expectation would be that we should specify the dependencies of dnscrypt-proxy in this file which sounds wrong from the perspective of someone who spends every day writing, debugging, or otherwise interacting with go source code. Coming recently from a non-go background I know it sounds stupid/absurd but the modern convention of golang dependency management (even with dep) is for projects to vendor their dependencies in-repo; case in point, here is where dnscrypt-proxy keeps its dependencies: https://github.com/jedisct1/dnscrypt-proxy/tree/master/vendor

Also, for what it's worth I didn't see anything like this in the package whose example I was largely mimicking for this PR: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/version-management/git-and-tools/hub

sha256 = "0iwvndk1h550zmwhwablb0smv9n2l51hqbmzj354mcgi6frnx819";
};

enableParallelBuilding = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to set this as it's default

, enableParallelBuilding ? true

* The 'go' input parameter is apparently unnecessary.
* The 'enableParallelBuilding' setting is apparently true by default.
@joachifm joachifm merged commit dae9cf6 into NixOS:master Jul 10, 2018
@joachifm
Copy link
Contributor

Thank you

@joachifm
Copy link
Contributor

See also #43298

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