diff options
author | William Deegan <bill@baddogconsulting.com> | 2023-03-06 23:11:13 -0500 |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2023-03-06 23:11:13 -0500 |
commit | 3dc74b18eccbd9561128ed1c608a13009a39915c (patch) | |
tree | 0a9f74262bcffc43e75ab741bfef1e87890d8da2 | |
parent | e2b614ddb9c9b1b0e2241e6aff7432a488529e74 (diff) | |
download | scons-git-3dc74b18eccbd9561128ed1c608a13009a39915c.tar.gz |
added example code which demonstrates the problem introduced in 4.5.0 and fixed in 4.5.1
-rw-r--r-- | CHANGES.txt | 12 | ||||
-rw-r--r-- | RELEASE.txt | 16 | ||||
-rw-r--r-- | SCons/EnvironmentTests.py | 18 | ||||
-rw-r--r-- | SCons/Util/__init__.py | 1 |
4 files changed, 31 insertions, 16 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 6721d4544..997d9d6cb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,9 +10,15 @@ NOTE: 4.3.0 now requires Python 3.6.0 and above. Python 3.5.x is no longer suppo RELEASE 4.5.1 From Mats Wichmann - - Fix a problem in 4.5.0 where in some circumstances a Clone environment - could share the CPPDEFINES data structure with the original, causing - leakage when they should be completely independent after the Clone. + - Fix a problem in 4.5.0 where using something like the following code + will cause a Clone()'d environment to share the CPPDEFINES with the + original Environment() which was cloned. Causing leakage of changes + to CPPDEFINES when they should be completely independent after the Clone. + env=Environment(CPPDEFINES=['a']) + env.Append(CPPDEFINES=['b']) (or AppendUnique,Prepend,PrependUnique) + env1=env.Clone() + env1.Append(CPPDEFINES=['c']) (or any other modification, but not overwriting CPPDEFINES + Now env['CPPDEFINES'] will contain 'c' when it should not. RELEASE 4.5.0 - Sun, 05 Mar 2023 14:08:29 -0700 diff --git a/RELEASE.txt b/RELEASE.txt index 0726607a3..42e4465b9 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -6,7 +6,7 @@ Past official release announcements appear at: ================================================================== -A new SCons release, 4.4.1, is now available on the SCons download page: +A new SCons release, 4.5.1, is now available on the SCons download page: https://scons.org/pages/download.html @@ -32,9 +32,17 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY FIXES ----- -- Fix a problem in 4.5.0 where in some circumstances a Clone environment - could share the CPPDEFINES data structure with the original, causing - leakage when they should be completely independent after the Clone. +- Fix a problem in 4.5.0 where using something like the following code + will cause a Clone()'d environment to share the CPPDEFINES with the + original Environment() which was cloned. Causing leakage of changes + to CPPDEFINES when they should be completely independent after the Clone. + env=Environment(CPPDEFINES=['a']) + env.Append(CPPDEFINES=['b']) (or AppendUnique,Prepend,PrependUnique) + env1=env.Clone() + env1.Append(CPPDEFINES=['c']) (or any other modification, but not overwriting CPPDEFINES) + Now env['CPPDEFINES'] will contain 'c' when it should not. + + IMPROVEMENTS ------------ diff --git a/SCons/EnvironmentTests.py b/SCons/EnvironmentTests.py index 0f429b492..fb089b1a5 100644 --- a/SCons/EnvironmentTests.py +++ b/SCons/EnvironmentTests.py @@ -1869,15 +1869,15 @@ def exists(env): ZZZ=UD({1: 2, 3: 4}), ) env2 = env1.Clone() - env2.Dictionary('XXX').append(4) - env2.Dictionary('YYY').append(4) - env2.Dictionary('ZZZ')[5] = 6 - self.assertIn(4, env2.Dictionary('XXX')) - self.assertNotIn(4, env1.Dictionary('XXX')) - self.assertIn(4, env2.Dictionary('YYY')) - self.assertNotIn(4, env1.Dictionary('YYY')) - self.assertIn(5, env2.Dictionary('ZZZ')) - self.assertNotIn(5, env1.Dictionary('ZZZ')) + env2['XXX'].append(4) + env2['YYY'].append(4) + env2['ZZZ'][5] = 6 + self.assertIn(4, env2['XXX']) + self.assertNotIn(4, env1['XXX']) + self.assertIn(4, env2['YYY']) + self.assertNotIn(4, env1['YYY']) + self.assertIn(5, env2['ZZZ']) + self.assertNotIn(5, env1['ZZZ']) # BUILDERS is special... with self.subTest(): diff --git a/SCons/Util/__init__.py b/SCons/Util/__init__.py index ffc636414..2760298b5 100644 --- a/SCons/Util/__init__.py +++ b/SCons/Util/__init__.py @@ -516,6 +516,7 @@ _semi_deepcopy_dispatch = { tuple: _semi_deepcopy_tuple, } + def semi_deepcopy(obj): copier = _semi_deepcopy_dispatch.get(type(obj)) if copier: |