Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] GPKG archive name when multiple USE configs availa
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 358

PostPosted: Sun Jul 28, 2024 1:13 am    Post subject: [SOLVED] GPKG archive name when multiple USE configs availa Reply with quote

Title character limits are too limiting sometimes...

I've noticed that binhosts can have multiple variants of the same category/package-version available, differing in set USE flags.
Looking at a binhost's clang package, I can see that the archives have a suffix like -1.
Looking at my $PKGDIR, I can see sys-devel/clang-18.1.8.gpkg.tar, but inside the archive is directory clang-18.1.8-3, corresponding to the third archive from the binhost.

How does portage understand these enumerated binary packages?
More specifically:

In order for emerge to figure out that clang USE flags in archive 3 match my system, does it need to download all archives and then check metadata of each? I see no other way.
Why does the clang archive in my $PKGDIR not contain the -3 suffix?
If the clang archive does not contain the -3 suffix, why does the directory contained in the archive still contain that suffix?
Did I miss the answer to these questions somewhere in gentoo documentation?


Last edited by bstaletic on Sun Jul 28, 2024 7:57 am; edited 1 time in total
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 214

PostPosted: Sun Jul 28, 2024 4:43 am    Post subject: Re: GPKG archive name when multiple USE configs availa Reply with quote

bstaletic wrote:
How does portage understand these enumerated binary packages?
More specifically:

In order for emerge to figure out that clang USE flags in archive 3 match my system, does it need to download all archives and then check metadata of each? I see no other way.


The "Packages" file is an index of all available archives, including dependency information, IUSE flags, enabled USE flags, the subslots built against by RDEPEND entries containing :=, etc.

The gpkg filename only needs to be unique.

bstaletic wrote:

Why does the clang archive in my $PKGDIR not contain the -3 suffix?
If the clang archive does not contain the -3 suffix, why does the directory contained in the archive still contain that suffix?
Did I miss the answer to these questions somewhere in gentoo documentation?


I am not sure why the one in your PKGDIR doesn't have a -3. It is, generally, possible for archives to have a different suffix internally since I don't think anything enforces it. Portage will, at least sometimes, rename the downloaded gpkg since it clashes with a gpkg you already have-- e.g. imagine if you rebuilt it three times locally yourself with different USE flags, then downloaded a -3 package from the binhost with a fourth combo? It would be unable to download to the -3 filename and therefore *must* rename itself.

(I would probably argue that that is a reason why the internal archive should not store the number at all, and it should only be an artifact of the on-disk storage, but I had no part in designing the format... :D)
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 358

PostPosted: Sun Jul 28, 2024 7:56 am    Post subject: Reply with quote

eschwartz wrote:
The "Packages" file


Ah, that makes more sense! I've seen it, but completely ignored its specification and focused on individual gpkgs.

eschwartz wrote:

I am not sure why the one in your PKGDIR doesn't have a -3. It is, generally, possible for archives to have a different suffix internally since I don't think anything enforces it. Portage will, at least sometimes, rename the downloaded gpkg since it clashes with a gpkg you already have-- e.g. imagine if you rebuilt it three times locally yourself with different USE flags, then downloaded a -3 package from the binhost with a fourth combo? It would be unable to download to the -3 filename and therefore *must* rename itself.

(I would probably argue that that is a reason why the internal archive should not store the number at all, and it should only be an artifact of the on-disk storage, but I had no part in designing the format... :D)


I see why those suffixes are needed. Now I also see why renames might happen.
I still think it's silly for the archive to have no suffix, but the contained directory to have one.
I'll play around with changing USE flags some more to satisfy the remainder of my curiosity regarding gpkgs.
Marking as solved.
Back to top
View user's profile Send private message
bstaletic
Guru
Guru


Joined: 05 Apr 2014
Posts: 358

PostPosted: Sun Jul 28, 2024 8:27 am    Post subject: Reply with quote

My FEATURES do not have binpkg-multi-instance, hence no BUILD_ID suffix in my gpkg archives!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum