• Re: Bug#1088262: python-apt: ImportError: /usr/lib/python3/dist-package

    From Julian Andres Klode@21:1/5 to All on Tue Nov 26 21:20:01 2024
    On Mon, Nov 25, 2024 at 06:59:49PM -0800, Otto Kekäläinen wrote:
    Source: python-apt
    Version: 2.9.1
    Severity: serious

    Seems the latest version of python-apt has some serious regressions as https://tracker.debian.org/pkg/python-apt shows wide-spread
    autopkgtest failures.

    In a clean Debian unstable container a simple installation is failing with:

    Hit:1 http://deb.debian.org/debian sid InRelease
    Get:2 http://deb.debian.org/debian sid/main all Contents (deb) [43.5 MB] Get:3 http://deb.debian.org/debian sid/main amd64 Contents (deb) [15.8 MB] Traceback (most recent call last):
    File "/usr/lib/cnf-update-db", line 3, in <module>
    import apt_pkg
    ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-312-x86_64-linux-gnu.so:
    undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm, version APTPKG_6.0
    Fetched 59.3 MB in 13s (4620 kB/s)
    Reading package lists...
    E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e
    /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
    E: Sub-process returned an error code
    Error: error building at STEP "RUN apt-get install -q --yes
    command-not-found && apt-get update -q": error while running
    runtime: exit status 100
    Please take a look what is going on.

    It seems to be an issue in symbols; the shlibs get set to

    libapt-pkg6.0t64 >= 2.7.11

    but the symbol is not present in the outdated container (2.9.4
    is what my debian:unstable OCI comes with). Upgrading libapt-pkg6.0t64
    to 2.9.14 fixes the issue.

    But noticably, we can check our symbols file for apt:

    $ grep "_M_replace" debian/libapt-pkg6.0t64.symbols

    It's empty, so the dependency should have been generated against
    the latest version if anything.

    Or rather the problem here is that we are linking this in the
    first place, inline functions should be resolved locally, they
    are hidden in APT.

    I wonder if toolchain people/doko has a clue, because I don't.
    The way we built APT is:

    -fvisibility=hidden -fvisibility-inlines-hidden

    and a linker script:

    $ cat obj-x86_64-linux-gnu/apt-pkg/apt-pkg.versionscript
    APTPKG_6.0 {global: *; };

    to tag all our symbols.
    --
    debian developer - deb.li/jak | jak-linux.org - free software dev
    ubuntu core developer i speak de, en

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)