diff mbox series

[1/1] package/pkg-python.mk: fix PEP517 purelib deployment path

Message ID CAM70yxDW2GTLva+_JQ7wH1z+MQiXYxn__wNSu4KQ-w-MJnJ2gw@mail.gmail.com
State Superseded
Headers show
Series [1/1] package/pkg-python.mk: fix PEP517 purelib deployment path | expand

Commit Message

Emile Cormier March 30, 2022, 4:05 a.m. UTC
package/pkg-python.mk: fix PEP517 purelib deployment path

This allows the Python interpreter to find packages built via the new Flit
infrastructure and fixes bug #14721.
Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>

  --data=$(TARGET_DIR)/usr
@@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
 PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
+
--purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
  --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(STAGING_DIR)/usr/bin \
  --data=$(STAGING_DIR)/usr
@@ -149,7 +149,7 @@ HOST_PKG_PYTHON_PEP517_ENV = \
 HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
+
--purelib=$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
  --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(HOST_DIR)/usr/bin \
  --data=$(HOST_DIR)/usr

Comments

Emile Cormier March 30, 2022, 4:21 a.m. UTC | #1
Sorry, forgot to CC the relevant developers (at least who I think are
relevant). I'm more accustomed to modern software collaboration tools like
GitHub / GitLab / JIRA, to be honest.

On Wed, Mar 30, 2022 at 1:05 AM Emile Cormier <emile.cormier.jr@gmail.com>
wrote:

> package/pkg-python.mk: fix PEP517 purelib deployment path
>
> This allows the Python interpreter to find packages built via the new Flit
> infrastructure and fixes bug #14721.
> Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 52ce402281..6aaca1f465 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
>  PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
> +
> --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
>   --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(TARGET_DIR)/usr/bin \
>   --data=$(TARGET_DIR)/usr
> @@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>  PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> -
> --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> +
> --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
>   --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(STAGING_DIR)/usr/bin \
>   --data=$(STAGING_DIR)/usr
> @@ -149,7 +149,7 @@ HOST_PKG_PYTHON_PEP517_ENV = \
>  HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> +
> --purelib=$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(HOST_DIR)/usr/bin \
>   --data=$(HOST_DIR)/usr
>
James Hilliard March 30, 2022, 7:06 a.m. UTC | #2
On Tue, Mar 29, 2022 at 10:06 PM Emile Cormier
<emile.cormier.jr@gmail.com> wrote:
>
> package/pkg-python.mk: fix PEP517 purelib deployment path
>
> This allows the Python interpreter to find packages built via the new Flit
> infrastructure and fixes bug #14721.
> Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 52ce402281..6aaca1f465 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
>  PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \

I must have copy pasted that wrong, usually /usr/lib is merged with
/usr so worked
for me when runtime testing.

>   --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(TARGET_DIR)/usr/bin \
>   --data=$(TARGET_DIR)/usr
> @@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>  PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(STAGING_DIR)/usr/bin \
>   --data=$(STAGING_DIR)/usr
> @@ -149,7 +149,7 @@ HOST_PKG_PYTHON_PEP517_ENV = \
>  HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(HOST_DIR)/usr/bin \
>   --data=$(HOST_DIR)/usr

For the host I think all these paths should not be under /usr.

> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
Emile Cormier March 30, 2022, 7:19 a.m. UTC | #3
On Wed, Mar 30, 2022 at 4:07 AM James Hilliard <james.hilliard1@gmail.com>
wrote:

> On Tue, Mar 29, 2022 at 10:06 PM Emile Cormier
> <emile.cormier.jr@gmail.com> wrote:
> >
> > - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
> > +
> --purelib=$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> >   --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
> >   --scripts=$(HOST_DIR)/usr/bin \
> >   --data=$(HOST_DIR)/usr
>
> For the host I think all these paths should not be under /usr.
>

