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

dhcp: fix build with sandbox=false #47794

Open
wants to merge 1 commit into
base: master
from

Conversation

@volth
Copy link
Contributor

commented Oct 3, 2018

Motivation for this change

It builds on Hydra (https://hydra.nixos.org/build/82170551) but on Nix on Debian ./configure is unable to find zlib and the build fails.

@matthewbauer

This comment has been minimized.

Copy link
Member

commented Oct 3, 2018

It would be nice to figure out what is causing the discrepancy. Most likely some feature is autodetected that needs zlib. Maybe we can just disable that for consistency?

@volth

This comment has been minimized.

Copy link
Contributor Author

commented Oct 3, 2018

the ending of the build log is

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Package:
  Name:          DHCP
  Version:       4.4.1

C Compiler:      gcc

Flags:
  DEFS:          -DHAVE_CONFIG_H
  CFLAGS:        -g -O2  -Wall -Werror -fno-strict-aliasing -I$(top_srcdir)/includes -I/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind/include

DHCP versions:   DHCPv4 and DHCPv6

Features:
  debug:         no
  failover:      yes
  execute:       yes
  binary-leases: no
  dhcpv6:        yes
  delayed-ack:   yes
  dhcpv4o6:      no
  relay-port:    no

Developer:
  ATF unittests : no


Now you can type make to build ISC DHCP

building
build flags: SHELL=/nix/store/z8pp6zndg3n655hass32pfpcx4hbnnrr-bash-4.4-p23/bin/bash
Making all in ./bind
make[1]: Entering directory '/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind'
Configuring BIND libraries for DHCP.
configure: error: found zlib include but not library.
make[1]: *** [Makefile:42: bind1] Error 1
make[1]: Leaving directory '/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind'
make: *** [Makefile:462: all-recursive] Error 1
builder for '/nix/store/8zymcs52k9jv1f9xhjh521h7ysmkqvy1-dhcp-4.4.1.drv' failed with exit code 2

@volth

This comment has been minimized.

Copy link
Contributor Author

commented Oct 3, 2018

This might be a sandbox issue (sandbox does not work there NixOS/nix#2466), and ./configure might have found incomplete Debian's zlib in /usr

@GrahamcOfBorg

This comment has been minimized.

Copy link

commented Oct 3, 2018

Success on x86_64-linux (full log)

Attempted: dhcp

Partial log (click to expand)

shrinking /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/sbin/dhclient
shrinking /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/sbin/dhcrelay
gzipping man pages under /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/share/man/
strip is /nix/store/dxf1m7dhc4qb655bdljc1fsd74v1nag3-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/lib  /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/bin  /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/sbin
patching script interpreter paths in /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1
/nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/sbin/.dhclient-script-wrapped: interpreter directive changed from "/bin/bash" to "/nix/store/nii7pk6pv4x4as7vsxbvwyzjn67vax6r-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1...
moving /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/sbin/* to /nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/bin
/nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1

@GrahamcOfBorg

This comment has been minimized.

Copy link

commented Oct 3, 2018

Success on aarch64-linux (full log)

Attempted: dhcp

Partial log (click to expand)

shrinking /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/sbin/dhclient
shrinking /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/bin/omshell
gzipping man pages under /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/share/man/
strip is /nix/store/428gs2z4b8f9byvghzlpbjwjb3a7jwxx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/lib  /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/bin  /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/sbin
patching script interpreter paths in /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1
/nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/sbin/.dhclient-script-wrapped: interpreter directive changed from "/bin/bash" to "/nix/store/017xymp5i03qzigafnfx7sgf6602gmzq-bash-4.4-p23/bin/bash"
checking for references to /build in /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1...
moving /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/sbin/* to /nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1/bin
/nix/store/3qc7iljvsnrxfncg5bg2fkf96qnv5ym7-dhcp-4.4.1

@volth volth changed the title dhcp: fix build on Debian-aarch64 dhcp: fix build with sandbox=false Oct 13, 2018

@xeji

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2018

Wouldn't it be better to disable whatever feature of bundled BIND uses zlib?

Adding zlib certainly is the easier fix (and probably won't hurt). But I think we shouldn't let random state of some non-NixOS system dictate our package configuration. If such things happen, it means our package is underspecified.

@xeji

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2018

This is also one more example of why I think we should only support sandboxed builds...

@volth

This comment has been minimized.

Copy link
Contributor Author

commented Oct 13, 2018

I think all libraries that ./configure is looking for should be provided in .nix file. Even if they are not used after the test.

This is also one more example of why I think we should only support sandboxed builds...

sandboxing does not work everywhere, for at lease 2 reasons: libseccomp is not available on all the platforms and NixOS/nix#2466

@tomberek

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2019

Potential impurity in CLIENT_PATH?

make[1]: Leaving directory '/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/omapip'
Making all in client
make[1]: Entering directory '/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/client'
Making all in .
make[2]: Entering directory '/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/client'
gcc -DHAVE_CONFIG_H -I. -I../includes  -DCLIENT_PATH='"PATH=/nix/store/7rpm19bv006nw3y2qacci29gv9w2b6q6-dhcp-4.4.1/sbin:/sbin:/bin:/usr/sbin:/usr/bin"' -DLOCALSTATEDIR='"/var"'   -g -O2  -Wall -Werror -fno-strict-aliasing -I../includes -I/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind/include -c -o client_tables.o client_tables.c
gcc -DHAVE_CONFIG_H -I. -I../includes  -DCLIENT_PATH='"PATH=/nix/store/7rpm19bv006nw3y2qacci29gv9w2b6
q6-dhcp-4.4.1/sbin:/sbin:/bin:/usr/sbin:/usr/bin"' -DLOCALSTATEDIR='"/var"'   -g -O2  -Wall -Werror -fno-strict-aliasing -I../includes -I/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind/include -c -o clparse.o clparse.c
gcc -DHAVE_CONFIG_H -I. -I../includes  -DCLIENT_PATH='"PATH=/nix/store/7rpm19bv006nw3y2qacci29gv9w2b6
q6-dhcp-4.4.1/sbin:/sbin:/bin:/usr/sbin:/usr/bin"' -DLOCALSTATEDIR='"/var"'   -g -O2  -Wall -Werror -fno-strict-aliasing -I../includes -I/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind/include -c -o dhclient.o dhclient.c
gcc -DHAVE_CONFIG_H -I. -I../includes  -DCLIENT_PATH='"PATH=/nix/store/7rpm19bv006nw3y2qacci29gv9w2b6
q6-dhcp-4.4.1/sbin:/sbin:/bin:/usr/sbin:/usr/bin"' -DLOCALSTATEDIR='"/var"'   -g -O2  -Wall -Werror -fno-strict-aliasing -I../includes -I/tmp/nix-build-dhcp-4.4.1.drv-0/dhcp-4.4.1/bind/include -c -o dhc6.o dhc6.c
@nixos-discourse

This comment has been minimized.

Copy link

commented Apr 10, 2019

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/12

@matthewbauer
Copy link
Member

left a comment

Should go to staging i think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.