Bug#1089398: netselect: Supporting rootless builds by default

2025-01-01 Thread Niels Thykier

Control: tags -1 patch

On Sat, 7 Dec 2024 20:54:19 +0100 Niels Thykier  wrote:

Source: netselect
Version: 0.3.ds1-30.2
Severity: important
Tags: ftbfs
Justification: FTBFS
X-Debbugs-Cc: ni...@thykier.net
User: ni...@thykier.net
Usertags: rrr-no-as-default-issue

Dear maintainer,

During a test rebuild for building packages with
`Rules-Requires-Root: no` as the default in `dpkg`,
netselect failed to rebuild.

Log Summary:
---
[...]


Hi

Please see attached as a patch.

I intend to NMU to make progress on the MBF if I do not hear from you on 
this. It would help me if you either uploaded this soon or approved the 
NMU (enabling me to skip the delay). Thanks in advance.


This package can probably come truly rootless if the upstream makefile 
could be convinced to not pass `-o root -g root` to `install`. A common 
trick here is to use `-o $(USER) -g $(GROUP)` and then have the Debian 
package substitute USER/GROUP with `id -u`/`id -g` (which is a noop but 
allowed) and then rely on `dh_fixperms` + `dh_builddeb` to build the 
package with the correct ownership. However, it is was not a minimal 
patch, so I skipped that for the NMU.


Best regards,
Niels


