All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/2] package/pkg-python: add setuptools-rust infrastructure
@ 2022-05-01  7:44 James Hilliard
  2022-05-01  7:44 ` [Buildroot] [PATCH v3 2/2] package/python-cryptography: migrate to " James Hilliard
  2022-05-01 20:13 ` [Buildroot] [PATCH v3 1/2] package/pkg-python: add " Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: James Hilliard @ 2022-05-01  7:44 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Asaf Kahlon, Thomas Petazzoni

The setuptools-rust package infrastructure is essentially a variant
of the setuptools package infrastructure which sets up the env
and download hooks required for building setuptools-rust packages.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 package/pkg-python.mk | 46 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 3 deletions(-)

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index b86e12423f..a9bb12550c 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -110,6 +110,24 @@ HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
 	--root=/ \
 	--single-version-externally-managed
 
+# Target setuptools-rust-based packages
+PKG_PYTHON_SETUPTOOLS_RUST_ENV = \
+	$(PKG_PYTHON_SETUPTOOLS_ENV) \
+	$(PKG_CARGO_ENV) \
+	PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
+
+PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV = \
+	$(PKG_CARGO_ENV)
+
+# Host setuptools-rust-based packages
+HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \
+	$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+	$(HOST_PKG_CARGO_ENV) \
+	PYO3_CROSS_LIB_DIR="$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
+
+HOST_PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV = \
+	$(HOST_PKG_CARGO_ENV)
+
 # Target pep517-based packages
 PKG_PYTHON_PEP517_ENV = \
 	$(PKG_PYTHON_ENV)
@@ -177,14 +195,30 @@ $(2)_BASE_BUILD_CMD   = setup.py build
 $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS)
 endif
 # Setuptools
-else ifeq ($$($(2)_SETUP_TYPE),setuptools)
+else ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),)
 ifeq ($(4),target)
+ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
+$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_ENV)
+$(2)_DL_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV)
+$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(2)_CARGO_MANIFEST_PATH)
+else
 $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
+endif
 $(2)_BASE_BUILD_CMD = setup.py build
 $(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
 $(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
 else
+ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
+$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV)
+$(2)_DL_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV)
+ifndef $(2)_CARGO_MANIFEST_PATH
+$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(3)_CARGO_MANIFEST_PATH)
+else
+$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(2)_CARGO_MANIFEST_PATH)
+endif
+else
 $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV)
+endif
 $(2)_BASE_BUILD_CMD = setup.py build
 $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
 endif
