Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 938948

Summary: [Future EAPI] compile-time binding version specifiers, similar to SLOT dependencies
Product: Gentoo Hosted Projects Reporter: Eli Schwartz <eschwartz>
Component: PMS/EAPIAssignee: Package Manager Specification <pms>
Status: CONFIRMED ---    
Severity: normal CC: esigra, leio, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=753500
https://bugs.gentoo.org/show_bug.cgi?id=920097
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380, 598525    

Description Eli Schwartz gentoo-dev 2024-09-02 22:03:27 UTC
Binding to a slot at compile time is currently possible, and explicitly carved out as an exception to metadata invariance. You can depend on cat/pkg:= and the PM looks up the satisfied version at compile time and bakes it into the metadata.

It would be nice to be able to do this for versions as well. The flagship use case is something portage currently does as a non-portable hack: it injects >=sys-libs/glibc-${VERSION_AT_BUILD_TIME} into binary packages. It is useful because glibc adds new symbols on every version upgrade and recompiling software can arbitrarily use the new version of the symbol. Upgrading glibc is safe, but downgrading it is not. This mechanism guarantees that packages always depend on *at least* the version of glibc they were compiled using.

Other packages could take advantage of this too. For example, leio notes that plenty of software does e.g. #if GLIB_CHECK_VERSION (2, 80, 0).

This isn't something that (beyond glibc) makes a lot of sense IMO as a general quirk for all packages, as it would delete the notion of being able to downgrade packages, for which there are many use cases. Rather, packages which contain this sort of conditional compile-time logic should be able to opt in.