• Re: Help with Lintian error in python3 (pybind11-wrapped) package

    From Andrey Rakhmatullin@21:1/5 to JOSE LUIS BLANCO CLARACO on Mon Jul 10 11:10:01 2023
    On Mon, Jul 10, 2023 at 01:19:38AM -0700, JOSE LUIS BLANCO CLARACO wrote:
    [2]. I attach the output of "dpkg -I" for the final binary package, where
    the "Depends: python3" is visible
    No, as it says "phyton3".

    (I would also expect that using appropriate substvars here is better than writing deps manually)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Jos=C3=A9_Luis_Blanco=2DC@21:1/5 to gregoa@debian.org on Mon Jul 10 11:10:01 2023
    On Mon, Jul 10, 2023 at 11:02 AM gregor herrmann <gregoa@debian.org> wrote:
    phyton3 != python3
    :)

    hahaha, I knew more eyeballs would be helpful!

    Thanks a lot, Gregor, that solves the mystery :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Jos=C3=A9_Luis_Blanco=2DC@21:1/5 to wrar@wrar.name on Mon Jul 10 11:30:01 2023
    On Mon, Jul 10, 2023 at 11:09 AM Andrey Rakhmatullin <wrar@wrar.name> wrote:
    No, as it says "phyton3".
    (I would also expect that using appropriate substvars here is better than writing deps manually)

    I know, and added ${python3:Depends} and ${shlibs:Depends}, but
    "dh-python" seems not to add any substvars, and "shlibs" does neither.

    In fact, the "so" module built from the pybind11 wrapper seems not to
    list any python library in "ldd", which also puzzled me:

    ldd mrpt/pymrpt.cpython-310-x86_64-linux-gnu.so | grep py
    libsnappy.so.1 => /lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007facb732d000)

    but the module loads perfectly from python3 scripts/interpreter, etc.
    I checked that other "*cpython.so" modules out there indeed list "libpython3.xxx.so" in their "ldd".
    I understand this is what is preventing "shlibs" to automatically list
    python3 as a substvar, but don't know how to fix it.

    This is my first python3 package, so I don't feel confident about how
    things should work.
    Neither found an equivalent pybind11-based wrapper packaged in Debian
    for reference, so any further pointers would be appreciated!.

    JL

    --

    /**
    * Jose Luis Blanco-Claraco
    * Universidad de Almería - Departamento de Ingeniería
    * [Homepage]( https://w3.ual.es/~jlblanco/ )
    * [GH profile]( https://github.com/jlblancoc )
    */

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gregor herrmann@21:1/5 to JOSE LUIS BLANCO CLARACO on Mon Jul 10 11:30:01 2023
    On Mon, 10 Jul 2023 01:19:38 -0700, JOSE LUIS BLANCO CLARACO wrote:

    I attach the output of "dpkg -I" for the final binary package, where
    the "Depends: python3" is visible,

    Copied from the attached file:

    Depends: phyton3

    phyton3 != python3
    :)


    Cheers,
    gregor

    --
    .''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
    : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
    `. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
    `- BOFH excuse #193: Did you pay the new Support Fee?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rakhmatullin@21:1/5 to All on Mon Jul 10 15:00:01 2023
    On Mon, Jul 10, 2023 at 11:22:05AM +0200, José Luis Blanco-Claraco wrote:
    On Mon, Jul 10, 2023 at 11:09 AM Andrey Rakhmatullin <wrar@wrar.name> wrote:
    No, as it says "phyton3".
    (I would also expect that using appropriate substvars here is better than writing deps manually)

    I know, and added ${python3:Depends} and ${shlibs:Depends}, but
    "dh-python" seems not to add any substvars, and "shlibs" does neither.
    shlibs:Depends is indeed irrelevant here.
    python3:Depends being empty is a problem that needs to be fixed. I've
    built the package and it lacks postinst/prerm so I guess dh_python3 didn't
    find any modules in the package. I also see that the package is named python3-pymrpt while the top-level module is named myrpt, though I don't
    know if this can cause any problems beside the autopkgtest not working.

    In fact, the "so" module built from the pybind11 wrapper seems not to
    list any python library in "ldd", which also puzzled me:

    ldd mrpt/pymrpt.cpython-310-x86_64-linux-gnu.so | grep py
    libsnappy.so.1 => /lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007facb732d000)
    Python extensions indeed don't need to link libpython, which is (mostly?)
    for embedding the interpreter, as extensions are loaded into an
    interpreter themselves.

    I checked that other "*cpython.so" modules out there indeed list "libpython3.xxx.so" in their "ldd".
    (I've checked two random extensiopns and they don't)

    I understand this is what is preventing "shlibs" to automatically list python3 as a substvar, but don't know how to fix it.
    It's not, and shlibs:Depends won't list python3 anyway.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rakhmatullin@21:1/5 to All on Mon Jul 10 17:50:01 2023
    On Mon, Jul 10, 2023 at 05:11:39PM +0200, José Luis Blanco-Claraco wrote:
    Thanks a lot, Andrey, for the time analyzing the problems here, and
    for the clarifications. I thought libpython was like "libc" for
    python...
    It is, but as extensions are loadable plugins, they are fine with symbols
    being provided by the executable instead of linking a library. If you
    check you will see that Py* symbols in the extensions are unresolved and
    that /usr/bin/python3 exports them.

    So the main issue seems to be dh_python3 not recognizing the package
    as "python"...
    I attach the list of files and directories of the latest package
    version just in case it's easy to spot problems from it (the
    "__pycache__" are there for a test Ubuntu build, but are not in the
    Debian build).
    TBH I don't think it's about the file list (though it's possible).

    Note that I want to ship:
    - A cpython .so module + its .pyi stubs.
    - The corresponding py.typed file, which I understand is recommended/mandatory when shipping .pyi stubs.
    - Pure python scripts (right now, only "ros_bridge.py").

    At present, I put everything under
    "/usr/lib/python3/dist-packages/mrpt/" so everything is together, not "polluting" the "dist-packages" directory.
    I don't think this makes sense. You should put them wherever the upstream
    puts them so that the module can be imported (and scripts can be run) in
    the way that is documented and expected by users.

    Maybe the package should be named "python3-mrpt" instead?
    It should always be named for its top-level importable module, see https://www.debian.org/doc/packaging-manuals/python-policy/index.html#module-package-names

    Any way to test dh_python3 manually? Perhaps just build the package
    locally and run dh_python3 from the pkg root directory?
    Yes. And you should run it in the verbose mode.

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