Article View: linux.debian.bugs.dist
Article #3546Bug#1068615: pbuilder will overwrite LANG/LC_ALL if they are set via config file
From: Simon Richter
Date: Fri, 06 Nov 2026 19:50
Date: Fri, 06 Nov 2026 19:50
99 lines
5074 bytes
5074 bytes
Package: pbuilder
Version: 0.231.1
Followup-For: Bug #1068615
X-Debbugs-Cc: sjr@debian.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
this is still a problem, but it could be mitigated a bit by setting LANG
only and clearing all LC_* variables including LC_ALL.
Curl understands that they need an UTF-8 locale, so they build-depend on
locales-all and explicitly set LANG=en_US.UTF-8 for the Unicode tests, but
this doesn't work if LC_ALL then overrides it.
IMO, setting LC_ALL for a build is wrong.
Whether LANG should be "C" or "C.UTF-8" is a separate question -- but it
should not matter, reproducible-builds already builds with an obscure LANG
setting.
In any case, pbuilder-modules is the wrong place to set it, it needs to be
changed in pbuilder-buildpackage where the ENV_PREFIX is put together,
because that is the environment actually used for the build.
I'd probably do the radical thing and clear the environment, then
explicitly add those that should be set:
so instead of
ENV_PREFIX="env PATH=\"$PATH\" HOME=\"$BUILD_HOME\""
I'd use something like
ENV_PREFIX="env -i PATH=\"$PATH\" HOME=\"$BUILD_HOME\" LANG=C"
if [ -n "$DEB_BUILD_OPTIONS" ]
then
ENV_PREFIX+=" DEB_BUILD_OPTIONS=\"$DEB_BUILD_OPTIONS\""
fi
if [ -n "$DEB_BUILD_PROFILES" ]
then
ENV_PREFIX+=" DEB_BUILD_PROFILES=\"$DEB_BUILD_PROFILES\""
fi
I suspect the reproducible-builds people will want an explicit mechanism
here to set up weird variables, and there might be other variables we might
want to pass through, like $TERM (for interactive hooks) or $LOGNAME, so
that might need more thought than I am capable of on a Saturday morning at
5 AM.
Simon
- -- System Information:
Debian Release: 13.7
APT prefers stable-security
APT policy: (990, 'stable-security'), (990, 'stable'), (500, 'stable-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, riscv64
Kernel: Linux 7.2.11+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled
Versions of packages pbuilder depends on:
ii cdebootstrap 0.7.9+b13
ii debconf [debconf-2.0] 1.5.91
ii debootstrap 1.0.141
ii dpkg-dev 1.22.22
ii mount 2.41.5-0+deb13u1
Versions of packages pbuilder recommends:
ii devscripts 2.26.11~bpo13+1
ii eatmydata 131-2
ii fakeroot 1.37.1.1-1
ii iproute2 6.15.0-1
ii net-tools 2.10-1.3
ii sudo 1.9.16p2-3+deb13u2
Versions of packages pbuilder suggests:
pn cowdancer <none>
pn gdebi-core <none>
- -- debconf information excluded
-----BEGIN PGP SIGNATURE-----
iQFDBAEBCgAtFiEEtjuqOJSXmNjSiX3Tfr04e7CZCBEFAmruLvEPHHNqckBkZWJp
YW4ub3JnAAoJEH69OHuwmQgR/HQH+gPbDhMIZSjUYngxS4ezJfgvvmP4wv9k8Xes
vGjejiLupOgkRUFKhQKPjW4iVe//4u4bo6kwfWN5JimcvxVj6P8T9Lmql1ipG1Ae
uKddn3EoLhkDTJL1jmlOZXcUM9uEJFd+0hu6W02sZLbQompy3XQwh85IeN7hxcSR
mmrM8HpiVQJfth+RP9I7LJUolJU9/SHVTqOkTGTfXsexqkgroQa6dPEjfObVTTBw
dxCAGIkXIcFGbNBQ3w0RIZxN4fMIJq4EllfveDDyp7/LbXuOJ7dSizwMNHIzqfPc
R+hO7ETwSJ6NJe5PIhK4ruv+c3oHtrhkSUCSAsXNC9qa9v2uIsQ=
=nFem
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<NWy6J-afJa-3@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!newsfeed.xs3.de!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<IqNRL-4Oda-5@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!newsfeed.xs3.de!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Simon Richter <sjr@debian.org> Newsgroups: linux.debian.bugs.dist Subject: Bug#1068615: pbuilder will overwrite LANG/LC_ALL if they are set via config file Date: Fri, 06 Nov 2026 20:50:01 +0100 Message-ID: <NWy6J-afJa-3@gated-at.bofh.it> References: <IqNRL-4Oda-5@gated-at.bofh.it> X-Original-To: Debian Bug Tracking System <1068615@bugs.debian.org> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Fri Nov 6 19:49:08 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.9 Reply-To: Simon Richter <sjr@debian.org>, 1068615@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: sjr@debian.org, team+pbuilder@tracker.debian.org X-Debian-Pr-Message: followup 1068615 X-Debian-Pr-Package: src:pbuilder X-Debian-Pr-Keywords: patch X-Debian-Pr-Source: pbuilder Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: reportbug 13.2.0 X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2001126 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 99 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sat, 07 Nov 2026 04:48:01 +0900 X-Original-Message-ID: <179399448152.14614.4018345663106535662.reportbug@lime.hogyros.de> X-Original-References: <87plv0h729.fsf@debian.org>