On 11/18/18 6:51 PM, Rich Freeman wrote: > On Sun, Nov 18, 2018 at 5:40 PM Zac Medico wrote: >> >> On 11/18/18 1:55 PM, Rich Freeman wrote: >>> >>> My idea is to basically have portage generate a tag with all the info >>> needed to identify the "right" package, take a hash of it, and then >>> stick that in the filename. Then when portage is looking for a binary >>> package to use at install time it generates the same tag using the >>> same algorithm and looks for a matching hash. >> >> We've already had this handled for a couple years now, via >> FEATURES=binpkg-multi-instance. > > According to the make.conf manpage this simply numbers builds. So, if > you build something twice with the same config you end up with two > duplicate files (wasteful). Presumably if you had a large collection > of these packages portage would have to read the metadata within each > one to figure out which one is appropriate to install. That would be > expensive if IO is slow, such as when fetching packages online > on-demand. > > But, it obviously is somewhat of an improvement for Roy's use case. > > IMO using a content-hash of certain metadata would eliminate > duplication, and based on filename alone it would be clear whether the > sought-after binary package exists or not. As with the build numbers > you couldn't tell from filename inspection what packages you have, but > if you know what you want you could immediately find it. IMO trying > to cram all that metadata into a filename to make them more > transparent isn't a good idea, and using hashes lets the user set > their own policy regarding flexibility. Heck, you could auto-gen > symlinks for subsets of metadata (ie, the same file could be linked > from a file that specifies its USE flags but not its CFLAGS, so it > would be found if either an exact hit on CFLAGS was sought or if > CFLAGS were considered unimportant). > > But, I'm certainly not suggesting that you're not allowed to go to bed > until you've built it. :) The existing ${PKGDIR}/Packages file optimizes metadata access for both local an remote access, and performs well for reasonable numbers of packages. If you insist on mixing binary packages in the same ${PKGDIR} for a large number of alternative configurations, then it will not scale unless you create a way to send your local configuration to the server so that it can select the relevant package list for you. However, bear in mind that mixing alternative configurations in the same ${PKGDIR} might lead to undesirable results if there is anything relevant that is unaccounted for in the package metadata. Possible unaccounted things may include: 1) glibc version the package was built against 2) symbols and/or sonames not accounted for by slot operator dependencies 3) soname dependencies (--usepkgonly + --ignore-soname-deps=n handles this) -- Thanks, Zac