For me output/host/usr is a simlink to output/host:
ls -l output/host
total 48
drwxr-xr-x  3 emile emile  4096 Mar 30 01:27 arm-buildroot-linux-gnueabihf
drwxr-xr-x  2 emile emile 12288 Mar 30 01:40 bin
drwxr-xr-x  3 emile emile  4096 Mar 30 01:38 doc
drwxr-xr-x  5 emile emile  4096 Mar 30 01:40 etc
drwxr-xr-x 19 emile emile  4096 Mar 30 01:39 include
drwxr-xr-x  7 emile emile  4096 Mar 30 01:39 lib
lrwxrwxrwx  1 emile emile     3 Mar 30 01:27 lib64 -> lib
drwxr-xr-x  2 emile emile  4096 Mar 30 01:32 libexec
drwxr-xr-x  3 emile emile  4096 Mar 30 01:28 opt
drwxr-xr-x  2 emile emile  4096 Mar 30 01:29 sbin
drwxr-xr-x 22 emile emile  4096 Mar 30 01:38 share
lrwxrwxrwx  1 emile emile     1 Mar 30 01:27 usr -> .
James Hilliard March 30, 2022, 7:23 a.m. UTC | #4
On Wed, Mar 30, 2022 at 1:19 AM Emile Cormier
<emile.cormier.jr@gmail.com> wrote:
>
>
>
> On Wed, Mar 30, 2022 at 4:07 AM James Hilliard <james.hilliard1@gmail.com> wrote:
>>
>> On Tue, Mar 29, 2022 at 10:06 PM Emile Cormier
>> <emile.cormier.jr@gmail.com> wrote:
>> >
>> > - --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> > + --purelib=$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> >   --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>> >   --scripts=$(HOST_DIR)/usr/bin \
>> >   --data=$(HOST_DIR)/usr
>>
>> For the host I think all these paths should not be under /usr.
>
>
> For me output/host/usr is a simlink to output/host:

Yeah, I think it usually works but should not have /usr for consistency.

> ls -l output/host
> total 48
> drwxr-xr-x  3 emile emile  4096 Mar 30 01:27 arm-buildroot-linux-gnueabihf
> drwxr-xr-x  2 emile emile 12288 Mar 30 01:40 bin
> drwxr-xr-x  3 emile emile  4096 Mar 30 01:38 doc
> drwxr-xr-x  5 emile emile  4096 Mar 30 01:40 etc
> drwxr-xr-x 19 emile emile  4096 Mar 30 01:39 include
> drwxr-xr-x  7 emile emile  4096 Mar 30 01:39 lib
> lrwxrwxrwx  1 emile emile     3 Mar 30 01:27 lib64 -> lib
> drwxr-xr-x  2 emile emile  4096 Mar 30 01:32 libexec
> drwxr-xr-x  3 emile emile  4096 Mar 30 01:28 opt
> drwxr-xr-x  2 emile emile  4096 Mar 30 01:29 sbin
> drwxr-xr-x 22 emile emile  4096 Mar 30 01:38 share
> lrwxrwxrwx  1 emile emile     1 Mar 30 01:27 usr -> .
Emile Cormier March 30, 2022, 5:37 p.m. UTC | #5
On Wed, Mar 30, 2022 at 4:23 AM James Hilliard <james.hilliard1@gmail.com>
wrote:

> On Wed, Mar 30, 2022 at 1:19 AM Emile Cormier
> <emile.cormier.jr@gmail.com> wrote:
> > For me output/host/usr is a simlink to output/host:
>
> Yeah, I think it usually works but should not have /usr for consistency.
>

I tried removing 'usr/' from PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS as well
as HOST_PKG_PYTHON_PEP517_INSTALL_OPTS, and the
print(PasswordHasher().hash("foo")) test still works for me on the target
device.

Do you want me to issue another patch with the 'usr/' portion removed from
PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS as well as
HOST_PKG_PYTHON_PEP517_INSTALL_OPTS? I don't care about receiving credit
for such trivial changes. Please do whatever is most expedient to fix the
problem.
James Hilliard March 30, 2022, 6:01 p.m. UTC | #6
I think keep /usr for STAGING/TARGET OPTS but remove for HOST OPTS.

