Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936949 - net-libs/libqmi net-libs/libmbim pulls in python + gcc unnecessarily
Summary: net-libs/libqmi net-libs/libmbim pulls in python + gcc unnecessarily
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-30 15:31 UTC by Ed Wildgoose
Modified: 2024-10-09 19:56 UTC (History)
4 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 Ed Wildgoose 2024-07-30 15:31:21 UTC
Latest ebuilds for libqmi/libmbin are unconditionally turning on the "introspective" compile flag, which then requires RDEP on dev-libs/gobject-introspection, which in turn pulls in python and in turn pulls in a whole tool chain including gcc

I use gentoo for building IOT builds and here we want a slim install, certainly without gcc and a whole tool chain. Adding a cellular modem to an IOT build is a common situation.

Please put the use of introspection behind a USE flag so that it can be made optional and not mandatory. I can provide a patch if required (what USE flag to use though? "introspection"?)

Reproducible: Always
Comment 1 Ed Wildgoose 2024-07-30 15:32:59 UTC
Apologies, I should have been more specific on ebuild versions. This is a new change of behaviour starting in:

net-libs/libmbim-1.28.4
net-libs/libqmi-1.30.8
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-30 15:56:47 UTC
Not saying this is necessarily the case here, but please keep in mind that upstreams generally consider making introspection optional as something they want to phase out.

I'm curious as to why it drags in Python and GCC at runtime for you (as opposed to build dependencies).

Anyway, not its maintainer, so we'll see.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-30 15:57:13 UTC
> Please put the use of introspection behind a USE flag so that it can be made optional and not mandatory. I can provide a patch if required (what USE flag to use though? "introspection"?)

Yeah, USE=introspection, as is the case elsewhere.

For my own curiosity, would you mind showing me emerge --tree output?
Comment 4 Ed Wildgoose 2024-07-30 16:09:47 UTC
(In reply to Sam James from comment #2)
> Not saying this is necessarily the case here, but please keep in mind that
> upstreams generally consider making introspection optional as something they
> want to phase out.

Fair point. Apologies if the title came across as confrontational

 
> I'm curious as to why it drags in Python and GCC at runtime for you (as
> opposed to build dependencies).

So what is happening is that the dependency added is:
dev-libs/gobject-introspection/gobject-introspection

This in turn has:

RDEPEND="
    >=dev-libs/gobject-introspection-common-${PV}
    >=dev-libs/glib-2.$(($(ver_cut 2) - 1)).0:2
    dev-libs/libffi:=
    $(python_gen_cond_dep '
        dev-python/setuptools[${PYTHON_USEDEP}]
    ' 3.12)
    doctool? (
        $(python_gen_cond_dep '
            dev-python/mako[${PYTHON_USEDEP}]
            dev-python/markdown[${PYTHON_USEDEP}]
        ')
    )
    virtual/pkgconfig
    ${PYTHON_DEPS}
"

So possibly I'm pointing the finger at the wrong package? Do we need python in RDEPs for gobject-introspection?

Note my preference would still be to make this dependency optional as we are always fighting to get builds as tiny as possible for embedded devices. Sadly the whole rootfs is now larger than the 8MB I desire, but I still want to avoid pulling in as many extra KBs as I can

Does this also answer the --tree point?
Comment 5 Ed Wildgoose 2024-10-08 17:52:42 UTC
Hi, I'm stuck in limbo on this one. I need to mask newer libmbim due to it pulling in the entirety of python to my embedded build. However, the older ebuild has a not up to date PYTHON_COMPAT, which causes some issues on my build machine as I now need python 3.11 + 3.12 around

Could I please request that the python dependency is softened to either be behind an introspective flag, or some other solution?  Note the same issue occurs on libqmi
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-08 18:10:21 UTC
In the meantime, I'll update PYTHON_COMPAT in 1.26.4.

The port to Meson was done in:

commit d26c72d36cfa28a035d89a9efdf7182e6351544c
Author: Pacho Ramos <pacho@gentoo.org>
Date:   Sat Jul 29 13:47:00 2023 +0200

    net-libs/libmbim: add 1.28.4

    Thanks-to: Matt Turner
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>

I don't know if there was a strong reason to not make introspection conditional. If there isn't, we can add USE=introspection there.

pacho, matt?
Comment 7 Larry the Git Cow gentoo-dev 2024-10-08 18:12:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d63293832cfc364734746bdd2cc61944ae6e71c

commit 1d63293832cfc364734746bdd2cc61944ae6e71c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-10-08 18:11:22 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-10-08 18:11:22 +0000

    net-libs/libmbim: enable py3.12, py3.13 for 1.26.4
    
    To make it easier for users while we figure out introspection for 1.28.4.
    
    Bug: https://bugs.gentoo.org/936949
    Signed-off-by: Sam James <sam@gentoo.org>

 net-libs/libmbim/libmbim-1.26.4.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 8 Matt Turner gentoo-dev 2024-10-08 22:24:23 UTC
I don't have any memory specifically about this package and introspection.

I suspect, if anything, it was made non-optional only because there didn't seem to be a reason to make it optional.
Comment 9 Ed Wildgoose 2024-10-09 07:39:01 UTC
I would be very grateful if we could have both libmbim and libqmi (and really any other packages which are optional on dev-libs/gobject-introspection), have this protected behind the "introspection" flag (which seems to be a common idiom)

This helps me build small containers (for embedded) without pulling in python.

Thanks!
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-09 07:48:23 UTC
I'll look at that today given Matt's comment.
Comment 11 Larry the Git Cow gentoo-dev 2024-10-09 08:23:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37a69f6f9e9e4cb65b26632a1aeee33c2a86ccba

commit 37a69f6f9e9e4cb65b26632a1aeee33c2a86ccba
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-10-09 08:20:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-10-09 08:20:32 +0000

    net-libs/libmbim: make introspection optional
    
    This is useful for embedded environments that want a small image.
    
    Closes: https://bugs.gentoo.org/936949
    Signed-off-by: Sam James <sam@gentoo.org>

 net-libs/libmbim/libmbim-1.28.4-r1.ebuild | 44 +++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7f004736df522df022d1e38800b8f3e22a7909a9

commit 7f004736df522df022d1e38800b8f3e22a7909a9
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-10-09 08:18:44 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-10-09 08:18:44 +0000

    net-libs/libqmi: make introspection optional again, style tweaks
    
    * Make introspection optional again as unconditionally depending on it
      is problematic for embedded use as it drags in Python as well.
    
      This was the case before the Meson port in d26c72d36cfa28a035d89a9efdf7182e6351544c.
    
    * Style tweaks (just variable order bits which are IMO unobjectionable).
    
    Bug: https://bugs.gentoo.org/936949
    Signed-off-by: Sam James <sam@gentoo.org>

 net-libs/libqmi/libqmi-1.32.4-r1.ebuild | 59 +++++++++++++++++++++++++++++++++
 net-libs/libqmi/libqmi-9999.ebuild      | 16 ++++-----
 2 files changed, 66 insertions(+), 9 deletions(-)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-09 13:54:28 UTC
Ed, when you get a chance, could you confirm it's OK?
Comment 13 Ed Wildgoose 2024-10-09 19:56:47 UTC
Thanks so much folks! Such a great response

OK, I just pulled latest and retested and I can confirm this seems to work as desired. Python isn't pulled in. I haven't actually tested the libs function mind (tomorrow), however, it looks good so far!

Appreciated!