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

netcat-openbsd: fix w/musl by providing b64_ntop #37819

Merged
merged 1 commit into from Mar 26, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Mar 25, 2018

Patch from gentoo-musl, implementation is from ISC (all known implementations are from ISC as far as I can tell).

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: netcat-openbsd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: netcat-openbsd

Partial log (click to expand)

these paths will be fetched (0.16 MiB download, 0.39 MiB unpacked):
  /nix/store/9wvmynhx9hvldvfhgh1jmlafqfig448c-libbsd-0.8.7
  /nix/store/c8gd9wm73zippb77qzn55mfbcrhybpzw-netcat-openbsd-1.187
copying path '/nix/store/9wvmynhx9hvldvfhgh1jmlafqfig448c-libbsd-0.8.7' from 'https://cache.nixos.org'...
copying path '/nix/store/c8gd9wm73zippb77qzn55mfbcrhybpzw-netcat-openbsd-1.187' from 'https://cache.nixos.org'...
/nix/store/c8gd9wm73zippb77qzn55mfbcrhybpzw-netcat-openbsd-1.187

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: netcat-openbsd

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187
shrinking /nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187/bin/nc
gzipping man pages under /nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187/share/man/
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187/bin
patching script interpreter paths in /nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187
checking for references to /build in /nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187...
/nix/store/n4yb88s0nz5dvbxm3fzc85gx91arrjzx-netcat-openbsd-1.187

@dtzWill dtzWill requested a review from Mic92 March 26, 2018 01:36
@@ -25,8 +25,9 @@ stdenv.mkDerivation rec {
for i in $(cat ../debian/patches/series); do
patch -p1 < "../debian/patches/$i"
done
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -i ${./musl.patch}
Copy link
Member

@Mic92 Mic92 Mar 26, 2018

Choose a reason for hiding this comment

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

You should also point out that this code is coming from glibc. This safes people from reviewing the code below.

Copy link
Member

@Mic92 Mic92 Mar 26, 2018

Choose a reason for hiding this comment

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

Or maybe just fetch it: https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=resolv/base64.c;hb=2d813d7b77ba8341a0a982d74bb59f5a0d775784

Copy link
Member Author

Choose a reason for hiding this comment

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

You should also point out that this code is coming from glibc. This safes people from reviewing the code below.

I don't believe this code originated with glibc. Also, note the OpenBSD comment header. This used to be in the OpenBSD tree, not sure of history before that. Good call re:fetching though-- the current version in glibc is still liberally licensed so might be the way to go.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@Mic92 Mic92 Mar 26, 2018

Choose a reason for hiding this comment

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

Ok. Maybe we can assume we never need to touch base64.c because the implementation should not change except for includes.

Copy link
Member

Choose a reason for hiding this comment

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

The bind link would be still a nice hint in case somebody needs to update it though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fetching it is a good idea--looks like the gentoo-musl project's patch is fetch-friendly (the alpine one was close but conflicted re:Makefile which is why I had a local copy).

I'll add BIND link too.

It seems many projects have copies of this code--
and AFAICT all are derived from ISC's BIND[2]
although it does not appear present in recent versions.

This is a curious function as it is not documented
nor part of any standard[1].

[1] https://www.lemoda.net/unix/base64/index.html
[2] for example, glibc's copy:
    https://sourceware.org/git/?p=glibc.git;a=blob;f=resolv/README;h=514e9bb617e710f16126c1474561965a2b35653d;hb=HEAD#l104
@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: netcat-openbsd

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: netcat-openbsd

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187
shrinking /nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187/bin/nc
gzipping man pages under /nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187/bin
patching script interpreter paths in /nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187
checking for references to /build in /nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187...
/nix/store/amwmcqy4b6ndczd6qwhfwh6mgl8nxr4a-netcat-openbsd-1.187

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: netcat-openbsd

Partial log (click to expand)

installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187
shrinking /nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187/bin/nc
gzipping man pages under /nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187/share/man/
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187/bin
patching script interpreter paths in /nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187
checking for references to /build in /nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187...
/nix/store/i890bpp846jffnnwq83yi949azahgnag-netcat-openbsd-1.187

@dtzWill dtzWill merged commit ec10698 into NixOS:staging Mar 26, 2018
@dtzWill dtzWill deleted the fix/netcat-openbsd-musl branch March 26, 2018 19:07
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

3 participants