Re: list of valid ABI combinations

From: Dan Langille <dan_at_langille.org>
Date: Thu, 07 Dec 2023 13:22:28 UTC
On Wed, Dec 6, 2023, at 8:31 PM, Warner Losh wrote:
> 
> 
> On Wed, Dec 6, 2023, 6:01 PM Dan Langille <dan@langille.org> wrote:
>> On Thu, Apr 9, 2020, at 11:01 AM, Dan Langille wrote:
>> > Hello,
>> >
>> > I'm looking to add package support to FreshPorts - so you can know if a 
>> > package exists for a given ABI (e.g. FreeBSD:12:amd64).
>> >
>> > The goal, write a script which does something like this:
>> >
>> >   for abi in $ABIS
>> >   do
>> >     fetch -o abi. packagesite.txz 
>> > https://pkg.freebsd.org/$abi/latest/packagesite.txz
>> >     # parse the file, updating the database
>> >   done
>> >
>> > Is there a list of current valid ABI combinations.
>> >
>> > I see a list at https://pkg.freebsd.org/ - is this manually maintained?
>> >
>> > While my goal is to have FreshPorts require minimal intervention, I 
>> > suppose new ABI combinations do not come along frequently and could be 
>> > maintained manually. It does not seem like a huge task.
>> >
>> > More details here: https://github.com/FreshPorts/freshports/issues/142
>> 
>> I see I have been trying to figure this out for a few years.
>> 
>> Does anyone have any ideas as to where this might be determined?
> 
> It should be just the list of valid MACHINE_ARCH (make targets can give you a variation of this list).

For those following along at home:

[13:18 mydev dan ~/src/freebsd/src] % make targets
Supported TARGET/TARGET_ARCH pairs for world and kernel targets
    amd64/amd64
    arm/armv7
    arm64/aarch64
    i386/i386
    powerpc/powerpc
    powerpc/powerpc64
    powerpc/powerpc64le
    riscv/riscv64


> If you compute the cross product of that list and the supported branches {12,13,14;15} you will know what you can try. 

Is that list hosted somewhere I can script a fetch? I'm going to guess no. Granted, that list changes infrequently too.

> However, you need to know the current package builders. It's a subset of branches and abis, but since it's just the packages this should give you a matrix after you fetch.

My goal is to automatically maintain this table, from which FreshPorts fetches package information:

freshports.dev=# select * from abi order by name;
id |         name         | active 
----+----------------------+--------
  9 | FreeBSD:12:aarch64   | t
  1 | FreeBSD:12:amd64     | t
15 | FreeBSD:12:armv6     | t
16 | FreeBSD:12:armv7     | t
  8 | FreeBSD:12:i386      | t
18 | FreeBSD:12:mips64    | t
19 | FreeBSD:12:powerpc64 | t
  2 | FreeBSD:13:aarch64   | t
11 | FreeBSD:13:amd64     | t
20 | FreeBSD:13:armv6     | t
21 | FreeBSD:13:armv7     | t
10 | FreeBSD:13:i386      | t
23 | FreeBSD:13:mips64    | t
24 | FreeBSD:13:powerpc64 | t
34 | FreeBSD:13:riscv64   | t
26 | FreeBSD:14:aarch64   | t
27 | FreeBSD:14:amd64     | t
28 | FreeBSD:14:armv6     | t
29 | FreeBSD:14:armv7     | t
30 | FreeBSD:14:i386      | t
32 | FreeBSD:14:mips64    | t
33 | FreeBSD:14:powerpc64 | t
35 | FreeBSD:14:riscv64   | t
54 | FreeBSD:15:aarch64   | t
47 | FreeBSD:15:amd64     | t
48 | FreeBSD:15:armv6     | t
49 | FreeBSD:15:armv7     | t
50 | FreeBSD:15:i386      | t
51 | FreeBSD:15:mips64    | t
52 | FreeBSD:15:powerpc64 | t
53 | FreeBSD:15:riscv64   | t
(31 rows)

freshports.dev=# 

Thank you. :)

--
  Dan Langille
  dan@langille.org