From 15f01c65f35af1f1defae386f1fccc3070397e00 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 4 Sep 2022 18:10:00 +0300 Subject: Import functions with adding SConscript namespace --- SCons/Script/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SCons/Script/__init__.py b/SCons/Script/__init__.py index aed31a5..c2c5e2d 100644 --- a/SCons/Script/__init__.py +++ b/SCons/Script/__init__.py @@ -126,8 +126,7 @@ GetBuildFailures = Main.GetBuildFailures #profiling = Main.profiling #repositories = Main.repositories -from . import SConscript -_SConscript = SConscript +from . import SConscript as _SConscript call_stack = _SConscript.call_stack -- cgit v0.12 From 061a76ccb6bf605022292b88ffe535c75c407d82 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 4 Sep 2022 18:20:33 +0300 Subject: Exec `EnsureSconsVersion` without init of default environment --- SCons/Script/SConscript.py | 8 +++++--- SCons/Script/__init__.py | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/SCons/Script/SConscript.py b/SCons/Script/SConscript.py index 548ef44..a85c12c 100644 --- a/SCons/Script/SConscript.py +++ b/SCons/Script/SConscript.py @@ -390,7 +390,8 @@ class SConsEnvironment(SCons.Environment.Base): in 'v_major' and 'v_minor', and 0 otherwise.""" return (major > v_major or (major == v_major and minor > v_minor)) - def _get_major_minor_revision(self, version_string): + @staticmethod + def _get_major_minor_revision(version_string): """Split a version string into major, minor and (optionally) revision parts. @@ -488,14 +489,15 @@ class SConsEnvironment(SCons.Environment.Base): def Default(self, *targets): SCons.Script._Set_Default_Targets(self, targets) - def EnsureSConsVersion(self, major, minor, revision=0): + @staticmethod + def EnsureSConsVersion(major, minor, revision=0): """Exit abnormally if the SCons version is not late enough.""" # split string to avoid replacement during build process if SCons.__version__ == '__' + 'VERSION__': SCons.Warnings.warn(SCons.Warnings.DevelopmentVersionWarning, "EnsureSConsVersion is ignored for development version") return - scons_ver = self._get_major_minor_revision(SCons.__version__) + scons_ver = SConsEnvironment._get_major_minor_revision(SCons.__version__) if scons_ver < (major, minor, revision): if revision: scons_ver_string = '%d.%d.%d' % (major, minor, revision) diff --git a/SCons/Script/__init__.py b/SCons/Script/__init__.py index c2c5e2d..029dc8e 100644 --- a/SCons/Script/__init__.py +++ b/SCons/Script/__init__.py @@ -287,14 +287,17 @@ def Variables(files=None, args=ARGUMENTS): return SCons.Variables.Variables(files, args) -# The list of global functions to add to the SConscript name space -# that end up calling corresponding methods or Builders in the +# Adding global functions to the SConscript name space. +# +# Static functions that do not use state in DefaultEnvironment(). +EnsureSConsVersion = _SConscript.SConsEnvironment.EnsureSConsVersion + +# Functions that end up calling methods or Builders in the # DefaultEnvironment(). GlobalDefaultEnvironmentFunctions = [ # Methods from the SConsEnvironment class, above. 'Default', 'EnsurePythonVersion', - 'EnsureSConsVersion', 'Exit', 'Export', 'GetLaunchDir', -- cgit v0.12 From d181182262be9b2262c781afff1f7e020f6f60de Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 4 Sep 2022 19:00:36 +0300 Subject: Add CHANGES.txt entry --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 957e683..d46a5d1 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -23,6 +23,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Ryan Saunders - Fixed runtest.py failure on Windows caused by excessive escaping of the path to python.exe. + From Anatoli Babenia + - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() + RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 From Joseph Brill: -- cgit v0.12 From 991c022c301f2bd2aa3bc3d7b0b0bef9f2e9da82 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Sun, 4 Sep 2022 19:14:14 +0300 Subject: Make EnsurePythonVersion static too --- CHANGES.txt | 3 ++- SCons/Script/SConscript.py | 3 ++- SCons/Script/__init__.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d46a5d1..d26b78c 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,7 +24,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fixed runtest.py failure on Windows caused by excessive escaping of the path to python.exe. From Anatoli Babenia - - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() + - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() and + EnsurePythonVersion(). RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 diff --git a/SCons/Script/SConscript.py b/SCons/Script/SConscript.py index a85c12c..99bb84d 100644 --- a/SCons/Script/SConscript.py +++ b/SCons/Script/SConscript.py @@ -507,7 +507,8 @@ class SConsEnvironment(SCons.Environment.Base): (scons_ver_string, SCons.__version__)) sys.exit(2) - def EnsurePythonVersion(self, major, minor): + @staticmethod + def EnsurePythonVersion(major, minor): """Exit abnormally if the Python version is not late enough.""" if sys.version_info < (major, minor): v = sys.version.split()[0] diff --git a/SCons/Script/__init__.py b/SCons/Script/__init__.py index 029dc8e..0250bd1 100644 --- a/SCons/Script/__init__.py +++ b/SCons/Script/__init__.py @@ -291,13 +291,13 @@ def Variables(files=None, args=ARGUMENTS): # # Static functions that do not use state in DefaultEnvironment(). EnsureSConsVersion = _SConscript.SConsEnvironment.EnsureSConsVersion +EnsurePythonVersion = _SConscript.SConsEnvironment.EnsurePythonVersion # Functions that end up calling methods or Builders in the # DefaultEnvironment(). GlobalDefaultEnvironmentFunctions = [ # Methods from the SConsEnvironment class, above. 'Default', - 'EnsurePythonVersion', 'Exit', 'Export', 'GetLaunchDir', -- cgit v0.12 From bcef632d5748f5afb66856e00e89ad7961e41491 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 6 Sep 2022 23:23:56 +0300 Subject: CHANGES.txt is sorted by last names --- CHANGES.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d26b78c..4f4b1e1 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,10 @@ NOTE: 4.3.0 now requires Python 3.6.0 and above. Python 3.5.x is no longer suppo RELEASE VERSION/DATE TO BE FILLED IN LATER + From Anatoli Babenia + - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() and + EnsurePythonVersion(). + From William Deegan: - Added ValidateOptions() which will check that all command line options are in either those specified by SCons itself, or by AddOption() in SConstruct/SConscript. It should @@ -23,10 +27,6 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Ryan Saunders - Fixed runtest.py failure on Windows caused by excessive escaping of the path to python.exe. - From Anatoli Babenia - - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() and - EnsurePythonVersion(). - RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 From Joseph Brill: -- cgit v0.12 From 66ccceb2e2ee98ae7c20a589bef8ae1f36fd6ea0 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Tue, 6 Sep 2022 23:25:37 +0300 Subject: Nitpick : at the end of last name lines --- CHANGES.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4f4b1e1..8e32f3d 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,7 +9,7 @@ NOTE: 4.3.0 now requires Python 3.6.0 and above. Python 3.5.x is no longer suppo RELEASE VERSION/DATE TO BE FILLED IN LATER - From Anatoli Babenia + From Anatoli Babenia: - Do not initialize DefaultEnvironment when calling EnsureSConsVersion() and EnsurePythonVersion(). @@ -21,10 +21,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Dan Mezhiborsky: - Add newline to end of compilation db (compile_commands.json). - From Flaviu Tamas + From Flaviu Tamas: - Added -fsanitize support to ParseFlags(). This will propagate to CCFLAGS and LINKFLAGS. - From Ryan Saunders + From Ryan Saunders: - Fixed runtest.py failure on Windows caused by excessive escaping of the path to python.exe. RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 -- cgit v0.12 From 5299c8fd6fd899cabfcf86063586bf31801ef298 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Wed, 7 Sep 2022 05:48:05 +0300 Subject: Update RELEASE.txt --- RELEASE.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE.txt b/RELEASE.txt index 3eff8ad..93d47f1 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -29,6 +29,8 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY --------------------------------------- - Added -fsanitize support to ParseFlags(). This will propagate to CCFLAGS and LINKFLAGS. +- Calling EnsureSConsVersion() and EnsurePythonVersion() won't initialize + DefaultEnvironment anymore. FIXES ----- -- cgit v0.12