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

Network lost spawning dh $@ ?! #42

Closed
eMPee584 opened this issue Nov 25, 2024 · 2 comments
Closed

Network lost spawning dh $@ ?! #42

eMPee584 opened this issue Nov 25, 2024 · 2 comments

Comments

@eMPee584
Copy link

Not sure whether this is related to #35 but I tried tracking this down and am a bit confused. So I put some statements in the debian/rules to investigate, as in:

%:
        ls -lah /etc/resolv.conf
        cat /etc/resolv.conf
        ls -lah /etc/hosts
        cat /etc/hosts
        dh $@ --with python3

This clearly shows that even without systemd-resolved or providing any --resolv-conf= option to systemd-nspawn both /etc/resolv.conf and /etc/hosts are present and valid just before the dh call.. than npm install (or a ping) fails to access the network in override_dh_auto_build:

 debian/rules build
ls -lah /etc/resolv.conf
-rw-r--r-- 1 root root 403 Nov 25 01:43 /etc/resolv.conf
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "resolvectl status" to see details about the actual nameservers.

nameserver 192.168.***.1
nameserver fd00::****:****:****:fe4c
nameserver 2001:***:***:3700:f2b0:****:****:fe4c
search *****.box
ls -lah /etc/hosts
-rw-r--r-- 1 root root 175 Nov 25 20:12 /etc/hosts
cat /etc/hosts
127.0.0.1       localhost

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
dh build --with python3
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_build
make[1]: Entering directory '/srv/build/testproject-0.1.0'
ping -c 2 gmx.de
ping: gmx.de: Temporary failure in name resolution
make[1]: *** [debian/rules:22: override_dh_auto_build] Error 2
make[1]: Leaving directory '/srv/build/testproject-0.1.0'
make: *** [debian/rules:11: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
Command `dpkg-buildpackage --changes-option=-DDistribution=bookworm` failed.
2024-11-25 Mo 21:59:06 exit status 2 from: /bin/bash LANG=C debspawn build bookworm

This is on debspawn 0.6.4 on debian bookworm, with a freshly created bookworm container..

@ximion
Copy link
Member

ximion commented Nov 25, 2024

This is intentional behavior, as per packaging policy packages must be self-contained and not access the network at build-time. Sbuild does the same thing...

@eMPee584
Copy link
Author

Oh ok. So no npm install in that part.. 🤔
Maybe a log message "disabling network resolution according to debian packaging policy" could be added before dh is invoked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants