From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21BAEC43334 for ; Tue, 7 Jun 2022 20:03:56 +0000 (UTC) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by mx.groups.io with SMTP id smtpd.web08.2110.1654632229077657008 for ; Tue, 07 Jun 2022 13:03:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lR6ZJley; spf=pass (domain: gmail.com, ip: 209.85.219.179, mailfrom: ptsneves@gmail.com) Received: by mail-yb1-f179.google.com with SMTP id v22so32930484ybd.5 for ; Tue, 07 Jun 2022 13:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tQwDbp9W0x53Jus8U47OT7RwKDnxC8u0Aez5cn5Xr9A=; b=lR6ZJleyr5kn56C9NJtoRmH4zTXZsaz16BVZCDm4+jX/zZBZ9rQ1NMoKYQHI63EJDL 1rZIgBvmbHXix+/k58CgoBBeXp+wI6/a8EiQLUen+ZXlAjUnW+fd6inoqsyT7rbWd+M4 knRFE7+X1j3LjWOXKPERv4IL1S4nxqRnZRaAT2dCDxp1CectpUVQg+xeVuOLUqRywYTO 4HcO1Howwt3sCK861n3A7UL4JSX1HcVA0K5QW/j6H/djv5PphVikuKNM92p1vpAKwhJ5 d3fNZFks7Zccn5dclPHPHDrM499heB+xfyOxN7erPAgO4S1q1uf/+ic1c/kGLad9PmfG M2Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tQwDbp9W0x53Jus8U47OT7RwKDnxC8u0Aez5cn5Xr9A=; b=vGQYbnR+rpwfC4wbM2RoGLaimnZllpTUv65EasggfuoqolbZJhETfkbnsqIG0B2ZqA OkMN9yaLO5ReNg47v0W0MFUIB2e1IjFf6yfddqXKPgSJ1L8kky6avJzq4MYYxKi2/JWG YmNjwvj8AFE8NhzdmW/fpfssKWJxejsFh+84LbHns3rTJvbK+7Ea4llD9ToqWQ2MjQdt WknrC29840nBxFfsxyJnDOb53s37Dm5iiIGtnYoIy4AODYw+ulDpvxiLNbn+zyGRktKN wLq1r8ZsmFbJjGZ0SiBFr9uS4ZmBx1Lfp+1S1fDOKU2fXaScfBxLpFn2LcoLQzQwm/a1 vhNg== X-Gm-Message-State: AOAM5301rSGFGkYkNZvwXbuZhLsNoibIRN9BN1orqbqCLGt4liPT+5K3 JxmS3m/H1pJTztVVAREmxGS24jtr/YnMFP61tA== X-Google-Smtp-Source: ABdhPJwiSiR4bn1y8b+XZlRt22ahvciV1GpZLr+0WhM6XiorrbM0HLuF1ngTNYm6hiHr1pyihO1QPf2nXRXguhRKAfU= X-Received: by 2002:a25:1c84:0:b0:65d:6c6b:25f7 with SMTP id c126-20020a251c84000000b0065d6c6b25f7mr32533296ybc.232.1654632228256; Tue, 07 Jun 2022 13:03:48 -0700 (PDT) MIME-Version: 1.0 References: <20220606155807.1414519-1-ptsneves@gmail.com> <20220607151123.3588947-1-ptsneves@gmail.com> In-Reply-To: From: Paulo Neves Date: Tue, 7 Jun 2022 22:03:36 +0200 Message-ID: Subject: Re: [OE-core] [PATCH v2 1/5] python: Avoid shebang overflow on python-config.py To: Alexander Kanavin Cc: OE-core Content-Type: multipart/alternative; boundary="00000000000033011305e0e116ea" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 07 Jun 2022 20:03:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166685 --00000000000033011305e0e116ea Content-Type: text/plain; charset="UTF-8" I think this patch will never be accepted because it hard-codes and depends on env. I recall that red hat for example does not accept the use of env, possibly for security reasons. Paulo Neves On Tue, Jun 7, 2022, 18:53 Alexander Kanavin wrote: > I'm not sure this is Inappropriate. Can you send this to upstream > nevertheless? > > Alex > > On Tue, 7 Jun 2022 at 17:11, Paulo Neves wrote: > > > > The native path may be too big, leading to shebang > > overflow. Just use the #!/usr/bin/env python3. > > > > Signed-off-by: Paulo Neves > > --- > > ...shebang-overflow-on-python-config.py.patch | 29 +++++++++++++++++++ > > .../recipes-devtools/python/python3_3.10.4.bb | 1 + > > 2 files changed, 30 insertions(+) > > create mode 100644 > meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch > > > > diff --git > a/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch > b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch > > new file mode 100644 > > index 0000000000..9f23278a30 > > --- /dev/null > > +++ > b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch > > @@ -0,0 +1,29 @@ > > +From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 2001 > > +From: Paulo Neves > > +Date: Tue, 7 Jun 2022 16:16:41 +0200 > > +Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py > > + > > +The whole native path may be too big, leading to shebang > > +overflow. Let's just use the env shebang. > > + > > +Upstream-Status: Inappropriate [distribution] > > +--- > > + Makefile.pre.in | 2 ++ > > + 1 file changed, 2 insertions(+) > > + > > +diff --git a/Makefile.pre.in b/Makefile.pre.in > > +index > f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715777cc76dabb31113176 > 100644 > > +--- a/Makefile.pre.in > > ++++ b/Makefile.pre.in > > +@@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-config.in > Misc/python-config.sh > > + @ # Substitution happens here, as the completely-expanded BINDIR > > + @ # is not available in configure > > + sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < > $(srcdir)/Misc/python-config.in >python-config.py > > ++ @ # Otherwise we might get huge shebangs with native paths > > ++ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py > > + @ # Replace makefile compat. variable references with shell > script compat. ones; $(VAR) -> ${VAR} > > + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < > Misc/python-config.sh >python-config > > + @ # In OpenEmbedded, always use the python version of the > script, the shell > > +-- > > +2.25.1 > > + > > diff --git a/meta/recipes-devtools/python/python3_3.10.4.bb > b/meta/recipes-devtools/python/python3_3.10.4.bb > > index 6bd3a6aba8..357025f856 100644 > > --- a/meta/recipes-devtools/python/python3_3.10.4.bb > > +++ b/meta/recipes-devtools/python/python3_3.10.4.bb > > @@ -34,6 +34,7 @@ SRC_URI = " > http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ > > > file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ > > > file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \ > > file://deterministic_imports.patch \ > > + file://0001-Avoid-shebang-overflow-on-python-config.py.patch > \ > > " > > > > SRC_URI:append:class-native = " \ > > -- > > 2.25.1 > > > > > > -=-=-=-=-=-=-=-=-=-=-=- > > Links: You receive all messages sent to this group. > > View/Reply Online (#166670): > https://lists.openembedded.org/g/openembedded-core/message/166670 > > Mute This Topic: https://lists.openembedded.org/mt/91602889/1686489 > > Group Owner: openembedded-core+owner@lists.openembedded.org > > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ > alex.kanavin@gmail.com] > > -=-=-=-=-=-=-=-=-=-=-=- > > > --00000000000033011305e0e116ea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think this patch will never be accepted because it hard= -codes and depends on env. I recall that red hat for example does not accep= t the use of env, possibly for security reasons.

Paulo Neves=C2=A0

On Tue, Jun 7, 2022, 18:53 Alexan= der Kanavin <alex.kanavin@gmai= l.com> wrote:
I'm not su= re this is Inappropriate. Can you send this to upstream nevertheless?

Alex

On Tue, 7 Jun 2022 at 17:11, Paulo Neves <ptsneves@gmail.com> wro= te:
>
> The native path may be too big, leading to shebang
> overflow. Just use the #!/usr/bin/env python3.
>
> Signed-off-by: Paulo Neves <ptsneves@gmail.com>
> ---
>=C2=A0 ...shebang-overflow-on-python-config.py.patch | 29 +++++++++++++= ++++++
>=C2=A0 .../recipes-devtools/python/python3_3.10.4.bb |=C2= =A0 1 +
>=C2=A0 2 files changed, 30 insertions(+)
>=C2=A0 create mode 100644 meta/recipes-devtools/python/python3/0001-Avo= id-shebang-overflow-on-python-config.py.patch
>
> diff --git a/meta/recipes-devtools/python/python3/0001-Avoid-shebang-o= verflow-on-python-config.py.patch b/meta/recipes-devtools/python/python3/00= 01-Avoid-shebang-overflow-on-python-config.py.patch
> new file mode 100644
> index 0000000000..9f23278a30
> --- /dev/null
> +++ b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow= -on-python-config.py.patch
> @@ -0,0 +1,29 @@
> +From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 200= 1
> +From: Paulo Neves <ptsneves@gmail.com>
> +Date: Tue, 7 Jun 2022 16:16:41 +0200
> +Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py
> +
> +The whole native path may be too big, leading to shebang
> +overflow. Let's just use the env shebang.
> +
> +Upstream-Status: Inappropriate [distribution]
> +---
> + Makefile.pre.in | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/Makefile.pre.in b/Makefile.pre.in
> +index f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715= 777cc76dabb31113176 100644
> +--- a/
Makefile.pre.in
> ++++ b/Makefile.pre.in
> +@@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-c= onfig.in Misc/python-config.sh
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@ # Substitution happens here, as the comp= letely-expanded BINDIR
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@ # is not available in configure
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0sed -e "s,@EXENAME@,$(BINDIR)/python$= (LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in = >python-config.py
> ++=C2=A0 =C2=A0 =C2=A0 @ # Otherwise we might get huge shebangs with n= ative paths
> ++=C2=A0 =C2=A0 =C2=A0 sed -i -e '1s|^#!.*|#!/usr/bin/env python3|= ' python-config.py
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@ # Replace makefile compat. variable refe= rences with shell script compat. ones; $(VAR) -> ${VAR}
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0LC_ALL=3DC sed -e 's,\$$(\([A-Za-z0-9_= ]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@=C2=A0 # In OpenEmbedded, always use the = python version of the script, the shell
> +--
> +2.25.1
> +
> diff --git a/meta/recipes-devtools/python/python3_3.10.4.bb<= /a> b/meta/recipes-devtools/python/python3_3.10.4.bb
> index 6bd3a6aba8..357025f856 100644
> --- a/meta/recipes-devtools/python/python3_3.10.4.bb
> +++ b/meta/recipes-devtools/python/python3_3.10.4.bb
> @@ -34,6 +34,7 @@ SRC_URI =3D "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.x= z \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file://0001-Lib-pty.py-= handle-stdin-I-O-errors-same-way-as-maste.patch \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file://0001-setup.py-Do= -not-detect-multiarch-paths-when-cross-co.patch \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file://deterministic_im= ports.patch \
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file://0001-Avoid-shebang-ov= erflow-on-python-config.py.patch \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"
>
>=C2=A0 SRC_URI:append:class-native =3D " \
> --
> 2.25.1
>
>
> -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
> Links: You receive all messages sent to this group.
> View/Reply Online (#166670): https://lists.openembedded.org/g/openembedded-core/message/1666= 70
> Mute This Topic: https://lists.ope= nembedded.org/mt/91602889/1686489
> Group Owner: openembedded-core+owner@lis= ts.openembedded.org
> Unsubscribe: https://lists.o= penembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
>
--00000000000033011305e0e116ea--