All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils
@ 2019-11-11 14:06 Ryan Barnett
  2019-11-11 14:06 ` [Buildroot] [PATCH 2/2] package/pkg-python: use TARGET_CONFIGURE_OPTS " Ryan Barnett
  2019-12-04 14:12 ` [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS " Ryan Barnett
  0 siblings, 2 replies; 5+ messages in thread
From: Ryan Barnett @ 2019-11-11 14:06 UTC (permalink / raw)
  To: buildroot

When building host python packages, we need to ensure that distutils
package types utilize HOST_CONFIGURE_OPTS. This ensures that the
correct linker and compiler environment variables are set to compile
utilizing the host directory.

It was discovered that when compiling a host-python package, it was
using linking against the build machines library folder instead of the
host folder because LDFLAGS was not properly set and was improperly
detecting whether or not a shared or static library was present in the
host folder.

Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
---
 package/pkg-python.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index be1ce071df..8e4c7e5795 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -52,7 +52,8 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
 # Host distutils-based packages
 HOST_PKG_PYTHON_DISTUTILS_ENV = \
 	PATH=$(BR_PATH) \
-	PYTHONNOUSERSITE=1
+	PYTHONNOUSERSITE=1 \
+	$(HOST_CONFIGURE_OPTS)
 
 HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
 	--prefix=$(HOST_DIR)
-- 
2.18.0

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

* [Buildroot] [PATCH 2/2] package/pkg-python: use TARGET_CONFIGURE_OPTS for distutils
  2019-11-11 14:06 [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils Ryan Barnett
@ 2019-11-11 14:06 ` Ryan Barnett
  2019-12-04 14:12 ` [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS " Ryan Barnett
  1 sibling, 0 replies; 5+ messages in thread
From: Ryan Barnett @ 2019-11-11 14:06 UTC (permalink / raw)
  To: buildroot

When compiling a distutils python package, use TARGET_CONFIGURE_OPTS
for the environment to ensure that all the environment variables for
cross compilation with buildroot are correct.

Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
---
 package/pkg-python.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 8e4c7e5795..15438bdcb0 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -27,9 +27,7 @@ endef
 # Target distutils-based packages
 PKG_PYTHON_DISTUTILS_ENV = \
 	PATH=$(BR_PATH) \
-	CC="$(TARGET_CC)" \
-	CFLAGS="$(TARGET_CFLAGS)" \
-	LDFLAGS="$(TARGET_LDFLAGS)" \
+	$(TARGET_CONFIGURE_OPTS) \
 	LDSHARED="$(TARGET_CROSS)gcc -shared" \
 	PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \
 	PYTHONNOUSERSITE=1 \
-- 
2.18.0

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

* [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils
  2019-11-11 14:06 [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils Ryan Barnett
  2019-11-11 14:06 ` [Buildroot] [PATCH 2/2] package/pkg-python: use TARGET_CONFIGURE_OPTS " Ryan Barnett
@ 2019-12-04 14:12 ` Ryan Barnett
  2019-12-05 21:45   ` Arnout Vandecappelle
  1 sibling, 1 reply; 5+ messages in thread
From: Ryan Barnett @ 2019-12-04 14:12 UTC (permalink / raw)
  To: buildroot

On Mon, Nov 11, 2019 at 8:06 AM Ryan Barnett
<ryan.barnett@rockwellcollins.com> wrote:
>
> When building host python packages, we need to ensure that distutils
> package types utilize HOST_CONFIGURE_OPTS. This ensures that the
> correct linker and compiler environment variables are set to compile
> utilizing the host directory.
>
> It was discovered that when compiling a host-python package, it was
> using linking against the build machines library folder instead of the
> host folder because LDFLAGS was not properly set and was improperly
> detecting whether or not a shared or static library was present in the
> host folder.

Is there any feedback on this approach to compiling a host python
distutils packages?

Or is it preferred to explicitly pass the LDFLAGS variable in the DISTUTILS_ENV?

> Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
> ---
>  package/pkg-python.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index be1ce071df..8e4c7e5795 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -52,7 +52,8 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
>  # Host distutils-based packages
>  HOST_PKG_PYTHON_DISTUTILS_ENV = \
>         PATH=$(BR_PATH) \
> -       PYTHONNOUSERSITE=1
> +       PYTHONNOUSERSITE=1 \
> +       $(HOST_CONFIGURE_OPTS)
>
>  HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
>         --prefix=$(HOST_DIR)
> --
> 2.18.0
>

Thanks,
-Ryan

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

* [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils
  2019-12-04 14:12 ` [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS " Ryan Barnett
@ 2019-12-05 21:45   ` Arnout Vandecappelle
  2019-12-05 21:55     ` Ryan Barnett
  0 siblings, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2019-12-05 21:45 UTC (permalink / raw)
  To: buildroot



On 04/12/2019 15:12, Ryan Barnett wrote:
> On Mon, Nov 11, 2019 at 8:06 AM Ryan Barnett
> <ryan.barnett@rockwellcollins.com> wrote:
>>
>> When building host python packages, we need to ensure that distutils
>> package types utilize HOST_CONFIGURE_OPTS. This ensures that the
>> correct linker and compiler environment variables are set to compile
>> utilizing the host directory.
>>
>> It was discovered that when compiling a host-python package, it was
>> using linking against the build machines library folder instead of the
>> host folder because LDFLAGS was not properly set and was improperly
>> detecting whether or not a shared or static library was present in the
>> host folder.
> 
> Is there any feedback on this approach to compiling a host python
> distutils packages?

 As such it seems like the right thing to do. However, it makes me wonder

- why this is not needed for setuptools;

- why we don't pass TARGET_CONFIGURE_OPTS in the environment for the target.

 Regards,
 Arnout

> 
> Or is it preferred to explicitly pass the LDFLAGS variable in the DISTUTILS_ENV?
> 
>> Signed-off-by: Ryan Barnett <ryan.barnett@rockwellcollins.com>
>> ---
>>  package/pkg-python.mk | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
>> index be1ce071df..8e4c7e5795 100644
>> --- a/package/pkg-python.mk
>> +++ b/package/pkg-python.mk
>> @@ -52,7 +52,8 @@ PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
>>  # Host distutils-based packages
>>  HOST_PKG_PYTHON_DISTUTILS_ENV = \
>>         PATH=$(BR_PATH) \
>> -       PYTHONNOUSERSITE=1
>> +       PYTHONNOUSERSITE=1 \
>> +       $(HOST_CONFIGURE_OPTS)
>>
>>  HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
>>         --prefix=$(HOST_DIR)
>> --
>> 2.18.0
>>
> 
> Thanks,
> -Ryan
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

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

* [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils
  2019-12-05 21:45   ` Arnout Vandecappelle
@ 2019-12-05 21:55     ` Ryan Barnett
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Barnett @ 2019-12-05 21:55 UTC (permalink / raw)
  To: buildroot

Arnout,

On Thu, Dec 5, 2019 at 3:45 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
> On 04/12/2019 15:12, Ryan Barnett wrote:
> > On Mon, Nov 11, 2019 at 8:06 AM Ryan Barnett
> > <ryan.barnett@rockwellcollins.com> wrote:
> >>
> >> When building host python packages, we need to ensure that distutils
> >> package types utilize HOST_CONFIGURE_OPTS. This ensures that the
> >> correct linker and compiler environment variables are set to compile
> >> utilizing the host directory.
> >>
> >> It was discovered that when compiling a host-python package, it was
> >> using linking against the build machines library folder instead of the
> >> host folder because LDFLAGS was not properly set and was improperly
> >> detecting whether or not a shared or static library was present in the
> >> host folder.
> >
> > Is there any feedback on this approach to compiling a host python
> > distutils packages?
>
>  As such it seems like the right thing to do. However, it makes me wonder
>
> - why this is not needed for setuptools;
>
> - why we don't pass TARGET_CONFIGURE_OPTS in the environment for the target.

I will send a v2 where I combine the passing
{TARGET|HOST}_CONFIGURE_OPTS into their respective environments. I
will also send changing of the setuptools package type as well.

I'm not familiar with the setuptools build method for building with
python but I would image that it doesn't hurt to pass _CONFIGURE_OPTS
in the environment.

Thanks,
-Ryan

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

end of thread, other threads:[~2019-12-05 21:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 14:06 [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS for distutils Ryan Barnett
2019-11-11 14:06 ` [Buildroot] [PATCH 2/2] package/pkg-python: use TARGET_CONFIGURE_OPTS " Ryan Barnett
2019-12-04 14:12 ` [Buildroot] [PATCH 1/2] package/pkg-python: use HOST_CONFIGURE_OPTS " Ryan Barnett
2019-12-05 21:45   ` Arnout Vandecappelle
2019-12-05 21:55     ` Ryan Barnett

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.