@@ -208,7 +242,7 @@ $(2)_BASE_BUILD_CMD = -m flit_core.wheel
 $(2)_BASE_INSTALL_CMD ?= -m installer dist/*
 endif
 else
-$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.")
+$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'setuptools-rust', 'pep517' or 'flit'.")
 endif
 
 # Target packages need both the python interpreter on the target (for
@@ -225,8 +259,14 @@ endif # ($(4),target)
 # Setuptools based packages will need setuptools for the host Python
 # interpreter (both host and target).
 #
-ifeq ($$($(2)_SETUP_TYPE),setuptools)
+ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),)
 $(2)_DEPENDENCIES += $$(if $$(filter host-python-setuptools,$(1)),,host-python-setuptools)
+ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
+$(2)_DEPENDENCIES += host-python-setuptools-rust host-rustc
+# We need to vendor the Cargo crates at download time
+$(2)_DOWNLOAD_POST_PROCESS = cargo
+$(2)_DOWNLOAD_DEPENDENCIES = host-rustc
+endif
 else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
 $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer
 ifeq ($$($(2)_SETUP_TYPE),flit)
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v3 2/2] package/python-cryptography: migrate to setuptools-rust infrastructure
  2022-05-01  7:44 [Buildroot] [PATCH v3 1/2] package/pkg-python: add setuptools-rust infrastructure James Hilliard
@ 2022-05-01  7:44 ` James Hilliard
  2022-05-01 20:13 ` [Buildroot] [PATCH v3 1/2] package/pkg-python: add " Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: James Hilliard @ 2022-05-01  7:44 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Asaf Kahlon, Thomas Petazzoni

We can now significantly simplify the python-cryptography build using
the new setuptools-rust setup type introduced in the python package
infrastructure.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v2 -> v3:
  - rebase
---
 .../python-cryptography.mk                    | 30 +++----------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/package/python-cryptography/python-cryptography.mk b/package/python-cryptography/python-cryptography.mk
index 7714b9ad88..e3fde91c5b 100644
--- a/package/python-cryptography/python-cryptography.mk
+++ b/package/python-cryptography/python-cryptography.mk
@@ -7,36 +7,14 @@
 PYTHON_CRYPTOGRAPHY_VERSION = 37.0.1
 PYTHON_CRYPTOGRAPHY_SOURCE = cryptography-$(PYTHON_CRYPTOGRAPHY_VERSION).tar.gz
 PYTHON_CRYPTOGRAPHY_SITE = https://files.pythonhosted.org/packages/3d/5f/addb8b91fd356792d28e59a8275fec833323cb28604fb3a497c35d7cf0a3
-PYTHON_CRYPTOGRAPHY_SETUP_TYPE = setuptools
+PYTHON_CRYPTOGRAPHY_SETUP_TYPE = setuptools-rust
 PYTHON_CRYPTOGRAPHY_LICENSE = Apache-2.0 or BSD-3-Clause
 PYTHON_CRYPTOGRAPHY_LICENSE_FILES = LICENSE LICENSE.APACHE LICENSE.BSD
 PYTHON_CRYPTOGRAPHY_CPE_ID_VENDOR = cryptography_project
 PYTHON_CRYPTOGRAPHY_CPE_ID_PRODUCT = cryptography
-PYTHON_CRYPTOGRAPHY_DEPENDENCIES = \
-	host-python-setuptools-rust \
-	host-python-cffi \
-	host-rustc \
-	openssl
-HOST_PYTHON_CRYPTOGRAPHY_DEPENDENCIES = \
-	host-python-setuptools-rust \
-	host-python-cffi \
-	host-rustc \
-	host-openssl
-PYTHON_CRYPTOGRAPHY_ENV = \
-	$(PKG_CARGO_ENV) \
-	PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
-HOST_PYTHON_CRYPTOGRAPHY_ENV = \
-	$(HOST_PKG_CARGO_ENV) \
-	PYO3_CROSS_LIB_DIR="$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
-# We need to vendor the Cargo crates at download time
-PYTHON_CRYPTOGRAPHY_DOWNLOAD_POST_PROCESS = cargo
-PYTHON_CRYPTOGRAPHY_DOWNLOAD_DEPENDENCIES = host-rustc
-PYTHON_CRYPTOGRAPHY_DL_ENV = \
-	$(PKG_CARGO_ENV) \
-	BR_CARGO_MANIFEST_PATH=src/rust/Cargo.toml
-HOST_PYTHON_CRYPTOGRAPHY_DL_ENV = \
-	$(HOST_PKG_CARGO_ENV) \
-	BR_CARGO_MANIFEST_PATH=src/rust/Cargo.toml
+PYTHON_CRYPTOGRAPHY_CARGO_MANIFEST_PATH = src/rust/Cargo.toml
+PYTHON_CRYPTOGRAPHY_DEPENDENCIES = host-python-cffi openssl
+HOST_PYTHON_CRYPTOGRAPHY_DEPENDENCIES = host-python-cffi host-openssl
 
 $(eval $(python-package))
 $(eval $(host-python-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v3 1/2] package/pkg-python: add setuptools-rust infrastructure
  2022-05-01  7:44 [Buildroot] [PATCH v3 1/2] package/pkg-python: add setuptools-rust infrastructure James Hilliard
  2022-05-01  7:44 ` [Buildroot] [PATCH v3 2/2] package/python-cryptography: migrate to " James Hilliard
@ 2022-05-01 20:13 ` Yann E. MORIN
  2022-05-01 21:29   ` James Hilliard
  1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2022-05-01 20:13 UTC (permalink / raw)
  To: James Hilliard; +Cc: Thomas Petazzoni, Asaf Kahlon, buildroot

James, All,

On 2022-05-01 01:44 -0600, James Hilliard spake thusly:
> The setuptools-rust package infrastructure is essentially a variant
> of the setuptools package infrastructure which sets up the env
> and download hooks required for building setuptools-rust packages.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

First, thanks a lot for working on this topic; this is greatly
appreciated.

However, I believe this one is going a bit too far, at least for now.
Indeed, in Buildroot, we try to wait for until we have a few examples
of a specific package type before we add infrastructure support for it.
Usually, that rounds at about 5-ish packages.

For now, we have a single python package that is partly written in rust,
and it is not very complex, so we can live with it for now, and it
serves as a pretty good example of what is needed.

However, what I am afraid of, is that even non-python packages may end
having parts of them written in rust, and so maybe we would need a more
generic solution, with something that's be used like $(kernel-module)
or just with variables...

Until we have more such examples, then it is hard to be sure that a new
type of python packages is ther good approach or not.

Regards,
Yann E. MORIN.

> ---
>  package/pkg-python.mk | 46 ++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 43 insertions(+), 3 deletions(-)
> 
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index b86e12423f..a9bb12550c 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -110,6 +110,24 @@ HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
>  	--root=/ \
>  	--single-version-externally-managed
>  
> +# Target setuptools-rust-based packages
> +PKG_PYTHON_SETUPTOOLS_RUST_ENV = \
> +	$(PKG_PYTHON_SETUPTOOLS_ENV) \
> +	$(PKG_CARGO_ENV) \
> +	PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
> +
> +PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV = \
> +	$(PKG_CARGO_ENV)
> +
> +# Host setuptools-rust-based packages
> +HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \
> +	$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
> +	$(HOST_PKG_CARGO_ENV) \
> +	PYO3_CROSS_LIB_DIR="$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
> +
> +HOST_PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV = \
> +	$(HOST_PKG_CARGO_ENV)
> +
>  # Target pep517-based packages
>  PKG_PYTHON_PEP517_ENV = \
>  	$(PKG_PYTHON_ENV)
> @@ -177,14 +195,30 @@ $(2)_BASE_BUILD_CMD   = setup.py build
>  $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS)
>  endif
>  # Setuptools
> -else ifeq ($$($(2)_SETUP_TYPE),setuptools)
> +else ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),)
>  ifeq ($(4),target)
> +ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
> +$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_ENV)
> +$(2)_DL_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV)
> +$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(2)_CARGO_MANIFEST_PATH)
> +else
>  $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
> +endif
>  $(2)_BASE_BUILD_CMD = setup.py build
>  $(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
>  $(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
>  else
> +ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
> +$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV)
> +$(2)_DL_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV)
> +ifndef $(2)_CARGO_MANIFEST_PATH
> +$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(3)_CARGO_MANIFEST_PATH)
> +else
> +$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(2)_CARGO_MANIFEST_PATH)
> +endif
> +else
>  $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV)
> +endif
>  $(2)_BASE_BUILD_CMD = setup.py build
>  $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
>  endif
> @@ -208,7 +242,7 @@ $(2)_BASE_BUILD_CMD = -m flit_core.wheel
>  $(2)_BASE_INSTALL_CMD ?= -m installer dist/*
>  endif
>  else
> -$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.")
> +$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'setuptools-rust', 'pep517' or 'flit'.")
>  endif
>  
>  # Target packages need both the python interpreter on the target (for
> @@ -225,8 +259,14 @@ endif # ($(4),target)
>  # Setuptools based packages will need setuptools for the host Python
>  # interpreter (both host and target).
>  #
> -ifeq ($$($(2)_SETUP_TYPE),setuptools)
> +ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),)
>  $(2)_DEPENDENCIES += $$(if $$(filter host-python-setuptools,$(1)),,host-python-setuptools)
> +ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
> +$(2)_DEPENDENCIES += host-python-setuptools-rust host-rustc
> +# We need to vendor the Cargo crates at download time
> +$(2)_DOWNLOAD_POST_PROCESS = cargo
> +$(2)_DOWNLOAD_DEPENDENCIES = host-rustc
> +endif
>  else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
>  $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer
>  ifeq ($$($(2)_SETUP_TYPE),flit)
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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

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

* Re: [Buildroot] [PATCH v3 1/2] package/pkg-python: add setuptools-rust infrastructure
  2022-05-01 20:13 ` [Buildroot] [PATCH v3 1/2] package/pkg-python: add " Yann E. MORIN
@ 2022-05-01 21:29   ` James Hilliard
  0 siblings, 0 replies; 4+ messages in thread
From: James Hilliard @ 2022-05-01 21:29 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Thomas Petazzoni, Asaf Kahlon, buildroot

On Sun, May 1, 2022 at 2:13 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2022-05-01 01:44 -0600, James Hilliard spake thusly:
> > The setuptools-rust package infrastructure is essentially a variant
> > of the setuptools package infrastructure which sets up the env
> > and download hooks required for building setuptools-rust packages.
> >
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
>
> First, thanks a lot for working on this topic; this is greatly
> appreciated.
>
> However, I believe this one is going a bit too far, at least for now.
> Indeed, in Buildroot, we try to wait for until we have a few examples
> of a specific package type before we add infrastructure support for it.
> Usually, that rounds at about 5-ish packages.
>
> For now, we have a single python package that is partly written in rust,
> and it is not very complex, so we can live with it for now, and it
> serves as a pretty good example of what is needed.

I found it wasn't very clear in differentiating what variables/deps are specific
to setuptools-rust and what are specific to python-cryptography.

>
> However, what I am afraid of, is that even non-python packages may end
> having parts of them written in rust, and so maybe we would need a more
> generic solution, with something that's be used like $(kernel-module)
> or just with variables...

The setuptools-rust SETUP_TYPE is meant to be used with packages using
the setuptools-rust extension(https://github.com/PyO3/setuptools-rust), it's
not something generic that would make sense for non-python packages or
even python packages using a different type of rust integration as some of
the env variables are specific to the setuptools-rust extension(although
there may be some common env variables that can be shared in that case).

Other python based build systems like meson have some rust support as
well but they would not make use of this as setuptools-rust is not how they
implement their rust integrations

>
> Until we have more such examples, then it is hard to be sure that a new
> type of python packages is ther good approach or not.

Let me see if there's any other packages we have that may be migrating
to setuptools-rust.

>
> Regards,
> Yann E. MORIN.
>
> > ---
> >  package/pkg-python.mk | 46 ++++++++++++++++++++++++++++++++++++++++---
> >  1 file changed, 43 insertions(+), 3 deletions(-)
> >
> > diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> > index b86e12423f..a9bb12550c 100644
> > --- a/package/pkg-python.mk
> > +++ b/package/pkg-python.mk
> > @@ -110,6 +110,24 @@ HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
> >       --root=/ \
> >       --single-version-externally-managed
> >
> > +# Target setuptools-rust-based packages
> > +PKG_PYTHON_SETUPTOOLS_RUST_ENV = \
> > +     $(PKG_PYTHON_SETUPTOOLS_ENV) \
> > +     $(PKG_CARGO_ENV) \
> > +     PYO3_CROSS_LIB_DIR="$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
> > +
> > +PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV = \
> > +     $(PKG_CARGO_ENV)
> > +
> > +# Host setuptools-rust-based packages
> > +HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV = \
> > +     $(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
> > +     $(HOST_PKG_CARGO_ENV) \
> > +     PYO3_CROSS_LIB_DIR="$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)"
> > +
> > +HOST_PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV = \
> > +     $(HOST_PKG_CARGO_ENV)
> > +
> >  # Target pep517-based packages
> >  PKG_PYTHON_PEP517_ENV = \
> >       $(PKG_PYTHON_ENV)
> > @@ -177,14 +195,30 @@ $(2)_BASE_BUILD_CMD   = setup.py build
> >  $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS)
> >  endif
> >  # Setuptools
> > -else ifeq ($$($(2)_SETUP_TYPE),setuptools)
> > +else ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),)
> >  ifeq ($(4),target)
> > +ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
> > +$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_ENV)
> > +$(2)_DL_ENV = $$(PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV)
> > +$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(2)_CARGO_MANIFEST_PATH)
> > +else
> >  $(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
> > +endif
> >  $(2)_BASE_BUILD_CMD = setup.py build
> >  $(2)_BASE_INSTALL_TARGET_CMD = setup.py install --no-compile $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS)
> >  $(2)_BASE_INSTALL_STAGING_CMD = setup.py install $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS)
> >  else
> > +ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
> > +$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_ENV)
> > +$(2)_DL_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_RUST_DL_ENV)
> > +ifndef $(2)_CARGO_MANIFEST_PATH
> > +$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(3)_CARGO_MANIFEST_PATH)
> > +else
> > +$(2)_DL_ENV += BR_CARGO_MANIFEST_PATH=$$($(2)_CARGO_MANIFEST_PATH)
> > +endif
> > +else
> >  $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV)
> > +endif
> >  $(2)_BASE_BUILD_CMD = setup.py build
> >  $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
> >  endif
> > @@ -208,7 +242,7 @@ $(2)_BASE_BUILD_CMD = -m flit_core.wheel
> >  $(2)_BASE_INSTALL_CMD ?= -m installer dist/*
> >  endif
> >  else
> > -$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.")
> > +$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'setuptools-rust', 'pep517' or 'flit'.")
> >  endif
> >
> >  # Target packages need both the python interpreter on the target (for
> > @@ -225,8 +259,14 @@ endif # ($(4),target)
> >  # Setuptools based packages will need setuptools for the host Python
> >  # interpreter (both host and target).
> >  #
> > -ifeq ($$($(2)_SETUP_TYPE),setuptools)
> > +ifneq ($$(filter setuptools setuptools-rust,$$($(2)_SETUP_TYPE)),)
> >  $(2)_DEPENDENCIES += $$(if $$(filter host-python-setuptools,$(1)),,host-python-setuptools)
> > +ifeq ($$($(2)_SETUP_TYPE),setuptools-rust)
> > +$(2)_DEPENDENCIES += host-python-setuptools-rust host-rustc
> > +# We need to vendor the Cargo crates at download time
> > +$(2)_DOWNLOAD_POST_PROCESS = cargo
> > +$(2)_DOWNLOAD_DEPENDENCIES = host-rustc
> > +endif
> >  else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
> >  $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer
> >  ifeq ($$($(2)_SETUP_TYPE),flit)
> > --
> > 2.25.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  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

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

end of thread, other threads:[~2022-05-01 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-01  7:44 [Buildroot] [PATCH v3 1/2] package/pkg-python: add setuptools-rust infrastructure James Hilliard
2022-05-01  7:44 ` [Buildroot] [PATCH v3 2/2] package/python-cryptography: migrate to " James Hilliard
2022-05-01 20:13 ` [Buildroot] [PATCH v3 1/2] package/pkg-python: add " Yann E. MORIN
2022-05-01 21:29   ` James Hilliard

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.