[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH 29/30] Revert "python3-setuptools: patch entrypoints for faster initialization"
From:       "Trevor Gamblin" <trevor.gamblin () windriver ! com>
Date:       2020-06-30 14:13:09
Message-ID: e64c6f47-c724-841c-e8ff-dc7feb8aa19d () windriver ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On 6/26/20 3:18 AM, Alexander Kanavin wrote:
> Apologies, but the patch is not possible to rebase onto the new setuptools,
> as the code has changed too much. Please get it accepted upstream first.

That's fine. Their changes to setuptools actually address the same 
issue, although it's not as significant an improvement (the patch file I 
had submitted was about 2x as fast). Still, carrying the official fix is 
the better option.

Trevor

> 
> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> ---
> .../python/python-setuptools.inc              |  4 +-
> ...nt-usr-bin-wrappers-signoff-included.patch | 62 -------------------
> 2 files changed, 1 insertion(+), 65 deletions(-)
> delete mode 100644 \
> meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch
>  
> diff --git a/meta/recipes-devtools/python/python-setuptools.inc \
> b/meta/recipes-devtools/python/python-setuptools.inc index 3222de7079..9322ca9a05 \
>                 100644
> --- a/meta/recipes-devtools/python/python-setuptools.inc
> +++ b/meta/recipes-devtools/python/python-setuptools.inc
> @@ -10,9 +10,7 @@ inherit pypi
> 
> SRC_URI_append_class-native = " \
> file://0001-conditionally-do-not-fetch-code-by-easy_install.patch" 
> -SRC_URI += "file://0001-change-shebang-to-python3.patch \
> -            file://0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch \
>                 \
> -            "
> +SRC_URI += "file://0001-change-shebang-to-python3.patch"
> 
> SRC_URI[md5sum] = "6e9de90b242fdd60ef59f497424ce13a"
> SRC_URI[sha256sum] = \
>                 "145fa62b9d7bb544fce16e9b5a9bf4ab2032d2f758b7cd674af09a92736aff74"
> diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch \
> b/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch
>  deleted file mode 100644
> index 7e931c845c..0000000000
> --- a/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch
>                 
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -From aae8cd3de3f289cea3db01212579913c925191e8 Mon Sep 17 00:00:00 2001
> -From: Lauri Tirkkonen <lauri.tirkkonen.ext@nokia.com>
> -Date: Thu, 26 Mar 2020 14:24:25 +0000
> -Subject: [PATCH] ScriptWriter: create more efficient /usr/bin wrappers
> -
> -Upstream setuptools writes scripts to /usr/bin that do insanely much
> -stuff at runtime. https://github.com/pypa/setuptools/issues/510
> -
> -Since the script entry points are already known at build time, we can
> -just write those directly into the /usr/bin wrapper, avoiding the
> -expensive 'pkg_resources' import at runtime. The idea is from
> -https://github.com/ninjaaron/fast-entry_points but patched directly into
> -the native build of setuptools here, so that all Python modules under
> -bitbake automatically use it without needing additional build time
> -dependencies.
> -
> -Upstream-Status: Pending
> -
> -Signed-off-by: Lauri Tirkkonen <lauri.tirkkonen.ext@nokia.com>
> -Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
> ----
> - setuptools/command/easy_install.py | 14 ++++++--------
> - 1 file changed, 6 insertions(+), 8 deletions(-)
> -
> -diff --git a/setuptools/command/easy_install.py \
>                 b/setuptools/command/easy_install.py
> -index 8fba7b41..03a72714 100755
> ---- a/setuptools/command/easy_install.py
> -+++ b/setuptools/command/easy_install.py
> -@@ -2023,17 +2023,12 @@ class ScriptWriter(object):
> -     """
> -
> -     template = textwrap.dedent(r"""
> --        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
> --        __requires__ = %(spec)r
> --        import re
> -         import sys
> --        from pkg_resources import load_entry_point
> -+
> -+        from %(module)s import %(ep0)s
> -
> -         if __name__ == '__main__':
> --            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
> --            sys.exit(
> --                load_entry_point(%(spec)r, %(group)r, %(name)r)()
> --            )
> -+            sys.exit(%(entrypoint)s())
> -     """).lstrip()
> -
> -     command_spec_class = CommandSpec
> -@@ -2068,6 +2063,9 @@ class ScriptWriter(object):
> -         for type_ in 'console', 'gui':
> -             group = type_ + '_scripts'
> -             for name, ep in dist.get_entry_map(group).items():
> -+                module = ep.module_name
> -+                ep0 = ep.attrs[0]
> -+                entrypoint = '.'.join(ep.attrs)
> -                 cls._ensure_safe_name(name)
> -                 script_text = cls.template % locals()
> -                 args = cls._get_script_args(type_, name, header, script_text)
> ---
> -2.24.1
> -
> 
> 


[Attachment #5 (text/html)]

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 6/26/20 3:18 AM, Alexander Kanavin
      wrote:<br>
    </div>
    <blockquote type="cite" \
                cite="mid:20200626071844.29134-29-alex.kanavin@gmail.com">
      <pre class="moz-quote-pre" wrap="">Apologies, but the patch is not possible to \
rebase onto the new setuptools, as the code has changed too much. Please get it \
accepted upstream first.</pre>  </blockquote>
    <p>That's fine. Their changes to setuptools actually address the
      same issue, although it's not as significant an improvement (the
      patch file I had submitted was about 2x as fast). Still, carrying
      the official fix is the better option.</p>
    <p>Trevor<br>
    </p>
    <blockquote type="cite" \
cite="mid:20200626071844.29134-29-alex.kanavin@gmail.com">  <pre \
class="moz-quote-pre" wrap="">

Signed-off-by: Alexander Kanavin <a class="moz-txt-link-rfc2396E" \
                href="mailto:alex.kanavin@gmail.com">&lt;alex.kanavin@gmail.com&gt;</a>
                
---
 .../python/python-setuptools.inc              |  4 &#43;-
 ...nt-usr-bin-wrappers-signoff-included.patch | 62 -------------------
 2 files changed, 1 insertion(&#43;), 65 deletions(-)
 delete mode 100644 meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch


diff --git a/meta/recipes-devtools/python/python-setuptools.inc \
b/meta/recipes-devtools/python/python-setuptools.inc index 3222de7079..9322ca9a05 \
                100644
--- a/meta/recipes-devtools/python/python-setuptools.inc
&#43;&#43;&#43; b/meta/recipes-devtools/python/python-setuptools.inc
@@ -10,9 &#43;10,7 @@ inherit pypi
 
 SRC_URI_append_class-native = <a class="moz-txt-link-rfc2396E" \
href="file://0001-conditionally-do-not-fetch-code-by-easy_install.patch">&quot; \
file://0001-conditionally-do-not-fetch-code-by-easy_install.patch&quot;</a>  
-SRC_URI &#43;= <a class="moz-txt-link-rfc2396E" \
href="file://0001-change-shebang-to-python3.patch\-file://0001-ScriptWriter-create-mor \
e-efficient-usr-bin-wrappers-signoff-included.patch\-">&quot;file://0001-change-shebang-to-python3.patch \
                \
-            file://0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch \
                \
-            &quot;</a>
&#43;SRC_URI &#43;= <a class="moz-txt-link-rfc2396E" \
href="file://0001-change-shebang-to-python3.patch">&quot;file://0001-change-shebang-to-python3.patch&quot;</a>
  
 SRC_URI[md5sum] = &quot;6e9de90b242fdd60ef59f497424ce13a&quot;
 SRC_URI[sha256sum] = \
                &quot;145fa62b9d7bb544fce16e9b5a9bf4ab2032d2f758b7cd674af09a92736aff74&quot;
                
diff --git a/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch \
b/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch
 deleted file mode 100644
index 7e931c845c..0000000000
--- a/meta/recipes-devtools/python/python3-setuptools/0001-ScriptWriter-create-more-efficient-usr-bin-wrappers-signoff-included.patch
 &#43;&#43;&#43; /dev/null
@@ -1,62 &#43;0,0 @@
-From aae8cd3de3f289cea3db01212579913c925191e8 Mon Sep 17 00:00:00 2001
-From: Lauri Tirkkonen <a class="moz-txt-link-rfc2396E" \
                href="mailto:lauri.tirkkonen.ext@nokia.com">&lt;lauri.tirkkonen.ext@nokia.com&gt;</a>
                
-Date: Thu, 26 Mar 2020 14:24:25 &#43;0000
-Subject: [PATCH] ScriptWriter: create more efficient /usr/bin wrappers
-
-Upstream setuptools writes scripts to /usr/bin that do insanely much
-stuff at runtime. <a class="moz-txt-link-freetext" \
href="https://github.com/pypa/setuptools/issues/510">https://github.com/pypa/setuptools/issues/510</a>
                
-
-Since the script entry points are already known at build time, we can
-just write those directly into the /usr/bin wrapper, avoiding the
-expensive 'pkg_resources' import at runtime. The idea is from
-https://github.com/ninjaaron/fast-entry_points but patched directly into
-the native build of setuptools here, so that all Python modules under
-bitbake automatically use it without needing additional build time
-dependencies.
-
-Upstream-Status: Pending
-
-Signed-off-by: Lauri Tirkkonen <a class="moz-txt-link-rfc2396E" \
                href="mailto:lauri.tirkkonen.ext@nokia.com">&lt;lauri.tirkkonen.ext@nokia.com&gt;</a>
                
-Signed-off-by: Trevor Gamblin <a class="moz-txt-link-rfc2396E" \
                href="mailto:trevor.gamblin@windriver.com">&lt;trevor.gamblin@windriver.com&gt;</a>
                
----
- setuptools/command/easy_install.py | 14 &#43;&#43;&#43;&#43;&#43;&#43;--------
- 1 file changed, 6 insertions(&#43;), 8 deletions(-)
-
-diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
-index 8fba7b41..03a72714 100755
---- a/setuptools/command/easy_install.py
-&#43;&#43;&#43; b/setuptools/command/easy_install.py
-@@ -2023,17 &#43;2023,12 @@ class ScriptWriter(object):
-     &quot;&quot;&quot;
- 
-     template = textwrap.dedent(r&quot;&quot;&quot;
--        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
--        __requires__ = %(spec)r
--        import re
-         import sys
--        from pkg_resources import load_entry_point
-&#43;
-&#43;        from %(module)s import %(ep0)s
- 
-         if __name__ == '__main__':
--            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
--            sys.exit(
--                load_entry_point(%(spec)r, %(group)r, %(name)r)()
--            )
-&#43;            sys.exit(%(entrypoint)s())
-     &quot;&quot;&quot;).lstrip()
- 
-     command_spec_class = CommandSpec
-@@ -2068,6 &#43;2063,9 @@ class ScriptWriter(object):
-         for type_ in 'console', 'gui':
-             group = type_ &#43; '_scripts'
-             for name, ep in dist.get_entry_map(group).items():
-&#43;                module = ep.module_name
-&#43;                ep0 = ep.attrs[0]
-&#43;                entrypoint = '.'.join(ep.attrs)
-                 cls._ensure_safe_name(name)
-                 script_text = cls.template % locals()
-                 args = cls._get_script_args(type_, name, header, script_text)
--- 
-2.24.1
-
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
  </body>
</html>



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140134): https://lists.openembedded.org/g/openembedded-core/message/140134
Mute This Topic: https://lists.openembedded.org/mt/75119971/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic