All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: Martin Jansa <Martin.Jansa@gmail.com>
Subject: [meta-oe][mickledore][PATCH 14/16] nanopb: fix installed-vs-shipped with multilib
Date: Tue,  9 May 2023 09:06:53 +0200	[thread overview]
Message-ID: <20230509070655.70784-14-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <20230509070655.70784-1-Martin.Jansa@gmail.com>

* fixes:
  ERROR: QA Issue: nanopb: Files/directories were installed but not shipped in any package:
    /usr/lib
    /usr/lib/python3.11
    /usr/lib/python3.11/site-packages
    /usr/lib/python3.11/site-packages/proto
    /usr/lib/python3.11/site-packages/proto/nanopb_pb2.py
    /usr/lib/python3.11/site-packages/proto/nanopb.proto
    /usr/lib/python3.11/site-packages/proto/_utils.py
  Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
  nanopb: 7 installed and not shipped files. [installed-vs-shipped]

when libdir is /usr/lib64 with multilib.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 ...llow-to-set-PYTHON_INSTDIR-from-outs.patch | 67 +++++++++++++++++++
 .../recipes-devtools/nanopb/nanopb_0.4.7.bb   |  6 +-
 2 files changed, 72 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb/0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch

diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb/0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb/0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch
new file mode 100644
index 0000000000..474f0f1584
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb/0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch
@@ -0,0 +1,67 @@
+From 30c79d1b49839a15c05a0d0ca7e54787cd7988c6 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 4 May 2023 07:17:57 +0000
+Subject: [PATCH] CMakeLists.txt: allow to set PYTHON_INSTDIR from outside
+
+CMakeLists.txt used:
+
+find_package(Python REQUIRED COMPONENTS Interpreter)
+execute_process(
+    COMMAND ${Python_EXECUTABLE} -c
+        "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
+    OUTPUT_VARIABLE PYTHON_INSTDIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+but with python3native this returns:
+
+nanopb/0.4.7-r0/git $ ../recipe-sysroot-native/usr/bin/python3-native/python3 -c "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
+lib/python3.11/site-packages
+
+which doesn't respect target libdir which might be lib64 with multilib and with python3targetconfig
+it also doesn't work right because of the long relative path:
+
+nanopb/0.4.7-r0/build $ ../recipe-sysroot-native/usr/bin/python3-native/python3 -c "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
+../../../../../../../../../../../../usr/lib64/python3.11/site-packages
+
+CMake Error at cmake_install.cmake:46 (file):
+  file cannot create directory:
+  /OE/lge/build/starfish/nanbield/BUILD/work/o22-starfish-linux/nanopb/0.4.7-r0/image/usr/../../../../../../../../../../../../usr/lib64/python3.11/site-packages/proto.
+  Maybe need administrative privileges.
+
+Let CMake variable to be passed from the recipe to avoid this as we're already using
+${D}${PYTHON_SITEPACKAGES_DIR} in do_install:append anyway.
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Upstream-Status: Pending
+---
+ CMakeLists.txt | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8d241c5..7d3f993 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,13 +39,15 @@ if(NOT DEFINED CMAKE_INSTALL_CMAKEDIR)
+     set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/nanopb")
+ endif()
+ 
+-find_package(Python REQUIRED COMPONENTS Interpreter)
+-execute_process(
+-    COMMAND ${Python_EXECUTABLE} -c
+-        "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
+-    OUTPUT_VARIABLE PYTHON_INSTDIR
+-    OUTPUT_STRIP_TRAILING_WHITESPACE
+-)
++if(NOT DEFINED PYTHON_INSTDIR)
++    find_package(Python REQUIRED COMPONENTS Interpreter)
++    execute_process(
++        COMMAND ${Python_EXECUTABLE} -c
++            "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))"
++        OUTPUT_VARIABLE PYTHON_INSTDIR
++        OUTPUT_STRIP_TRAILING_WHITESPACE
++    )
++endif()
+ 
+ if(nanopb_BUILD_GENERATOR)
+     set(generator_protos nanopb)
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.7.bb b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.7.bb
index 897caea2a7..9ad558146c 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.7.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-devtools/nanopb/nanopb_0.4.7.bb
@@ -4,13 +4,17 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f"
 
 DEPENDS = "protobuf-native"
 
-SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https"
+SRC_URI = "git://github.com/nanopb/nanopb.git;branch=master;protocol=https \
+    file://0001-CMakeLists.txt-allow-to-set-PYTHON_INSTDIR-from-outs.patch \
+"
 SRCREV = "b97aa657a706d3ba4a9a6ccca7043c9d6fe41cba"
 
 S = "${WORKDIR}/git"
 
 inherit cmake python3native
 
+EXTRA_OECMAKE += "-DPYTHON_INSTDIR=${PYTHON_SITEPACKAGES_DIR}"
+
 do_install:append() {
     install -Dm 0755 ${S}/generator/nanopb_generator.py ${D}${bindir}/nanopb_generator.py
     install -Dm 0755 ${S}/generator/protoc-gen-nanopb ${D}${bindir}/protoc-gen-nanopb
-- 
2.40.1



  parent reply	other threads:[~2023-05-09  7:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  7:06 [meta-oe][mickledore][PATCH 01/16] lirc: fix do_install with multilib Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 02/16] dleyna-{server,renderer}: fix dev-so QA issue " Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 03/16] libreport: add dependency on libarchive Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 04/16] libxmlb: add missing dependency on glib-2.0 and xz Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 05/16] geoclue: fix build without gobject-introspection-data Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 06/16] appstream: " Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 07/16] ostree: " Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 08/16] rdfind: fix build with -Werror=return-type Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 09/16] spice-gtk: respect gobject-introspection-data Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 10/16] cpulimit: fix do_install with multilib Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 11/16] libnfs: fix installed-vs-shipped issues " Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 12/16] btrfsmaintenance: install to ${datadir}/${BPN} Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 13/16] libtomcrypt: pass LIBPATH to fix installed-vs-shipped with multilib Martin Jansa
2023-05-09  7:06 ` Martin Jansa [this message]
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 15/16] nv-codec-headers: " Martin Jansa
2023-05-09  7:06 ` [meta-oe][mickledore][PATCH 16/16] zfs: fix installation paths for multilib Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230509070655.70784-14-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.