[packages/kitty: 2/2] Add num-workers workaround

glen glen at pld-linux.org
Wed Feb 22 15:57:52 CET 2023


commit ae545fb2edec3bc476ef14d92e7dd2c4b31e9021
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Wed Feb 22 16:54:42 2023 +0200

    Add num-workers workaround
    
    - https://github.com/kovidgoyal/kitty/issues/6050

 kitty.spec        |  2 ++
 num-workers.patch | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)
---
diff --git a/kitty.spec b/kitty.spec
index bfc5cfd..74b51da 100644
--- a/kitty.spec
+++ b/kitty.spec
@@ -19,6 +19,7 @@ Source1:	https://raw.githubusercontent.com/kovidgoyal/kitty/46c0951751444e4f4994
 # Source1-md5:	702c51cea58e8b0fb8fd67da9da3802a
 Source2:	%{name}.sh
 Source3:	%{name}.fish
+Patch0:		num-workers.patch
 BuildRequires:	appstream-glib
 BuildRequires:	dbus-devel
 BuildRequires:	desktop-file-utils
@@ -151,6 +152,7 @@ rm -rf $RPM_BUILD_ROOT
 %set_build_flags
 export CC="%{__cc}"
 export CXX="%{__cxx}"
+export NUM_WORKERS=1
 %{__python3} setup.py linux-package \
     --libdir-name=%{_lib} \
     --prefix=$RPM_BUILD_ROOT%{_prefix} \
diff --git a/num-workers.patch b/num-workers.patch
new file mode 100644
index 0000000..e40bd9b
--- /dev/null
+++ b/num-workers.patch
@@ -0,0 +1,23 @@
+Force 1 num worker:
+- https://github.com/kovidgoyal/kitty/issues/6050
+
+--- kitty-0.27.1/setup.py~	2023-02-22 16:41:43.000000000 +0200
++++ kitty-0.27.1/setup.py	2023-02-22 16:45:34.114098801 +0200
+@@ -573,7 +573,7 @@
+ 
+ def parallel_run(items: List[Command]) -> None:
+     try:
+-        num_workers = max(2, os.cpu_count() or 1)
++        num_workers = int(os.environ.get('NUM_WORKERS', max(2, os.cpu_count() or 1)))
+     except Exception:
+         num_workers = 2
+     items = list(reversed(items))
+@@ -1064,7 +1064,7 @@
+     import compileall
+     import py_compile
+     try:
+-        num_workers = max(1, os.cpu_count() or 1)
++        num_workers = int(os.environ.get('NUM_WORKERS', max(2, os.cpu_count() or 1)))
+     except Exception:
+         num_workers = 1
+     for root, dirs, files in os.walk(base_path):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kitty.git/commitdiff/ae545fb2edec3bc476ef14d92e7dd2c4b31e9021



More information about the pld-cvs-commit mailing list