Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938948 - [Future EAPI] compile-time binding version specifiers, similar to SLOT dependencies
Summary: [Future EAPI] compile-time binding version specifiers, similar to SLOT depend...
Status: CONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Package Manager Specification
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: future-eapi 598525
  Show dependency tree
 
Reported: 2024-09-02 22:03 UTC by Eli Schwartz
Modified: 2025-01-03 02:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.