Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: guillaume.bressaix@gmail.com
Cc: buildroot@busybox.net
Subject: Re: [Buildroot] [PATCH v2 1/2] package/python-pybind: fix upgrade to version 2.6.1
Date: Mon, 6 Dec 2021 22:57:30 +0100	[thread overview]
Message-ID: <20211206215730.GE2603@scaer> (raw)
In-Reply-To: <20211206193109.21218-1-guillaume.bressaix@gmail.com>

Guillaume, All,

On 2021-12-06 20:31 +0100, guillaume.bressaix@gmail.com spake thusly:
> From: "Guillaume W. Bres" <guillaume.bressaix@gmail.com>
> 
> The python 'setup.py' script needs header files
> in $(@D)/pybind11 to work since v2.6.1, and these
> files are generated by an internal minimalist cmake build.
> 
> Fixes
>    http://autobuild.buildroot.net/results/b89f1de64b308dffa73675f1f31ccb0b7be5a10d
>    http://autobuild.buildroot.net/results/d0287b7f64f206b0f074908c5780a3632e0cb799
>    http://autobuild.buildroot.net/results/27efb545a5a719a5581c8f746d3a3555ff4216ce
>    http://autobuild.buildroot.net/results/d2f0a0ad8f6c7178517df109e7d885dac9134c3a
>    http://autobuild.buildroot.net/results/b57e9a3279260dae4a590f9421238fcabb2f7cab
>    http://autobuild.buildroot.net/results/515e6f2fc6b5780260d98d6bb52b541ce4bf1afe
>    http://autobuild.buildroot.net/results/d89c4ecc81222d4f80c951da2232d2e393fa1c69
> 
> Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
> 
> ---
> This remains a python-package.
> 
> 'python setup.py' actually hardcodes a system call to cmake now,
> which seems dirty at first. But if we have a cmake env when they
> do that, the install variables are passed and installation
> is smooth. They probably introduced this call to make setup.py
> self sufficient, as most people install this package from 'pip'.
> 
> ---
>  package/python-pybind/python-pybind.mk | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/package/python-pybind/python-pybind.mk b/package/python-pybind/python-pybind.mk
> index a6a1bdb976..bfd7f6f59a 100644
> --- a/package/python-pybind/python-pybind.mk
> +++ b/package/python-pybind/python-pybind.mk
> @@ -9,5 +9,12 @@ PYTHON_PYBIND_SITE = $(call github,pybind,pybind11,v$(PYTHON_PYBIND_VERSION))
>  PYTHON_PYBIND_LICENSE = BSD-3-Clause
>  PYTHON_PYBIND_LICENSE_FILES = LICENSE
>  PYTHON_PYBIND_SETUP_TYPE = setuptools
> +PYTHON_PYBIND_INSTALL_STAGING = YES
> +
> +# every single 'python setup.py' call actually calls cmake
> +# internally, to populate $(@D)/pybind11 with build requirements.
> +# If we have a host-cmake env at that moment, 
> +# then the final installation paths are properly defined
> +PYTHON_PYBIND_DEPENDENCIES = host-cmake

I am sorry, but I fail to see how this actually fixes things.

As I explained in my previous review, headers are supposed to be in
$(STAGING_DIR)/usr/include/pybind11/. That's at least where they are in
Debian-based distributions;

    $ apt-file search 'pybind11/pybind11.h'
    pybind11-dev: /usr/include/pybind11/pybind11.h

However, with the way pybind is currently packaged, the ehaders end up
in:

    $ sort output/build/python-pybind-2.8.1/.files-list.txt
    python-pybind,./usr/bin/pybind11-config
    [...]
    python-pybind,./usr/lib/python3.9/site-packages/pybind11/include/pybind11/pybind11.h
    [...]

So, those headers will most probably not be found by the compiler.

Also, since pybind is supposed to be a headers'-only library, there is
nothing supposed to go in target, so it should be;

    PYTHON_PYBIND_INSTALL_TARGET = NO

Furthermore, /usr/bin/pybind11-config is a python script which hardcodes
its shabang to #!/usr/bin/python, and this is incorrect:

  1. /usr/bin/python might be python2 or python3, we can't know
  2. anyway, it would not use our host python, so it would miss the
    proper modules search paths.

So, if another package want to call that /usr/bin/pybind11-config to
find pybind, they're gonna have incorrect results, if at all...

So I think we really, really need a package (like scipy) that actually
makes use of pybind, so we can see how it works, and to fix it...

Regards,
Yann E. MORIN.

>  $(eval $(python-package))
> -- 
> 2.20.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2021-12-06 21:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 19:31 [Buildroot] [PATCH v2 1/2] package/python-pybind: fix upgrade to version 2.6.1 guillaume.bressaix
2021-12-06 19:31 ` [Buildroot] [PATCH v2 2/2] package/python-pybind: bump to version 2.8.1 guillaume.bressaix
2021-12-06 21:45 ` [Buildroot] [PATCH v2 1/2] package/python-pybind: fix upgrade to version 2.6.1 Yann E. MORIN
2021-12-08  9:09   ` Arnout Vandecappelle
2021-12-06 21:57 ` Yann E. MORIN [this message]
2021-12-07  8:04   ` Arnout Vandecappelle
2021-12-08 11:19     ` Andreas Naumann
2021-12-08 12:15       ` Guillaume Bres
2022-01-07 21:55       ` Arnout Vandecappelle
2021-12-08 17:18     ` Yann E. MORIN
2022-01-03  8:24   ` Tomi Valkeinen
2022-01-04 12:38     ` [Buildroot] [PATCH v2 1/3] package/python-pybind: fix upgrade to 2.6.1 guillaume.bressaix
2022-01-04 12:39       ` [Buildroot] [PATCH v2 2/3] package/python-pybind: bump to version 2.8.1 guillaume.bressaix
2022-01-07 22:10         ` Arnout Vandecappelle
2022-01-04 12:39       ` [Buildroot] [PATCH v2 3/3] support/testing: add test for python-pybind guillaume.bressaix
2022-01-07 21:57         ` Arnout Vandecappelle
2022-01-08 10:26           ` Guillaume Bres
2022-01-07 21:56       ` [Buildroot] [PATCH v2 1/3] package/python-pybind: fix upgrade to 2.6.1 Arnout Vandecappelle
2022-01-07 21:49     ` [Buildroot] [PATCH v2 1/2] package/python-pybind: fix upgrade to version 2.6.1 Arnout Vandecappelle
2022-01-08 10:09       ` Tomi Valkeinen
2022-01-08 10:49         ` Arnout Vandecappelle

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=20211206215730.GE2603@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    --cc=guillaume.bressaix@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox