Bug#1089377: logapp: Supporting rootless builds by default

2025-01-01 Thread Niels Thykier

Control: tags -1 patch

On Sat, 7 Dec 2024 20:38:28 +0100 Niels Thykier  wrote:

Source: logapp
Version: 0.16-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`,
logapp 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.


Best regards,
Niels

diff -Nru logapp-0.16/debian/changelog logapp-0.16/debian/changelog
--- logapp-0.16/debian/changelog2023-01-11 05:01:52.0 +0100
+++ logapp-0.16/debian/changelog2025-01-01 10:26:50.0 +0100
@@ -1,3 +1,12 @@
+logapp (0.16-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Remove need for root when building the package.
+(Closes: #1089377)
+  * Pass `-n` to `gzip` to aid reproducibility.
+
+ -- Niels Thykier   Wed, 01 Jan 2025 09:26:50 +
+
 logapp (0.16-2) unstable; urgency=medium
 
   * Patch from Chris Lamb: The md5sums file is "manually" generated, and
diff -Nru logapp-0.16/debian/control logapp-0.16/debian/control
--- logapp-0.16/debian/control  2023-01-11 05:01:08.0 +0100
+++ logapp-0.16/debian/control  2025-01-01 10:26:45.0 +0100
@@ -3,6 +3,7 @@
 Priority: optional
 Maintainer: Kumar Appaiah 
 Build-Depends: quilt
+Rules-Requires-Root: no
 Standards-Version: 4.4.1
 Homepage: http://logapp.sourceforge.net/
 Vcs-Browser: https://salsa.debian.org/akumar/logapp
diff -Nru logapp-0.16/debian/rules logapp-0.16/debian/rules
--- logapp-0.16/debian/rules2023-01-11 05:01:52.0 +0100
+++ logapp-0.16/debian/rules2025-01-01 10:25:42.0 +0100
@@ -13,10 +13,10 @@
 # Install program
 INSTALL = install
 
-INSTALL_FILE= $(INSTALL) -p-o root -g root  -m  644
-INSTALL_PROGRAM = $(INSTALL) -p-o root -g root  -m  755
-INSTALL_SCRIPT  = $(INSTALL) -p-o root -g root  -m  755
-INSTALL_DIR = $(INSTALL) -p -d -o root -g root  -m  755
+INSTALL_FILE= $(INSTALL) -p-m  644
+INSTALL_PROGRAM = $(INSTALL) -p-m  755
+INSTALL_SCRIPT  = $(INSTALL) -p-m  755
+INSTALL_DIR = $(INSTALL) -p -d -m  755
 
 
 # The installation directory
@@ -39,35 +39,35 @@
$(MAKE)
touch $@
 
-clean: checkroot unpatch
+clean: unpatch
$(checkdir)
rm -f build-stamp
[ ! -f Makefile ] || $(MAKE) clean
rm -rf $(PACKAGE_DIR) debian/files debian/substvars 
debian/logapplogmake \
debian/logapplogsvn debian/logapplogcvs debian/logapp.substvars
 
-install: checkroot build
+install: build
$(checkdir)
$(INSTALL_DIR) $(PACKAGE_DIR)/usr/bin
$(MAKE) DESTDIR=$(CURDIR)/$(PACKAGE_DIR) install
 
 # Build architecture-independent files here.
-binary-indep: checkroot build install
+binary-indep: build install
 # We have nothing to do by default.
 
 # Build architecture-dependent files here.
-binary-arch: checkroot build install
+binary-arch: build install
$(checkdir)
$(INSTALL_DIR) $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/
for i in README TODO;do \
$(INSTALL_FILE) -m 644 $$i 
$(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/; \
done;
$(INSTALL_FILE) -m 644 debian/changelog 
$(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/changelog.Debian
-   gzip -9v $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/changelog.Debian
+   gzip -9nv $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/changelog.Debian
$(INSTALL_FILE) -m 644 debian/copyright 
$(PACKAGE_DIR)/usr/share/doc/$(PACKAGE_NAME)/copyright
$(INSTALL_DIR) $(PACKAGE_DIR)/usr/share/man/man1
$(INSTALL_FILE) -m 644 $(PACKAGE_NAME).1 
$(PACKAGE_DIR)/usr/share/man/man1
-   gzip -9v $(PACKAGE_DIR)/usr/share/man/*/*
+   gzip -9nv $(PACKAGE_DIR)/usr/share/man/*/*
(cd $(PACKAGE_DIR)/usr/share/man/man1/;for i in logcvs logmake 
logsvn;do ln -s logapp.1.gz $$i.1.gz; done)
# Recreate the symbolic links for the executables, to ensure that they 
are relative to $PWD
(cd $(PACKAGE_DIR)/usr/bin;for i in logcvs logmake logsvn;do rm -f 
"$$i"; ln -s logapp $$i; done)
@@ -80,7 +80,7 @@
$(INSTALL_DIR) $(PACKAGE_DIR)/DEBIAN
cd $(PACKAGE_DIR) && find * -type f ! -regex '^DEBIAN/.*' -print0 | 
LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
dpkg-gencontrol -p$(PACKAGE_NAME) -P$(PACKAGE_DIR)
-   dpkg-deb --build $(PACKAGE_DIR) ..
+   dpkg-deb --root-owner-group --build $(PACKAGE_DIR) ..
 
 binary: binary-indep binary-arch
 
@@ -88,9 +88,4 @@
test -f logapp.h && test -f debian/rules
 endef
 
-checkroot:
-   $(checkdir)
-   test root = "

Bug#1089377: logapp: Supporting rootless builds by default

2024-12-07 Thread Niels Thykier

Source: logapp
Version: 0.16-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`,
logapp failed to rebuild.

