Article View: linux.debian.bugs.dist
Article #6013Bug#1153794: lintian: warn that pure-python modules should normally be arch:all (not arch:any)
From: Helmut Grohne
Date: Tue, 24 Nov 2026 21:00
Date: Tue, 24 Nov 2026 21:00
115 lines
7478 bytes
7478 bytes
Hi Nilesh and Stuart, Thanks for reaching out to me! On Fri, Nov 20, 2026 at 02:21:19PM +0530, Nilesh Patra wrote: > On 12/11/26 11:26 pm, Nilesh Patra wrote: > > > > > > On 12/11/26 8:47 am, Stuart Prescott wrote: > >> Package: lintian > >> Version: 2.143.0 > >> Severity: wishlist > >> X-Debbugs-Cc: stuart@debian.org > >> > >> Dear Maintainer, > >> > >> I've spotted a reasonable number of Python module packages that are > >> specifying Architecture: any when they are pure Python modules i.e. > >> they do not contain any compiled extensions, such as > >> /usr/lib/python3/dist-packages/MODULE/SOMETHING.cpython-XYY-x86_64-linux-gnu.so This is a condition that the multiarch hinter explicitly checks. On affected modules, you should see a todo item on tracker.debian.org. An example package where you can see this is python3-ansi (https://tracker.debian.org/pkg/ansi). > >> There is a small number of packages where the module includes something > >> about the host architecure in a config file or the package contains > >> other files that vary across architectures. The majority of pure Python > >> modules should be arch:all, regardless of any libraries that they use. I would very much like to agree here. Unfortunately, our dependency system is not sufficiently capable to support this stance. When a module is Arch:all, a foreign architecture dependency is universally unsatisfiable unless the package is marked Multi-Arch: foreign. Sounds easy enough, let's just make those libraries Multi-Arch: foreign as well, right? Sadly, no. Let's focus on python3-trubar for example. It presently is packaged as Arch:all without Multi-Arch: foreign. Therefore, foreign architecture dependencies are unsatisfiable. If we were to add Multi-Arch: foreign here, we'd be in a bad place. python3-trubar depends on python3-yaml which is an extension module. An architecture constraint of a dependency on python3-trubar needs to transfer to python3-yaml, but the foreign annotation removes this constraint. So we actually must not mark it Multi-Arch: foreign. I tried long and hard to change our dependency system, but this is really difficult. Therefore, we've resorted to a hack. Just turn the package Architecture: any + Multi-Arch: same. This is termed the "multiarch interpreter workaround". So I stand by that paragraph if we delete "regardless of any libraries that they use", because for multiarch the libraries being used are important. > >> I filed a couple of bugs against individual packages for this the other > >> day... and then realised that this is widespread enough to (a) scope the > >> problem more and (b) have lintian systematically look for the problem. This is a problem, because I filed a sizable number of bugs to convert those packages from Arch:all to Arch:any over the years... > >> The simplest heuristic for this would be: > >> > >> - if there are no .so files in the package (anywhere) then it should > >> be an arch:all package Add another condition: "and they do not depend on any architecture-dependent package". Unfortunately, lintian cannot check this, because it does not know the architecture of the packages listed in depends. What it can do is check whether all dependencies are annotated ":any", because then it knows. This would actually flag a noticeable amount of dependency-less Python modules. The python3-ansi case from above would be such a case. > I noticed that there is `package-contains-no-arch-dependent-files` which does that already. > It is however marked experimental. > > My guess is this is because many packages have good reasons to add arch: any despite no arch > dep files. You guessed right! > https://udd.debian.org/lintian-tag/package-contains-no-arch-dependent-files?affected=yes > > flags a large amount of rust packages for instance. If this does not apply to python modules, > I can have a new tag and emit it at info level for just python modules. Should this be done? In the Rust ecosystem, we mostly agreed to apply the multiarch interpreter workaround universally. This is what makes cross building large quantities of Rust packages work. > I've also CC'ed Helmut if they have suggestions on this. Thank you. > Secondly, unrelated to the question - I see you filed #1153570 and #1153567 for beangulp and beanprice > which do not emit `package-contains-no-arch-dependent-files`. This is a bug in this check and I've > opened https://salsa.debian.org/lintian/lintian/-/merge_requests/837 to fix that. Those two bugs are particular cases the interpreter workaround is relevant as they both depend on python3-beancount. Changing them to Arch:all makes cross building harder if those packages ever show up in any transitive Build-Depends. I kindly ask you to close those bugs until we have a better solution for the dependency system. Arch: all packages are presently treated as if they had the same architecture as the installed dpkg package (termed "native architecture"). The proposal would be to allow Arch: all packages to assume any architecture known to dpkg so long as their dependencies are satisfied with respect to that architecture. This is not an easy change unfortunately. Helmut
Technical Details
Message-ID:
<O35Mm-dWvb-41@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NYtvX-blKt-1@gated-at.bofh.it> <NYtvX-blKt-1@gated-at.bofh.it> <NYHfz-btdn-5@gated-at.bofh.it> <O1sDn-d3dB-1@gated-at.bofh.it> <NYtvX-blKt-1@gated-at.bofh.it> <O1sDn-d3dB-1@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Helmut Grohne <helmut@subdivi.de> Newsgroups: linux.debian.bugs.dist Subject: Bug#1153794: lintian: warn that pure-python modules should normally be arch:all (not arch:any) Date: Tue, 24 Nov 2026 22:00:02 +0100 Message-ID: <O35Mm-dWvb-41@gated-at.bofh.it> References: <NYtvX-blKt-1@gated-at.bofh.it> <NYtvX-blKt-1@gated-at.bofh.it> <NYHfz-btdn-5@gated-at.bofh.it> <O1sDn-d3dB-1@gated-at.bofh.it> <NYtvX-blKt-1@gated-at.bofh.it> <O1sDn-d3dB-1@gated-at.bofh.it> X-Original-To: Nilesh Patra <nilesh@debian.org>, 1153794@bugs.debian.org X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Tue Nov 24 20:51:35 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.451 Reply-To: Helmut Grohne <helmut@subdivi.de>, 1153794@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: lintian-maint@debian.org X-Debian-Pr-Message: followup 1153794 X-Debian-Pr-Package: lintian X-Debian-Pr-Keywords: moreinfo X-Debian-Pr-Source: lintian MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004788 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 115 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: Stuart Prescott <stuart@debian.org> X-Original-Date: Fri, 20 Nov 2026 13:56:06 +0100 X-Original-Message-ID: <20261120125606.GA4027541@subdivi.de> X-Original-References: <179445347764.1450317.9501816546772604563.reportbug@trochilus.nanonanonano.net> <179445347764.1450317.9501816546772604563.reportbug@trochilus.nanonanonano.net> <616e4f43-a6d4-4959-a22c-172e5b252c6a@debian.org> <9c17d51d-3680-4055-aaad-7d4058c99619@debian.org> <179445347764.1450317.9501816546772604563.reportbug@trochilus.nanonanonano.net> <9c17d51d-3680-4055-aaad-7d4058c99619@debian.org>