On Wed, Mar 30, 2022 at 11:37 AM Emile Cormier
<emile.cormier.jr@gmail.com> wrote:
>
> On Wed, Mar 30, 2022 at 4:23 AM James Hilliard <james.hilliard1@gmail.com> wrote:
>>
>> On Wed, Mar 30, 2022 at 1:19 AM Emile Cormier
>> <emile.cormier.jr@gmail.com> wrote:
>> > For me output/host/usr is a simlink to output/host:
>>
>> Yeah, I think it usually works but should not have /usr for consistency.
>
>
> I tried removing 'usr/' from PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS as well as HOST_PKG_PYTHON_PEP517_INSTALL_OPTS, and the print(PasswordHasher().hash("foo")) test still works for me on the target device.
>
> Do you want me to issue another patch with the 'usr/' portion removed from PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS as well as HOST_PKG_PYTHON_PEP517_INSTALL_OPTS? I don't care about receiving credit for such trivial changes. Please do whatever is most expedient to fix the problem.
Emile Cormier March 30, 2022, 6:51 p.m. UTC | #7
On Wed, Mar 30, 2022 at 3:01 PM James Hilliard <james.hilliard1@gmail.com>
wrote:

> I think keep /usr for STAGING/TARGET OPTS but remove for HOST OPTS.
>

Alright, I've changed it as you suggested and it still works for me. I'll
post an updated patch.
Emile Cormier March 30, 2022, 6:52 p.m. UTC | #8
package/pkg-python.mk: fix PEP517 purelib deployment path

This allows the Python interpreter to find packages built via the new Flit
infrastructure and fixes bug #14721.
Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 52ce402281..ab4f7af6a6 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
 PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
+
--purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
  --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(TARGET_DIR)/usr/bin \
  --data=$(TARGET_DIR)/usr
@@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
 PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
+
--purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
  --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(STAGING_DIR)/usr/bin \
  --data=$(STAGING_DIR)/usr
@@ -150,8 +150,8 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
  --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
- --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
- --scripts=$(HOST_DIR)/usr/bin \
+ --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)  \
+ --scripts=$(HOST_DIR)/bin \
  --data=$(HOST_DIR)/usr

 ################################################################################

On Wed, Mar 30, 2022 at 3:51 PM Emile Cormier <emile.cormier.jr@gmail.com>
wrote:

> On Wed, Mar 30, 2022 at 3:01 PM James Hilliard <james.hilliard1@gmail.com>
> wrote:
>
>> I think keep /usr for STAGING/TARGET OPTS but remove for HOST OPTS.
>>
>
> Alright, I've changed it as you suggested and it still works for me. I'll
> post an updated patch.
>
James Hilliard March 30, 2022, 7:25 p.m. UTC | #9
On Wed, Mar 30, 2022 at 12:52 PM Emile Cormier
<emile.cormier.jr@gmail.com> wrote:
>
> package/pkg-python.mk: fix PEP517 purelib deployment path
>
> This allows the Python interpreter to find packages built via the new Flit
> infrastructure and fixes bug #14721.
> Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 52ce402281..ab4f7af6a6 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
>  PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(TARGET_DIR)/usr/bin \
>   --data=$(TARGET_DIR)/usr
> @@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>  PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(STAGING_DIR)/usr/bin \
>   --data=$(STAGING_DIR)/usr
> @@ -150,8 +150,8 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
>   --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> - --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
> - --scripts=$(HOST_DIR)/usr/bin \
> + --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)  \
> + --scripts=$(HOST_DIR)/bin \
>   --data=$(HOST_DIR)/usr

I think it should be something like this for the host:
HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
--interpreter=/bin/python \
--script-kind=posix \
--purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
--headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \
--scripts=$(HOST_DIR)/bin \
--data=$(HOST_DIR)


>
>  ################################################################################
>
> On Wed, Mar 30, 2022 at 3:51 PM Emile Cormier <emile.cormier.jr@gmail.com> wrote:
>>
>> On Wed, Mar 30, 2022 at 3:01 PM James Hilliard <james.hilliard1@gmail.com> wrote:
>>>
>>> I think keep /usr for STAGING/TARGET OPTS but remove for HOST OPTS.
>>
>>
>> Alright, I've changed it as you suggested and it still works for me. I'll post an updated patch.
Emile Cormier March 30, 2022, 8:17 p.m. UTC | #10
Oops, missed the interpreter option for
HOST_PKG_PYTHON_PEP517_INSTALL_OPTS. I made the change as you suggested and
it still works. Revised patch follows:

-----

package/pkg-python.mk: fix PEP517 purelib deployment path