Log Summary:
---
[...]

+--+
| Build
   |
+--+


Unpack source
-

Format: 3.0 (quilt)
Source: logapp
Binary: logapp
Architecture: any
Version: 0.16-2
Maintainer: Kumar Appaiah 
Homepage: http://logapp.sourceforge.net/
Standards-Version: 4.4.1
Vcs-Browser: https://salsa.debian.org/akumar/logapp
Vcs-Git: https://salsa.debian.org/akumar/logapp.git
Build-Depends: quilt
Package-List:
 logapp deb utils optional arch=any
Checksums-Sha1:
 07c67ac6b5075a973df6cf27df0884acc4c05360 46036 logapp_0.16.orig.tar.gz
 cbe9865da2db0745af181369c526b2e42d0dd89f 4132 logapp_0.16-2.debian.tar.xz
Checksums-Sha256:
 bb3eaa997d85a69c7e8c038d1d2c4daade15dad2bb22ee70567c0d8f3a631742 46036
logapp_0.16.orig.tar.gz
 7d8467c9d8c29cffcca724f7cea934df862d945a52bc65d2cf2a26a4cc384b85 4132
logapp_0.16-2.debian.tar.xz
Files:
 e1fb2f4dd4f5722aeac3e1078f6d41f1 46036 logapp_0.16.orig.tar.gz
 7a824f897387a2281c2dba4b3d176a2a 4132 logapp_0.16-2.debian.tar.xz


gpgv: Signature made Wed Jan 11 04:05:23 2023 UTC
gpgv:using RSA key 466FDDBF10560F509CDE3A4C7A8F49E8B63480BE
gpgv: Can't check signature: No public key
dpkg-source: warning: cannot verify inline signature for ./
logapp_0.16-2.dsc: no acceptable signature found
dpkg-source: info: extracting logapp in /<>
dpkg-source: info: unpacking logapp_0.16.orig.tar.gz
dpkg-source: info: unpacking logapp_0.16-2.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying debian/locations.diff

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 logapp
dpkg-buildpackage: info: source version 0.16-2
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Kumar Appaiah 
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture arm64
 debian/rules clean
test -f logapp.h && test -f debian/rules
test root = "`whoami`"
make: *** [debian/rules:93: checkroot] Error 1
dpkg-buildpackage: error: debian/rules clean subprocess returned exit
status 2

Build finished at 2024-11-17T09:21:26Z

---


The above is just how the build ends and not necessarily the most
relevant part. If required, the full build log is available here:

https://people.debian.org/~nthykier/rrr-no-as-default/logs/1020502.gz

You can find common solutions at
https://people.debian.org/~nthykier/rrr-no-as-default/docs/solutions.md

If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.

If this package is listed in
https://people.debian.org/~nthykier/rrr-no-as-default/docs/static-
ownership.list,
then please just set `Rules-Requires-Root: binary-targets` to the source
stanza of `debian/control` as a fix to this bug.

If this package is listed in
https://people.debian.org/~nthykier/rrr-no-as-default/docs/maybe-
misbuilds.list,
then the package was deemed at risk for misbuilding (having wrong
ownership) but had a FTBFS problem we tested it. Please test whether the
package works with `Rules-Requires-Root: no` validating that the
resulting deb has the correct ownership for all paths in the deb.

The goal is to have the default changed in `dpkg` either in `Trixie` or
`Forky`, depending on progress and feasibility with the release schedule
for Trixie.

For more information on this bug filing, please see:
https://lists.debian.org/debian-dpkg/2024/11/msg00016.html

Thanks,


PS: The builds were performed in mid-November. If you fixed the problem
between between then and this bug being filed, then please just close
the bug with the version it was fixed in.


OpenPGP_signature.asc
Description: OpenPGP digital signature