diff -Nru netselect-0.3.ds1/debian/changelog netselect-0.3.ds1/debian/changelog
--- netselect-0.3.ds1/debian/changelog  2024-03-17 18:12:45.0 +0100
+++ netselect-0.3.ds1/debian/changelog  2025-01-01 12:35:50.0 +0100
@@ -1,3 +1,11 @@
+netselect (0.3.ds1-30.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Make requirement for root when building the package explicit.
+(Closes: #1089398)
+
+ -- Niels Thykier   Wed, 01 Jan 2025 11:35:50 +
+
 netselect (0.3.ds1-30.2) unstable; urgency=medium
 
   * Non-maintainer upload
diff -Nru netselect-0.3.ds1/debian/control netselect-0.3.ds1/debian/control
--- netselect-0.3.ds1/debian/control2024-03-17 18:12:17.0 +0100
+++ netselect-0.3.ds1/debian/control2025-01-01 12:35:35.0 +0100
@@ -2,6 +2,7 @@
 Section: net
 Priority: optional
 Maintainer: Javier Fernández-Sanguino Peña 
+Rules-Requires-Root: binary-targets
 Standards-Version: 4.5.1
 Build-Depends: debhelper (>= 13), po-debconf
 Homepage: http://github.com/apenwarr/netselect


OpenPGP_signature.asc
Description: OpenPGP digital signature


Bug#1089398: netselect: Supporting rootless builds by default

2024-12-07 Thread Niels Thykier

Source: netselect
Version: 0.3.ds1-30.2
Severity: important
Tags: ftbfs
Justification: FTBFS
X-Debbugs-Cc: ni...@thykier.net
User: ni...@thykier.net
Usertags: rrr-no-as-default-issue

Dear maintainer,

During a test rebuild for building packages with
`Rules-Requires-Root: no` as the default in `dpkg`,
netselect failed to rebuild.

Log Summary:
---
[...]

+--+
| Build
   |
+--+


Unpack source
-

Format: 3.0 (quilt)
Source: netselect
Binary: netselect, netselect-apt
Architecture: any all
Version: 0.3.ds1-30.2
Maintainer: Javier Fernández-Sanguino Peña 
Homepage: http://github.com/apenwarr/netselect
Standards-Version: 4.5.1
Build-Depends: debhelper (>= 13), po-debconf
Package-List:
 netselect deb net optional arch=any
 netselect-apt deb net optional arch=all
Checksums-Sha1:
 4c911df972b402d401bfcfd692ff55e9957b65e9 20937
netselect_0.3.ds1.orig.tar.gz
 85083d7f47a2619658b6d3a8894ad4eeb85cba65 35632
netselect_0.3.ds1-30.2.debian.tar.xz
Checksums-Sha256:
 4e9f25042b55cc075184e9f8ff602d104ef5a804f09f69a71519e3ab00605c96 20937
netselect_0.3.ds1.orig.tar.gz
 00edc343d7fe8774e13675eb41b652d750a6bcbfa7c0919ed85e404a352c69ae 35632
netselect_0.3.ds1-30.2.debian.tar.xz
Files:
 a1eb3834389666dcba664ea95bc51776 20937 netselect_0.3.ds1.orig.tar.gz
 ea23a01c130747c569e2a3bc11c609e5 35632 
netselect_0.3.ds1-30.2.debian.tar.xz



gpgv: Signature made Sun Mar 17 17:43:05 2024 UTC
gpgv:using RSA key 406220C8B8552802378CCE411F5C7A8B45564314
gpgv:issuer "b...@debian.org"
gpgv: Can't check signature: No public key
dpkg-source: warning: cannot verify inline signature for ./
netselect_0.3.ds1-30.2.dsc: no acceptable signature found
dpkg-source: info: extracting netselect in /<>
dpkg-source: info: unpacking netselect_0.3.ds1.orig.tar.gz
dpkg-source: info: unpacking netselect_0.3.ds1-30.2.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying debian.patch

Check disk space


Sufficient free space for build

User Environment


APT_CONFIG=/var/lib/sbuild/apt.conf
HOME=/sbuild-nonexistent
LANG=en_US.UTF-8
LC_ALL=C.UTF-8
LOGNAME=debusine-worker
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
SHELL=/bin/sh
USER=debusine-worker

dpkg-buildpackage
-

Command: dpkg-buildpackage -us -uc -b -rfakeroot
dpkg-buildpackage: info: source package netselect
dpkg-buildpackage: info: source version 0.3.ds1-30.2
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Bastian Germann 
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture arm64
 debian/rules clean
dh clean
dh: warning: Use of debian/compat is deprecated and will be removed in
debhelper (>= 14~).
   dh_auto_clean
dh_auto_clean: warning: Use of debian/compat is deprecated and will be
removed in debhelper (>= 14~).
make -j4 clean
make[1]: Entering directory '/<>'
rm -f netselect netselect *.o *~ build-stamp core
rm -f mirrors_full
make[1]: Leaving directory '/<>'
   dh_clean
dh_clean: warning: Use of debian/compat is deprecated and will be
removed in debhelper (>= 14~).
 debian/rules binary
dh binary
dh: warning: Use of debian/compat is deprecated and will be removed in
debhelper (>= 14~).
   dh_update_autotools_config
   dh_autoreconf
   dh_auto_configure
dh_auto_configure: warning: Use of debian/compat is deprecated and will
be removed in debhelper (>= 14~).
   dh_auto_build
dh_auto_build: warning: Use of debian/compat is deprecated and will be
removed in debhelper (>= 14~).
make -j4 "INSTALL=install --strip-program=true"
make[1]: Entering directory '/<>'
gcc -O2 -Wall -I. -g -Wdate-time -D_FORTIFY_SOURCE=2  -c -o netselect.o
netselect.c
netselect.c: In function ‘send_icmp_probe’:
netselect.c:852:21: warning: taking address of packed member of ‘struct
’ may result in an unaligned pointer value [-Waddress-of-
packed-member]
  852 | struct ip *ip = &op->ip;
  | ^~~
netselect.c:853:25: warning: taking address of packed member of ‘struct
’ may result in an unaligned pointer value [-Waddress-of-
packed-member]
  853 | struct icmp *icmp = &op->icmp;
  | ^
netselect.c:860:18: warning: taking address of packed member of ‘struct
’ may result in an unaligned pointer value [-Waddress-of-
packed-member]
  860 | gettimeofday(&op->tv, &tz);
  |  ^~~
netselect.c: In function ‘main’:
netselect.c:202:5: warning: ignoring return value of ‘setuid’ declared
with attribute ‘warn_unused_result’ [-Wunused-result]
  202 | setuid(getuid());
  | ^~~~
netselect