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

haproxy: use getaddrinfo() on Linux #44489

Merged
merged 1 commit into from Aug 5, 2018

Conversation

vincentbernat
Copy link
Member

As per project's README:

Recent systems can resolve IPv6 host names using getaddrinfo(). This
primitive is not present in all libcs and does not work in all of
them either. Support in glibc was broken before 2.3. Some embedded
libs may not properly work either, thus, support is disabled by
default, meaning that some host names which only resolve as IPv6
addresses will not resolve and configs might emit an error during
parsing. If you know that your OS libc has reliable support for
getaddrinfo(), you can add USE_GETADDRINFO=1 on the make command
line to enable it. This is the recommended option for most Linux
distro packagers since it's working fine on all recent mainstream
distros. It is automatically enabled on Solaris 8 and above, as it's
known to work.

Without this option, it is not possible for HAProxy to solve IPv6-only
names. This option is enabled in Debian builds without any notable
adverse effect.

Motivation for this change

Make HAProxy able to use DNS features with IPv6-only hosts.

Things done
  • 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.

As per project's README:

> Recent systems can resolve IPv6 host names using getaddrinfo(). This
> primitive is not present in all libcs and does not work in all of
> them either. Support in glibc was broken before 2.3. Some embedded
> libs may not properly work either, thus, support is disabled by
> default, meaning that some host names which only resolve as IPv6
> addresses will not resolve and configs might emit an error during
> parsing. If you know that your OS libc has reliable support for
> getaddrinfo(), you can add USE_GETADDRINFO=1 on the make command
> line to enable it. This is the recommended option for most Linux
> distro packagers since it's working fine on all recent mainstream
> distros. It is automatically enabled on Solaris 8 and above, as it's
> known to work.

Without this option, it is not possible for HAProxy to solve IPv6-only
names. This option is enabled in Debian builds without any notable
adverse effect.
@xeji
Copy link
Contributor

xeji commented Aug 5, 2018

@GrahamcOfBorg build haproxy

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: haproxy

Partial log (click to expand)

/nix/store/2ixssd069h796db0biscph31kn8l2p40-haproxy-1.8.13

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: haproxy

Partial log (click to expand)

moving /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/doc to /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13
shrinking /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/sbin/haproxy
gzipping man pages under /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/share/man/
strip is /nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/sbin
patching script interpreter paths in /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13
checking for references to /build in /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13...
moving /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/sbin/* to /nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13/bin
/nix/store/qwd7hfrhcvqvjrcmb5gzxb5iiyrfsy57-haproxy-1.8.13

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: haproxy

Partial log (click to expand)

moving /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/doc to /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13
shrinking /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/sbin/haproxy
gzipping man pages under /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/share/man/
strip is /nix/store/zrs21zqcchgyabjf4xfimncdq16njizc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/sbin
patching script interpreter paths in /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13
checking for references to /build in /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13...
moving /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/sbin/* to /nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13/bin
/nix/store/svlpk3pmaazc0524hi1ymqxxi9diyib4-haproxy-1.8.13

@xeji
Copy link
Contributor

xeji commented Aug 5, 2018

@GrahamcOfBorg test haproxy

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.haproxy

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 6.92s
cleaning up
killing machine (pid 600)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/3h7f9lbdfp7z66y21n4kil0af45g34nx-vm-test-run-haproxy

@xeji xeji merged commit bf1473f into NixOS:master Aug 5, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.haproxy

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 93.45s
cleaning up
killing machine (pid 631)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/9wzhry5rj0wald3cnd465qwlqkxxrc65-vm-test-run-haproxy

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