This allows the Python interpreter to find packages built via the new Flit
infrastructure and fixes bug #14721.
Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 52ce402281..81c33ba557 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
 PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
+
--purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
  --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(TARGET_DIR)/usr/bin \
  --data=$(TARGET_DIR)/usr
@@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
 PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
+
--purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
  --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(STAGING_DIR)/usr/bin \
  --data=$(STAGING_DIR)/usr
@@ -147,11 +147,11 @@ HOST_PKG_PYTHON_PEP517_ENV = \
  $(HOST_CONFIGURE_OPTS)

 HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
- --interpreter=/usr/bin/python \
+ --interpreter=/bin/python \
  --script-kind=posix \
  --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
- --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
- --scripts=$(HOST_DIR)/usr/bin \
+ --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)  \
+ --scripts=$(HOST_DIR)/bin \
  --data=$(HOST_DIR)/usr

 ################################################################################

On Wed, Mar 30, 2022 at 4:25 PM James Hilliard <james.hilliard1@gmail.com>
wrote:

> On Wed, Mar 30, 2022 at 12:52 PM Emile Cormier
> <emile.cormier.jr@gmail.com> wrote:
> >
> > package/pkg-python.mk: fix PEP517 purelib deployment path
> >
> > This allows the Python interpreter to find packages built via the new
> Flit
> > infrastructure and fixes bug #14721.
> > Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
> >
> > diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> > index 52ce402281..ab4f7af6a6 100644
> > --- a/package/pkg-python.mk
> > +++ b/package/pkg-python.mk
> > @@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
> >  PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
> >   --interpreter=/usr/bin/python \
> >   --script-kind=posix \
> > -
> --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> > +
> --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
> >   --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
> >   --scripts=$(TARGET_DIR)/usr/bin \
> >   --data=$(TARGET_DIR)/usr
> > @@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
> >  PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
> >   --interpreter=/usr/bin/python \
> >   --script-kind=posix \
> > -
> --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> > +
> --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
> >   --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
> >   --scripts=$(STAGING_DIR)/usr/bin \
> >   --data=$(STAGING_DIR)/usr
> > @@ -150,8 +150,8 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
> >   --interpreter=/usr/bin/python \
> >   --script-kind=posix \
> >   --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
> \
> > - --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
> > - --scripts=$(HOST_DIR)/usr/bin \
> > + --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)  \
> > + --scripts=$(HOST_DIR)/bin \
> >   --data=$(HOST_DIR)/usr
>
> I think it should be something like this for the host:
> HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
> --interpreter=/bin/python \
> --script-kind=posix \
> --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \
> --scripts=$(HOST_DIR)/bin \
> --data=$(HOST_DIR)
>
>
> >
> >
> ################################################################################
> >
> > On Wed, Mar 30, 2022 at 3:51 PM Emile Cormier <
> emile.cormier.jr@gmail.com> wrote:
> >>
> >> On Wed, Mar 30, 2022 at 3:01 PM James Hilliard <
> james.hilliard1@gmail.com> wrote:
> >>>
> >>> I think keep /usr for STAGING/TARGET OPTS but remove for HOST OPTS.
> >>
> >>
> >> Alright, I've changed it as you suggested and it still works for me.
> I'll post an updated patch.
>
James Hilliard March 30, 2022, 10:53 p.m. UTC | #11
On Wed, Mar 30, 2022 at 2:18 PM Emile Cormier
<emile.cormier.jr@gmail.com> wrote:
>
> Oops, missed the interpreter option for HOST_PKG_PYTHON_PEP517_INSTALL_OPTS. I made the change as you suggested and it still works. Revised patch follows:

You also missed data there as well, and it seems your patch has
formatting issues,
I went ahead and cleaned it up here, see if that works ok for you:
https://patchwork.ozlabs.org/project/buildroot/patch/20220330224521.4142504-1-james.hilliard1@gmail.com/

FYI I think your email client is corrupting the patch a bit as it
didn't apply cleanly,
see guide here:
https://buildroot.org/downloads/manual/manual.html#submitting-patches

Make sure you send the patch using git send-email which should make sure
the formatting isn't messed with by your email client.

