From 37db095af1d6fdc91074a1c8d6e9883a8d90292845c64de0bce8eeb5dbfddc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 6 Nov 2017 10:17:42 +0000 Subject: [PATCH] Accepting request 539227 from home:pluskalm:python3 - Add scons-fix_py3_syspath_explosion.patch OBS-URL: https://build.opensuse.org/request/show/539227 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/scons?expand=0&rev=51 --- scons-fix_py3_syspath_explosion.patch | 40 +++++++++++++++++++++++++++ scons.changes | 5 ++++ scons.spec | 3 ++ 3 files changed, 48 insertions(+) create mode 100644 scons-fix_py3_syspath_explosion.patch diff --git a/scons-fix_py3_syspath_explosion.patch b/scons-fix_py3_syspath_explosion.patch new file mode 100644 index 0000000..1a19c66 --- /dev/null +++ b/scons-fix_py3_syspath_explosion.patch @@ -0,0 +1,40 @@ +From 874dba0c35cd8f6459ddbdfcdaf8be12307cd038 Mon Sep 17 00:00:00 2001 +From: William Deegan +Date: Thu, 12 Oct 2017 23:13:49 -0400 +Subject: [PATCH] Fix issue with Tool loading logic where sys.path was getting + an addition site_scons/site_tools path prepended with every tool loaded when + running with Python 3.5+. + +--- + src/engine/SCons/Tool/__init__.py | 10 ++++++++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py +index 57090bbe..a4e44a0f 100644 +--- a/src/engine/SCons/Tool/__init__.py ++++ b/src/engine/SCons/Tool/__init__.py +@@ -222,8 +222,10 @@ def _tool_module(self): + + # Don't reload a tool we already loaded. + sys_modules_value = sys.modules.get(found_name,False) ++ ++ found_module = None + if sys_modules_value and sys_modules_value.__file__ == spec.origin: +- return sys.modules[found_name] ++ found_module = sys.modules[found_name] + else: + # Not sure what to do in the case that there already + # exists sys.modules[self.name] but the source file is +@@ -235,7 +237,11 @@ def _tool_module(self): + # If we found it in SCons.Tool, then add it to the module + setattr(SCons.Tool, self.name, module) + +- return module ++ found_module = module ++ ++ if found_module is not None: ++ sys.path = oldpythonpath ++ return found_module + + + sys.path = oldpythonpath diff --git a/scons.changes b/scons.changes index e7a77e2..f8526d6 100644 --- a/scons.changes +++ b/scons.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 6 08:40:54 UTC 2017 - mpluskal@suse.com + +- Add scons-fix_py3_syspath_explosion.patch + ------------------------------------------------------------------- Fri Nov 3 11:22:45 UTC 2017 - mpluskal@suse.com diff --git a/scons.spec b/scons.spec index 9b45a89..578706b 100644 --- a/scons.spec +++ b/scons.spec @@ -29,6 +29,8 @@ Source1: scons-user.html-%{version}.tar.bz2 # Sets _mandir to _datadir/man instead of _prefix/man Patch0: %{name}-3.0.0-fix-install.patch Patch1: scons-3.0.0-support-python-2-prints.patch +# PATCH-FIX-UPSTREAM scons-fix_py3_syspath_explosion.patch +Patch2: scons-fix_py3_syspath_explosion.patch BuildRequires: fdupes BuildRequires: python3-devel >= 3.5 BuildArch: noarch @@ -44,6 +46,7 @@ full power of Python to control compilation. %setup -q -a1 %patch0 -p1 %patch1 -p1 +%patch2 -p2 # fix libdir for qt patch -p0 <