Article View: linux.debian.bugs.dist
Article #427Re: endianness
From: Guillem Jover
Date: Sat, 10 Oct 2026 22:40
Date: Sat, 10 Oct 2026 22:40
95 lines
5694 bytes
5694 bytes
Hi! On Sun, 2026-10-11 at 03:31:34 +0900, Simon Richter wrote: > I have a package where my build dependencies change based on host > endianness, and I also need to generate dependencies in the binaries > based on endianness. To avoid hardcoding arch lists in theory you could use one of the virtual packages from architecture-properties in build dependencies, such as: architecture-is-64-bit | foo-for-32-bit, architecture-is-little-endian | bar-for-big-endian, But this is rather hackish, and in addition it should not work on Debian buildds where (AFAIR) only the first alternative is ever considered. For run-time dependencies you could inject the arch list via a substvar, by fetching the values from something like: dpkg-architecture --match-bits 64 --list-known dpkg-architecture --match-endian little --list-known > 1. Does it make sense to add arch restrictions [bigendian] and > [littleendian] so I don't have to list the known big and little > endian architectures? I think it would be nice, alongside bitness, but not by using the same namespaces as architectures. This same thing was requested in #962848, (and I thought I replied, but perhaps only on IRC or private mail or something? Or maybe in conversations with Niels, that ended up with the current architecture-properties approach). I also now just found references to something like this in #630342. Reusing the arch namespace means that declaring these dependencies will silently not get satisfied until all resolvers get updated, which I think would be rather bad. To me this calls for a breaking change, by adding some new syntax that hopefully separates this notation from existing arch names. I've just not been sure what to use here, and I shudder at this type of "update all resolvers" kind of change. And the existing approach while a bit cumbersome (and TBH a workaround for a limitation in the base tools), just works for most stuff right now (but not your first case) and requires no ecosystem-wide changes to the syntax. If our arch tuples were a bit more rich, then we could probably match on those attributes, but then there are other attributes that we might eventually also want to match on that would not be present anyway. The first thing that comes to mind might be something like: arch:32-bit arch:64-bit arch:little-endian arch:big-endian or perhaps: arch:bits:32 arch:bits:64 arch:endian:little arch:endian:big or variations on that, perhaps arch:<attr>=<value>, dunno. Where this could make it possible to extend to other arch attributes (although I'm not sure any other attributes might be very useful), such as for example: arch:char:signed arch:char:unsigned arch:exec:elf arch:exec:mach-o … In any case there might be other/better ways to represent this. And the prefix at least feels a bit redundant when used in an Architecture field. I guess another problem is that resolvers would need (ideally) to get the information about these attributes from the dpkg arch tables, but that might be annoying to deploy or rely on. Thus this might need input from at least the major resolver implementations. > 2. Does it make sense to add a predefined substvar "Endian" that > gives the same value as "dpkg-architecture -qDEB_HOST_ARCH_ENDIAN"? Probably, and I actually had implemented this some time ago, but was not sure whether it was worth it, so ended up not merging it: https://git.hadrons.org/cgit/debian/dpkg/dpkg.git/commit/?h=next/substvars-arch&id=87b68cee48a3ce66cd93c145d78491c67e9ed8aa But if there's demand, I'm happy to merge it, after I've cleaned this a bit. Thanks, Guillem
Technical Details
Message-ID:
<NMNTr-4LQ7-11@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NMKiR-4JQ9-3@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!2.eu.feeder.erje.net!feeder.erje.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Guillem Jover <guillem@debian.org> Newsgroups: linux.debian.maint.dpkg,linux.debian.bugs.dist Subject: Re: endianness Date: Sun, 11 Oct 2026 00:40:01 +0200 Message-ID: <NMNTr-4LQ7-11@gated-at.bofh.it> References: <NMKiR-4JQ9-3@gated-at.bofh.it> X-Original-To: Simon Richter <sjr@debian.org> X-Mailbox-Line: From debian-dpkg-request@lists.debian.org Sat Oct 10 22:38:30 2026 Old-Return-Path: <guillem@master.debian.org> X-Amavis-Spam-Status: No, score=-110.651 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, LDO_WHITELIST=-5, MD5_SHA1_SUM=-1, RCVD_IN_DNSWL_MED=-2.3, USER_IN_DKIM_WELCOMELIST=-0.01, USER_IN_DKIM_WHITELIST=-100] autolearn=ham autolearn_force=no Mail-Followup-To: Simon Richter <sjr@debian.org>, debian-dpkg@lists.debian.org, 962848@bugs.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Mailing-List: <debian-dpkg@lists.debian.org> archive/latest/21637 List-ID: <debian-dpkg.lists.debian.org> List-URL: <https://lists.debian.org/debian-dpkg/> List-Archive: https://lists.debian.org/msgid-search/asq-VoV5D1_Pcrk9@thunder.hadrons.org Approved: robomod@news.nic.it Lines: 95 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: debian-dpkg@lists.debian.org, 962848@bugs.debian.org X-Original-Date: Sun, 11 Oct 2026 00:38:14 +0200 X-Original-Message-ID: <asq-VoV5D1_Pcrk9@thunder.hadrons.org> X-Original-References: <cc8f155a-895c-4d15-972c-67aec2110fd4@debian.org>