>
> -----
>
> package/pkg-python.mk: fix PEP517 purelib deployment path
>
> This allows the Python interpreter to find packages built via the new Flit
> infrastructure and fixes bug #14721.
> Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
>
> diff --git a/package/pkg-python.mk b/package/pkg-python.mk
> index 52ce402281..81c33ba557 100644
> --- a/package/pkg-python.mk
> +++ b/package/pkg-python.mk
> @@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
>  PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(TARGET_DIR)/usr/bin \
>   --data=$(TARGET_DIR)/usr
> @@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>  PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
>   --interpreter=/usr/bin/python \
>   --script-kind=posix \
> - --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> + --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>   --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>   --scripts=$(STAGING_DIR)/usr/bin \
>   --data=$(STAGING_DIR)/usr
> @@ -147,11 +147,11 @@ HOST_PKG_PYTHON_PEP517_ENV = \
>   $(HOST_CONFIGURE_OPTS)
>
>  HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
> - --interpreter=/usr/bin/python \
> + --interpreter=/bin/python \
>   --script-kind=posix \
>   --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
> - --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
> - --scripts=$(HOST_DIR)/usr/bin \
> + --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)  \
> + --scripts=$(HOST_DIR)/bin \
>   --data=$(HOST_DIR)/usr
>
>  ################################################################################
>
> On Wed, Mar 30, 2022 at 4:25 PM James Hilliard <james.hilliard1@gmail.com> wrote:
>>
>> On Wed, Mar 30, 2022 at 12:52 PM Emile Cormier
>> <emile.cormier.jr@gmail.com> wrote:
>> >
>> > package/pkg-python.mk: fix PEP517 purelib deployment path
>> >
>> > This allows the Python interpreter to find packages built via the new Flit
>> > infrastructure and fixes bug #14721.
>> > Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
>> >
>> > diff --git a/package/pkg-python.mk b/package/pkg-python.mk
>> > index 52ce402281..ab4f7af6a6 100644
>> > --- a/package/pkg-python.mk
>> > +++ b/package/pkg-python.mk
>> > @@ -127,7 +127,7 @@ PKG_PYTHON_PEP517_ENV = \
>> >  PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>> >   --interpreter=/usr/bin/python \
>> >   --script-kind=posix \
>> > - --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> > + --purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> >   --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>> >   --scripts=$(TARGET_DIR)/usr/bin \
>> >   --data=$(TARGET_DIR)/usr
>> > @@ -135,7 +135,7 @@ PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
>> >  PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
>> >   --interpreter=/usr/bin/python \
>> >   --script-kind=posix \
>> > - --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> > + --purelib=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> >   --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>> >   --scripts=$(STAGING_DIR)/usr/bin \
>> >   --data=$(STAGING_DIR)/usr
>> > @@ -150,8 +150,8 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
>> >   --interpreter=/usr/bin/python \
>> >   --script-kind=posix \
>> >   --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> > - --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
>> > - --scripts=$(HOST_DIR)/usr/bin \
>> > + --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)  \
>> > + --scripts=$(HOST_DIR)/bin \
>> >   --data=$(HOST_DIR)/usr
>>
>> I think it should be something like this for the host:
>> HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
>> --interpreter=/bin/python \
>> --script-kind=posix \
>> --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
>> --headers=$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR) \
>> --scripts=$(HOST_DIR)/bin \
>> --data=$(HOST_DIR)
>>
>>
>> >
>> >  ################################################################################
>> >
>> > On Wed, Mar 30, 2022 at 3:51 PM Emile Cormier <emile.cormier.jr@gmail.com> wrote:
>> >>
>> >> On Wed, Mar 30, 2022 at 3:01 PM James Hilliard <james.hilliard1@gmail.com> wrote:
>> >>>
>> >>> I think keep /usr for STAGING/TARGET OPTS but remove for HOST OPTS.
>> >>
>> >>
>> >> Alright, I've changed it as you suggested and it still works for me. I'll post an updated patch.
diff mbox series

Patch

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 52ce402281..6aaca1f465 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -127,7 +127,7 @@  PKG_PYTHON_PEP517_ENV = \
 PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
  --interpreter=/usr/bin/python \
  --script-kind=posix \
- --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
+
--purelib=$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
\
  --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)  \
  --scripts=$(TARGET_DIR)/usr/bin \