Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 753500 - sys-apps/portage: support dynamic symbol version dependencies (like for glibc magic compat symbols)
Summary: sys-apps/portage: support dynamic symbol version dependencies (like for glibc...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All All
: Normal normal with 2 votes (vote)
Assignee: Portage team
URL: https://developers.redhat.com/blog/20...
Whiteboard:
Keywords:
: 636914 802303 913956 (view as bug list)
Depends on:
Blocks: 155723 782817
  Show dependency tree
 
Reported: 2020-11-07 18:25 UTC by Zac Medico
Modified: 2024-03-03 22:25 UTC (History)
14 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 Zac Medico gentoo-dev 2020-11-07 18:25:34 UTC
Since a binary package will not work unless the required versions of glibc magic compat symbols are available, it would be nice to track these as dynamic symbol version dependencies in a way similar to how we already track soname dependencies.
Comment 1 Mike Gilbert gentoo-dev 2021-07-15 18:31:16 UTC
*** Bug 802303 has been marked as a duplicate of this bug. ***
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-07-27 22:54:38 UTC
Is glibc's symbol versioning special here? Any symbol addition into the library should have similar semantics.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-27 01:39:34 UTC
*** Bug 636914 has been marked as a duplicate of this bug. ***
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-16 01:57:57 UTC
A hack would be to just force implicit >= deps on glibc at least (where elibc_glibc) as glibc is the main one that's fatal here for new versions.
Comment 5 Zac Medico gentoo-dev 2022-01-16 02:21:39 UTC
(In reply to Sam James from comment #4)
> A hack would be to just force implicit >= deps on glibc at least (where
> elibc_glibc) as glibc is the main one that's fatal here for new versions.

We have a hack in emerge that makes it try to install virtual/os-headers and virtual/libc at the earliest opportunity.
Comment 6 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-01-16 19:35:50 UTC
(In reply to Zac Medico from comment #5)
> (In reply to Sam James from comment #4)
> > A hack would be to just force implicit >= deps on glibc at least (where
> > elibc_glibc) as glibc is the main one that's fatal here for new versions.
> 
> We have a hack in emerge that makes it try to install virtual/os-headers and
> virtual/libc at the earliest opportunity.

If I understand correctly, that solves the ordering problem, but wouldn't solve the problem of a stable system trying to use binary packages that need unstable glibc.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-04 16:15:08 UTC
(In reply to Sam James from comment #4)
> A hack would be to just force implicit >= deps on glibc at least (where
> elibc_glibc) as glibc is the main one that's fatal here for new versions.

Let's cover this in (the newly-filed) bug 913628.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-10 21:41:46 UTC
*** Bug 913956 has been marked as a duplicate of this bug. ***
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-10 21:42:15 UTC
ftr bug 913628 is the thing being actively worked on
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-10 22:00:32 UTC
*** Bug 913956 has been marked as a duplicate of this bug. ***
Comment 11 Larry the Git Cow gentoo-dev 2023-12-10 22:01:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=af550b8b5cb91f27b26d6800c3b4cdd2d86a46e6

commit af550b8b5cb91f27b26d6800c3b4cdd2d86a46e6
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-09-04 15:38:18 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-10 22:01:48 +0000

    ebuild: inject implicit libc RDEPEND
    
    Inject >=${LIBC_PROVIDER}-${VERSION_OF_LIBC_PROVIDER} into RDEPEND.
    
    We already try to upgrade the virtual/libc provider and its deps aggressively
    but that's not so helpful if there's a binpkg for, say, one of its deps available
    built against a newer glibc - which ends up breaking the system because our
    glibc isn't new enough (symbol versioning).
    
    This is a long-standing problem for binpkg users and one of the last showstoppers
    for being able to use them reliably.
    
    Note that this applies to source installs too, although it matters less there;
    it'll make downgrading libc a bit harder for people who want to do that, but users
    are already prevented from doing that (pkg_* check) for glibc, and I don't really
    see it as a bad thing to effectively propagate this to other libcs.
    
    To fully solve the problem, we should arguably do at least one of the following:
    1) Implicit >= on anything (not just libc) which installs ELF (at least a PROVIDES);
    2) Implement the suggestion in bug #753500 based on analysis of used versioned symbols (*).
    
    But libc is really the critical one and the one where things explode pretty badly,
    especially combined with us trying to Do The Right Thing for non-binpkg cases
    (aggressively upgrading libc before anything else). The other cases don't matter
    so much as they get upgraded later and by that point, the library is usually done.
    
    (It's not really clear if downgrading musl works and even if it is supported,
    I'm not really sure it's a supported case at all, so I'm not bothering to carve
    out an exception here. It'd make this far less elegant and I don't see any benefit
    to doing so.)
    
    (*) util-linux is one of the examples I have in mind here as justification
    for either point.
    
    Bug: https://bugs.gentoo.org/753500
    Bug: https://bugs.gentoo.org/913628
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/_emerge/actions.py                           |   7 +-
 lib/_emerge/depgraph.py                          |  22 +
 lib/portage/dep/__init__.py                      |  23 +-
 lib/portage/dep/libc.py                          |  83 ++++
 lib/portage/dep/meson.build                      |   1 +
 lib/portage/package/ebuild/doebuild.py           |  56 ++-
 lib/portage/tests/dep/meson.build                |   1 +
 lib/portage/tests/dep/test_libc.py               |  81 ++++
 lib/portage/tests/emerge/meson.build             |   1 +
 lib/portage/tests/emerge/test_actions.py         |  23 +-
 lib/portage/tests/emerge/test_libc_dep_inject.py | 551 +++++++++++++++++++++++
 11 files changed, 831 insertions(+), 18 deletions(-)