🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
4 messages
4 total messages Started by Stuart Prescott Thu, 12 Nov 2026 03:20
Bug#1153794: lintian: warn that pure-python modules should normally be arch:all (not arch:any)
#4214
Author: Stuart Prescott
Date: Thu, 12 Nov 2026 03:20
36 lines
2960 bytes
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

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 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.

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

  lintian's existing checks for arch-dependent files (such as used to
  evaluate /usr/share vs /usr/lib splits) could also be used to broaden
  the check.

(This information is unambiguously in the dist-info/WHEEL file in modern
packaging, but we are unfortunately stripping the WHEEL file and its
metadata from the .deb with dh-python)

Thanks!
Stuart
Bug#1153794: lintian: warn that pure-python modules should normally be arch:all (not arch:any)
#4282
Author: Nilesh Patra
Date: Thu, 12 Nov 2026 18:00
42 lines
4062 bytes

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
> 
> 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 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.
> 
> 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
> 
>   lintian's existing checks for arch-dependent files (such as used to
>   evaluate /usr/share vs /usr/lib splits) could also be used to broaden
>   the check.
> 
> (This information is unambiguously in the dist-info/WHEEL file in modern
> packaging, but we are unfortunately stripping the WHEEL file and its
> metadata from the .deb with dh-python)

Is it ok to check fo `.so` in `/usr/lib/python3/dist-packages` instead of anywhere? That
would make the check a little less broad and simpler.

Thanks,
Nilesh
Bug#1153794: lintian: warn that pure-python modules should normally be arch:all (not arch:any)
#5191
Author: Nilesh Patra
Date: Fri, 20 Nov 2026 09:00
62 lines
5453 bytes
Control: tags -1 moreinfo

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
>>
>> 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 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.
>>
>> 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
>>
>>   lintian's existing checks for arch-dependent files (such as used to
>>   evaluate /usr/share vs /usr/lib splits) could also be used to broaden
>>   the check.
>>
>> (This information is unambiguously in the dist-info/WHEEL file in modern
>> packaging, but we are unfortunately stripping the WHEEL file and its
>> metadata from the .deb with dh-python)
> 
> Is it ok to check fo `.so` in `/usr/lib/python3/dist-packages` instead of anywhere? That
> would make the check a little less broad and simpler.

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.

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?

I've also CC'ed Helmut if they have suggestions on this.

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.

Best,
Nilesh
Bug#1153794: lintian: warn that pure-python modules should normally be arch:all (not arch:any)
#6013
Author: Helmut Grohne
Date: Tue, 24 Nov 2026 21:00
115 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads