openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] boost: allow searching for python310
@ 2021-10-19 12:43 Martin Jansa
  2021-10-19 20:59 ` [OE-core] " Peter Kjellerstedt
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Jansa @ 2021-10-19 12:43 UTC (permalink / raw)
  To: openembedded-core; +Cc: Martin Jansa

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 ....cmake-allow-searching-for-python310.patch | 50 +++++++++++++++++++
 meta/recipes-support/boost/boost_1.77.0.bb    |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch

diff --git a/meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch b/meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch
new file mode 100644
index 0000000000..0a9ee2cc95
--- /dev/null
+++ b/meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch
@@ -0,0 +1,50 @@
+From e193f080c7d209516ac9b712fa0c50bb08026fa2 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 19 Oct 2021 12:24:31 +0000
+Subject: [PATCH] BoostConfig.cmake: allow searching for python310
+
+* accept double digits in Python3_VERSION_MINOR
+
+* if someone is using e.g.:
+  find_package(Python3 REQUIRED)
+  find_package(Boost REQUIRED python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
+
+  with python-3.10 then it currently fails with:
+
+  -- Found PythonLibs: /usr/lib/libpython3.10.so (found version "3.10.0")
+  -- Found Python3: -native/usr/bin/python3-native/python3 (found version "3.10.0") found components: Interpreter
+  CMake Error at /usr/lib/cmake/Boost-1.77.0/BoostConfig.cmake:141 (find_package):
+    Could not find a package configuration file provided by "boost_python310"
+    (requested version 1.77.0) with any of the following names:
+
+      boost_python310Config.cmake
+      boost_python310-config.cmake
+
+    Add the installation prefix of "boost_python310" to CMAKE_PREFIX_PATH or
+    set "boost_python310_DIR" to a directory containing one of the above files.
+    If "boost_python310" provides a separate development package or SDK, be
+    sure it has been installed.
+  Call Stack (most recent call first):
+    /usr/lib/cmake/Boost-1.77.0/BoostConfig.cmake:258 (boost_find_component)
+    /usr/share/cmake-3.21/Modules/FindBoost.cmake:594 (find_package)
+    CMakeLists.txt:18 (find_package)
+
+Upstream-Status: Submitted [https://github.com/boostorg/boost_install/pull/53]
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ tools/boost_install/BoostConfig.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/boost_install/BoostConfig.cmake b/tools/boost_install/BoostConfig.cmake
+index fd17821..5dffa58 100644
+--- a/tools/boost_install/BoostConfig.cmake
++++ b/tools/boost_install/BoostConfig.cmake
+@@ -113,7 +113,7 @@ macro(boost_find_component comp required quiet)
+     set(_BOOST_REQUIRED REQUIRED)
+   endif()
+ 
+-  if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$")
++  if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9][0-9]?)$")
+ 
+     # handle pythonXY and numpyXY versioned components for compatibility
+ 
diff --git a/meta/recipes-support/boost/boost_1.77.0.bb b/meta/recipes-support/boost/boost_1.77.0.bb
index df8e08ad76..ba60281950 100644
--- a/meta/recipes-support/boost/boost_1.77.0.bb
+++ b/meta/recipes-support/boost/boost_1.77.0.bb
@@ -6,4 +6,5 @@ SRC_URI += "file://boost-CVE-2012-2677.patch \
            file://0001-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch \
            file://0001-dont-setup-compiler-flags-m32-m64.patch \
            file://0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch \
+           file://0001-BoostConfig.cmake-allow-searching-for-python310.patch \
            "
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [OE-core] [PATCH] boost: allow searching for python310
  2021-10-19 12:43 [PATCH] boost: allow searching for python310 Martin Jansa
@ 2021-10-19 20:59 ` Peter Kjellerstedt
  2021-10-19 21:15   ` Martin Jansa
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Kjellerstedt @ 2021-10-19 20:59 UTC (permalink / raw)
  To: Martin Jansa, openembedded-core

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Martin Jansa
> Sent: den 19 oktober 2021 14:44
> To: openembedded-core@lists.openembedded.org
> Cc: Martin Jansa <Martin.Jansa@gmail.com>
> Subject: [OE-core] [PATCH] boost: allow searching for python310
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  ....cmake-allow-searching-for-python310.patch | 50 +++++++++++++++++++
>  meta/recipes-support/boost/boost_1.77.0.bb    |  1 +
>  2 files changed, 51 insertions(+)
>  create mode 100644 meta/recipes-support/boost/boost/0001-
> BoostConfig.cmake-allow-searching-for-python310.patch
> 
> diff --git a/meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch b/meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch
> new file mode 100644
> index 0000000000..0a9ee2cc95
> --- /dev/null
> +++ b/meta/recipes-support/boost/boost/0001-BoostConfig.cmake-allow-searching-for-python310.patch
> @@ -0,0 +1,50 @@
> +From e193f080c7d209516ac9b712fa0c50bb08026fa2 Mon Sep 17 00:00:00 2001
> +From: Martin Jansa <Martin.Jansa@gmail.com>
> +Date: Tue, 19 Oct 2021 12:24:31 +0000
> +Subject: [PATCH] BoostConfig.cmake: allow searching for python310
> +
> +* accept double digits in Python3_VERSION_MINOR
> +
> +* if someone is using e.g.:
> +  find_package(Python3 REQUIRED)
> +  find_package(Boost REQUIRED python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
> +
> +  with python-3.10 then it currently fails with:
> +
> +  -- Found PythonLibs: /usr/lib/libpython3.10.so (found version "3.10.0")
> +  -- Found Python3: -native/usr/bin/python3-native/python3 (found version "3.10.0") found components: Interpreter
> +  CMake Error at /usr/lib/cmake/Boost-1.77.0/BoostConfig.cmake:141 (find_package):
> +    Could not find a package configuration file provided by "boost_python310"
> +    (requested version 1.77.0) with any of the following names:
> +
> +      boost_python310Config.cmake
> +      boost_python310-config.cmake
> +
> +    Add the installation prefix of "boost_python310" to CMAKE_PREFIX_PATH or
> +    set "boost_python310_DIR" to a directory containing one of the above files.
> +    If "boost_python310" provides a separate development package or SDK, be
> +    sure it has been installed.
> +  Call Stack (most recent call first):
> +    /usr/lib/cmake/Boost-1.77.0/BoostConfig.cmake:258 (boost_find_component)
> +    /usr/share/cmake-3.21/Modules/FindBoost.cmake:594 (find_package)
> +    CMakeLists.txt:18 (find_package)
> +
> +Upstream-Status: Submitted [https://github.com/boostorg/boost_install/pull/53]
> +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> +---
> + tools/boost_install/BoostConfig.cmake | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/tools/boost_install/BoostConfig.cmake b/tools/boost_install/BoostConfig.cmake
> +index fd17821..5dffa58 100644
> +--- a/tools/boost_install/BoostConfig.cmake
> ++++ b/tools/boost_install/BoostConfig.cmake
> +@@ -113,7 +113,7 @@ macro(boost_find_component comp required quiet)
> +     set(_BOOST_REQUIRED REQUIRED)
> +   endif()
> +
> +-  if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$")
> ++  if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9][0-9]?)$")

Why not make that:

  if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9]+)$")

or we will have the same problem when Python 3.100 comes around. ;)
Though I guess things will get interesting at version 10.0 as well...

> +
> +     # handle pythonXY and numpyXY versioned components for compatibility
> +
> diff --git a/meta/recipes-support/boost/boost_1.77.0.bb b/meta/recipes-support/boost/boost_1.77.0.bb
> index df8e08ad76..ba60281950 100644
> --- a/meta/recipes-support/boost/boost_1.77.0.bb
> +++ b/meta/recipes-support/boost/boost_1.77.0.bb
> @@ -6,4 +6,5 @@ SRC_URI += "file://boost-CVE-2012-2677.patch \
>             file://0001-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch \
>             file://0001-dont-setup-compiler-flags-m32-m64.patch \
>             file://0001-fiber-libs-Define-SYS_futex-if-it-does-not-exist.patch \
> +           file://0001-BoostConfig.cmake-allow-searching-for-python310.patch \
>             "
> --
> 2.32.0

//Peter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] boost: allow searching for python310
  2021-10-19 20:59 ` [OE-core] " Peter Kjellerstedt
@ 2021-10-19 21:15   ` Martin Jansa
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Jansa @ 2021-10-19 21:15 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

On Tue, Oct 19, 2021 at 10:59 PM Peter Kjellerstedt <
peter.kjellerstedt@axis.com> wrote:

> > +
> > +-  if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9])$")
> > ++  if("${comp}" MATCHES
> "^(python|numpy|mpi_python)([1-9])([0-9][0-9]?)$")
>
> Why not make that:
>
>   if("${comp}" MATCHES "^(python|numpy|mpi_python)([1-9])([0-9]+)$")
>
> or we will have the same problem when Python 3.100 comes around. ;)
> Though I guess things will get interesting at version 10.0 as well...
>

It was already merged upstream, if you want to improve it, you should
probably start there.

and similar regexp unfortunately isn't only in boost, I've found couple
recipes failing in similar fashion or installing their files to
/usr/lib/python3.1 because who cares about 2 digit minor versions..

Most of these functions will fail in various ways with python-4 already and
we can only hope that python-2 support will be completely gone before that
:).

Cheers,

[-- Attachment #2: Type: text/html, Size: 1426 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-19 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 12:43 [PATCH] boost: allow searching for python310 Martin Jansa
2021-10-19 20:59 ` [OE-core] " Peter Kjellerstedt
2021-10-19 21:15   ` Martin Jansa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).