diff mbox series

[4/6] rpm: handle CMake Python paths in do_configure

Message ID 20251204180945.3112334-5-tgamblin@baylibre.com
State New
Headers show
Series python3: upgrade to 3.14.0 | expand

Commit Message

Trevor Gamblin Dec. 4, 2025, 6:09 p.m. UTC
With the Python 3.14.0 upgrade, rpm is finding the wrong paths with
CMake, leading to a QA issue for files that we have listed in FILES
already:

|ERROR: QA Issue: rpm: Files/directories were installed but not shipped in any package:
|  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm-4.20.1-py3.14.egg-info
|  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm/_rpm.so
|  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm/transaction.py
|  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm/__init__.py
|Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
|rpm: 4 installed and not shipped files. [installed-vs-shipped]

Add a do_configure:prepend() step to make sure the right ones are found.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
---
 meta/recipes-devtools/rpm/rpm_4.20.1.bb | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Alexander Kanavin Dec. 5, 2025, 11:16 a.m. UTC | #1
On Thu, 4 Dec 2025 at 19:10, Trevor Gamblin via lists.openembedded.org
<tgamblin=baylibre.com@lists.openembedded.org> wrote:
>
> With the Python 3.14.0 upgrade, rpm is finding the wrong paths with
> CMake, leading to a QA issue for files that we have listed in FILES
> already:
>
> |ERROR: QA Issue: rpm: Files/directories were installed but not shipped in any package:
> |  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm-4.20.1-py3.14.egg-info
> |  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm/_rpm.so
> |  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm/transaction.py
> |  /home/tgamblin/workspace/yocto/openembedded-core/build/tmp/work/x86-64-v3-poky-linux/rpm/4.20.1/recipe-sysroot-native/usr/lib/python3.14/site-packages/rpm/__init__.py
> |Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
> |rpm: 4 installed and not shipped files. [installed-vs-shipped]
>
> Add a do_configure:prepend() step to make sure the right ones are found.
...
> +do_configure:prepend() {
> +    # Force CMake to use target Python paths, not native
> +    sed -i 's|${Python3_SITEARCH}|${PYTHON_SITEPACKAGES_DIR}|g' ${S}/python/CMakeLists.txt
> +}
> +

This kind of tweak should be done with a proper patch.

But before that, it would be good to investigate why the correct value
was returned before and now it is not: even if we work around it in
oe-core like this, the issue may pop up in other layers too. It's
possible something needs to be fixed in python recipe still.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rpm/rpm_4.20.1.bb b/meta/recipes-devtools/rpm/rpm_4.20.1.bb
index ba967ec1fa..8aa63def61 100644
--- a/meta/recipes-devtools/rpm/rpm_4.20.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.20.1.bb
@@ -101,6 +101,11 @@  WRAPPER_TOOLS = " \
 
 base_bindir_progs = "sed tar rm mv mkdir cp cat chown chmod gzip grep"
 
+do_configure:prepend() {
+    # Force CMake to use target Python paths, not native
+    sed -i 's|${Python3_SITEARCH}|${PYTHON_SITEPACKAGES_DIR}|g' ${S}/python/CMakeLists.txt
+}
+
 do_install:append:class-native() {
         for tool in ${WRAPPER_TOOLS}; do
                 test -x ${D}$tool && create_wrapper ${D}$tool \