[Patch] Using MACHINE_ARCH identifiers in pkg

Nathan Whitehorn nwhitehorn at freebsd.org
Mon Aug 18 16:15:53 UTC 2014


On 08/14/14 13:40, olli hauer wrote:
> On 2014-08-14 21:42, Bryan Drewery wrote:
>> On 8/14/2014 2:38 PM, olli hauer wrote:
>>> On 2014-08-14 17:35, Nathan Whitehorn wrote:
> ...
>
>> Something I've mentioned to Bapt a few times is that pkg needs a way to
>> have a list of accepted ABI strings. Then we could add both the old and
>> the new style as accepted (internally) so that old and new repositories
>> will continue to work.
>>
> Ups, rollback is not possible after the client database was updated.
>
> Even by rollback and rebuild the package metadata the following error pops up.
>
> ~/pkg-static.old_ABI update -f
> Updating repository catalogue
> pkg-static: Repository str has a wrong packagesite, need to re-create database
> Fetching meta.txz: 100% of 584 B
> Fetching digests.txz: 100% of 43 kB
> Fetching packagesite.txz: 100% of 138 kB
>
> Adding new entries: 34%
> pkg-static: wrong architecture: FreeBSD:8:amd64 instead of freebsd:8:x86:64
>
> pkg-static: repository str contains packages with wrong ABI: FreeBSD:8:amd64
> Adding new entries: 100%
> pkg-static: Unable to update repository str


Hm. I'm not sure how to handle this. There are two places that emit hard 
errors in such cases: pkg-add, which is fine since we have a workaround 
there, and here. The check is at line 446 of libpkg/repo/binary/update.c 
(you can comment it out for testing). For this one, there does not seem 
to be any good solution and we need to find one since this is the same 
issue you ran into the upgrade path.

Here are the two options I see. They are similar to each other, and we 
could do both for some time.
1. Make an intermediate pkg that is otherwise unaltered but doesn't have 
this check during updates and keep it in the tree for some substantial 
length of time so most people have it by the time we want upgrades to 
the new ABI strings.
2. Set PKGNG_ALTABI globally on the ports tree for i386 and amd64 for 
some period of time so that all built packages get the current ABI 
identifiers rather than the new ones.

Any preference here? Or other options?

>
> Roll back on the client
> # ~/bin/pkg-static backup -r /var/backups/pkgng.db
>
>
> Roll back on the build host:
> - remove all packages that where created meanwhile with the patched pkg
>    including pkg.
> - reinstall unpatched pkg on the build host
> - start a new build
>
> By doing a manual cleanup I also found that packages containing the old ABI are not removed.
>
> # ls -ltr
> -rw-r--r--  2 root  wheel   2592992 Aug 14 21:10 openssl-1.0.1_15.txz
> -rw-r--r--  2 root  wheel   1963944 Aug 14 21:11 subversion-1.8.10_1.txz
>
> # ls -l openssl*
> -rw-r--r--  3 root  wheel  2593488 Aug 11 17:31 openssl-1.0.1_14.txz
> -rw-r--r--  2 root  wheel  2592992 Aug 14 21:10 openssl-1.0.1_15.txz

Is this on the build host or the client? In other words, is this a 
poudriere issue or a pkg one?

> So the patch has more side affects ...
>
> Anyway I'm happy to test new patches to get rid of the old ABI string ;)
>

Thanks for your testing so far!
-Nathan


More information about the freebsd-ports mailing list