Skip to content

Commit 9606606

Browse files
authored
Merge branch 'master' into maint/Value
2 parents 4e940fa + f3bad91 commit 9606606

24 files changed

+337
-296
lines changed

CHANGES.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ NOTE: 4.3.0 now requires Python 3.6.0 and above. Python 3.5.x is no longer suppo
99

1010
RELEASE VERSION/DATE TO BE FILLED IN LATER
1111

12+
From Mats Wichmann:
13+
14+
- Updated Value Node docs and tests.
15+
16+
17+
RELEASE 4.7.0 - Sun, 17 Mar 2024 17:22:20 -0700
18+
1219
From Ataf Fazledin Ahamed:
1320
- Use of NotImplemented instead of NotImplementedError for special methods
1421
of _ListVariable class
@@ -44,14 +51,15 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
4451
prototype when including a header file.
4552

4653
From Thaddeus Crews:
54+
- Explicitly wrap non-serializable values in json dump
4755
- Implemented SCons.Util.sctyping as a safe means of hinting complex types. Currently
4856
only implemented for `Executor` as a proof-of-concept.
4957

5058
From William Deegan:
5159
- Fix sphinx config to handle SCons versions with post such as: 4.6.0.post1
5260

5361
From Michał Górny:
54-
- Remove unecessary dependencies on pypi packages from setup.cfg
62+
- Remove unnecessary dependencies on pypi packages from setup.cfg
5563

5664
From Sten Grüner:
5765
- Fix of the --debug=sconscript option to return exist statements when using return
@@ -108,7 +116,11 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
108116
DeprecatedMissingSConscriptWarning) add two warnings to manpage
109117
(cache-cleanup-error, future-reserved-variable), improve unittest, tweak
110118
Sphinx build.
111-
- Updated Value Node docs and tests.
119+
- Add locking around creation of CacheDir config file. Fixes #4489.
120+
- Clarify MergeFlags usage of a dict argument.
121+
- SCons documentation build can now be controlled through SKIP_DOC
122+
variable - rather than just true/false can now specify
123+
skip none, skip all, skip pdf docs, skip api docs.
112124

113125

114126
RELEASE 4.6.0 - Sun, 19 Nov 2023 17:22:20 -0700

README-SF.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ By default, the above commands will do the following:
134134
- Install scripts named "scons" and "sconsign" scripts in the default system
135135
script directory (/usr/bin or C:\\Python\*\\Scripts, for example).
136136

137-
- Install "scons-4.5.1.exe" and "scons.exe" executables in the Python
137+
- Install "scons-4.7.0.exe" and "scons.exe" executables in the Python
138138
prefix directory on Windows (C:\\Python\*, for example).
139139

140140
- Install the SCons build engine (a Python module) in the standard Python library directory
@@ -391,7 +391,7 @@ about `Executing SCons Without Installing`_)::
391391
Depending on the utilities installed on your system, any or all of the
392392
following packages will be built::
393393

394-
SCons-4.5.1-py3-none-any.whl
394+
SCons-4.7.0-py3-none-any.whl
395395
SCons-4.7.0ayyyymmdd.tar.gz
396396
SCons-4.7.0ayyyymmdd.zip
397397
scons-doc-4.7.0ayyyymmdd.tar.gz

README-package.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,5 @@ For More Information
192192
Check the SCons web site at https://www.scons.org/
193193

194194

195-
Copyright (c) 2001 - 2021 The SCons Foundation
195+
Copyright (c) 2001 - 2024 The SCons Foundation
196196

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,4 @@ many contributors, including but not at all limited to:
299299

300300
\... and many others.
301301

302-
Copyright (c) 2001 - 2021 The SCons Foundation
302+
Copyright (c) 2001 - 2024 The SCons Foundation

RELEASE.txt

Lines changed: 13 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,17 @@ Past official release announcements appear at:
66

77
==================================================================
88

9-
A new SCons release, 4.6.1, is now available on the SCons download page:
9+
A new SCons release, 4.7.1, is now available on the SCons download page:
1010

1111
https://scons.org/pages/download.html
1212

1313

14-
Here is a summary of the changes since 4.6.0:
14+
Here is a summary of the changes since 4.7.0:
1515

1616
NEW FUNCTIONALITY
1717
-----------------
1818

19-
- Method unlink_files was added to the TestCmd class that unlinks a list of files
20-
from a specified directory. An attempt to unlink a file is made only when the
21-
file exists; otherwise, the file is ignored.
22-
19+
- List new features (presumably why a checkpoint is being released)
2320

2421
DEPRECATED FUNCTIONALITY
2522
------------------------
@@ -29,90 +26,41 @@ DEPRECATED FUNCTIONALITY
2926
CHANGED/ENHANCED EXISTING FUNCTIONALITY
3027
---------------------------------------
3128

32-
- Add an optional argument list string to configure's CheckFunc method so
33-
that the generated function argument list matches the function's
34-
prototype when including a header file. Fixes GH Issue #4320
35-
- Now supports pre-release Python 3.13
36-
- Support for Python versions without support for the `threading` package has been removed
37-
- Dropped three unused warning classes: DeprecatedSourceCodeWarning,
38-
TaskmasterNeedsExecuteWarning, DeprecatedMissingSConscriptWarning.
39-
* Two warning classes that are actually used were added to manpage section on
40-
enabling warnings (cache-cleanup-error, future-reserved-variable).
29+
- List modifications to existing features, where the previous behavior
30+
wouldn't actually be considered a bug
4131

4232
FIXES
4333
-----
4434

45-
- Fix of the --debug=sconscript option to return exist statements when using return
46-
statement with stop flag enabled
47-
- MSVS: prevent overwriting the SCons environment variable SCONS_HOME with the OS
48-
environment value of SCONS_HOME in the msvs tool.
49-
- MSVC: Fix the detection of Visual Studio 2015 Express ('14.0Exp') by adding a
50-
registry key definition and updating the installation root-relative registry value
51-
at runtime for the location of the VC folder.
52-
- MSVS: Fix the msvs project generation test for MSVS 6.0 to use the correct name of
53-
the generated project file.
54-
- MSVS: Fix the msvs project generation test scripts so that "false positive" tests
55-
results are not possible when the initial build is successful and the command-line
56-
build of the project file fails.
57-
- On Windows platform, when collecting command output (Configure checks),
58-
make sure decoding of bytes doesn't fail.
59-
- Documentation indicated that both Pseudo() and env.Pseudo() were usable,
60-
but Pseudo() did not work; is now enabled.
61-
- Improve handling of file data that SCons itself processes - as in
62-
scanners - try harder to decode non-UTF-8 text.
63-
- PyPackageDir no longer fails if passed a module name which cannot be found,
64-
now returns None.
65-
35+
- List fixes of outright bugs
6636

6737
IMPROVEMENTS
6838
------------
6939

70-
- Use of NotImplemented instead of NotImplementedError for special methods
71-
of _ListVariable class
72-
- The NewParallel scheduler is now the default, the `tm_v2` flag is removed,
73-
and the old scheduler is opt-in under `--experimental=legacy_sched`. Additionally,
74-
the new scheduler is now used for -j1 builds as well.
75-
NOTE: This should significantly improve SCons performance for larger parallel builds
76-
(Larger -j values)
77-
- CacheDir writes no longer happen within the taskmaster critical section, and therefore
78-
can run in parallel with both other CacheDir writes and the taskmaster DAG walk.
79-
- The NewParallel scheduler now only adds threads as new work requiring execution
80-
is discovered, up to the limit set by -j. This should reduce resource utilization
81-
when the achievable parallelism in the DAG is less than the -j limit.
82-
40+
- List improvements that wouldn't be visible to the user in the
41+
documentation: performance improvements (describe the circumstances
42+
under which they would be observed), or major code cleanups
8343

8444
PACKAGING
8545
---------
8646

87-
- Remove unecessary dependencies on pypi packages from setup.cfg
47+
- List changes in the way SCons is packaged and/or released
8848

8949

9050
DOCUMENTATION
9151
-------------
9252

93-
- Fixed the Scanner examples in the User Guide to be runnable and added
94-
some more explanation. Clarified discussion of the scanner function in
95-
the Scanner Objects section of the manpage.
96-
- The manpage entry for Pseudo was clarified.
97-
- The manpage entry for SharedLibrary was clarified.
98-
- Update API docs for Warnings framework; add two warns to manpage
99-
enable/disable control.
100-
- More consistent use of &Python; in the manpage. A few links added.
101-
A warning about overwriting env['ENV'] and one about Configure
102-
checks possibly not running in in no-exec mode also added.
103-
- Clarify how SCons finds the project top directory, and what that is used for.
10453
- Updated Value Node docs.
10554

10655

56+
10757
DEVELOPMENT
10858
-----------
10959

110-
- Fix sphinx config to handle SCons versions with post such as: 4.6.0.post1
111-
- Created SCons.Util.sctyping to contain complex type information, allowing
112-
for repo-wide type hinting without causing cyclical dependencies.
60+
- List visible changes in the way SCons is developed
11361

11462
Thanks to the following contributors listed below for their contributions to this release.
11563
==========================================================================================
11664
.. code-block:: text
11765

118-
git shortlog --no-merges -ns 4.6.0..HEAD
66+
git shortlog --no-merges -ns 4.0.1..HEAD

ReleaseConfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# If the release type is not 'final', the patchlevel is set to the
3232
# release date. This value is mandatory and must be present in this file.
3333
#version_tuple = (2, 2, 0, 'final', 0)
34-
version_tuple = (4, 6, 1, 'a', 0)
34+
version_tuple = (4, 6, 2, 'a', 0)
3535

3636
# Python versions prior to unsupported_python_version cause a fatal error
3737
# when that version is used. Python versions prior to deprecate_python_version

SCons/CacheDir.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import SCons.Action
3535
import SCons.Errors
3636
import SCons.Warnings
37-
import SCons
37+
import SCons.Util
3838

3939
cache_enabled = True
4040
cache_debug = False
@@ -169,15 +169,16 @@ def _readconfig(self, path):
169169
"""
170170
config_file = os.path.join(path, 'config')
171171
try:
172+
# still use a try block even with exist_ok, might have other fails
172173
os.makedirs(path, exist_ok=True)
173-
except FileExistsError:
174-
pass
175174
except OSError:
176175
msg = "Failed to create cache directory " + path
177176
raise SCons.Errors.SConsEnvironmentError(msg)
178177

179178
try:
180-
with open(config_file, 'x') as config:
179+
with SCons.Util.FileLock(config_file, timeout=5, writer=True), open(
180+
config_file, "x"
181+
) as config:
181182
self.config['prefix_len'] = 2
182183
try:
183184
json.dump(self.config, config)
@@ -186,9 +187,11 @@ def _readconfig(self, path):
186187
raise SCons.Errors.SConsEnvironmentError(msg)
187188
except FileExistsError:
188189
try:
189-
with open(config_file) as config:
190+
with SCons.Util.FileLock(config_file, timeout=5, writer=False), open(
191+
config_file
192+
) as config:
190193
self.config = json.load(config)
191-
except ValueError:
194+
except (ValueError, json.decoder.JSONDecodeError):
192195
msg = "Failed to read cache configuration for " + path
193196
raise SCons.Errors.SConsEnvironmentError(msg)
194197

SCons/Environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ def Dump(self, key=None, format: str='pretty'):
17201720
elif fmt == 'json':
17211721
import json
17221722
def non_serializable(obj):
1723-
return str(type(obj).__qualname__)
1723+
return '<<non-serializable: %s>>' % type(obj).__qualname__
17241724
return json.dumps(cvars, indent=4, default=non_serializable)
17251725
else:
17261726
raise ValueError("Unsupported serialization format: %s." % fmt)

SCons/Environment.xml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ In this case, space-separated strings are not split.</para>
638638
</listitem>
639639
<listitem>
640640
<para>A dictionary is processed in order,
641-
adding each key:value pair as a valued macro.
641+
adding each key-value pair as a valued macro.
642642
Use the value <constant>None</constant> if the macro should not have a value.
643643
</para>
644644
</listitem>
@@ -723,7 +723,7 @@ Appending a string <parameter>val</parameter>
723723
to a dictonary-typed &consvar; enters
724724
<parameter>val</parameter> as the key in the dictionary,
725725
and <literal>None</literal> as its value.
726-
Using a tuple type to supply a <literal>key, value</literal>
726+
Using a tuple type to supply a key-value pair
727727
only works for the special case of &cv-CPPDEFINES;
728728
described above.
729729
</para>
@@ -2342,35 +2342,38 @@ env.MergeShellPaths({'INCLUDE': ['c:/inc1', 'c:/inc2']}, prepend=0)
23422342
<para>
23432343
Merges values from
23442344
<parameter>arg</parameter>
2345-
into &consvars; in the current &consenv;.
2346-
If
2347-
<parameter>arg</parameter>
2345+
into &consvars; in <parameter>env</parameter>.
2346+
If <parameter>arg</parameter> is a dictionary,
2347+
each key-value pair represents a
2348+
&consvar; name and the corresponding flags to merge.
2349+
If <parameter>arg</parameter>
23482350
is not a dictionary,
2349-
it is converted to one by calling
2350-
&f-link-env-ParseFlags;
2351-
on the argument
2351+
&MergeFlags; attempts to convert it to one
23522352
before the values are merged.
2353-
Note that
2353+
&f-link-env-ParseFlags; is used for this,
2354+
so values to be converted are subject to the
2355+
same limitations:
2356+
&ParseFlags; has knowledge of which &consvars; certain
2357+
flags should go to, but not all;
2358+
and only for GCC and compatible compiler chains.
23542359
<parameter>arg</parameter>
2355-
must be a single value,
2356-
so multiple strings must
2357-
be passed in as a list,
2358-
not as separate arguments to
2359-
&f-env-MergeFlags;.
2360+
must be a single object,
2361+
so to pass multiple strings,
2362+
enclose them in a list.
23602363
</para>
23612364

23622365
<para>
23632366
If <literal>unique</literal> is true (the default),
2364-
duplicate values are not stored.
2365-
When eliminating duplicate values,
2366-
any &consvars; that end with
2367-
the string
2367+
duplicate values are not retained.
2368+
In case of duplication,
2369+
any &consvar; names that end in
23682370
<literal>PATH</literal>
2369-
keep the left-most unique value.
2371+
keep the left-most value so the
2372+
path searcb order is not altered.
23702373
All other &consvars; keep
2371-
the right-most unique value.
2374+
the right-most value.
23722375
If <literal>unique</literal> is false,
2373-
values are added even if they are duplicates.
2376+
values are appended even if they are duplicates.
23742377
</para>
23752378

23762379
<para>
@@ -2379,14 +2382,14 @@ Examples:
23792382

23802383
<example_commands>
23812384
# Add an optimization flag to $CCFLAGS.
2382-
env.MergeFlags('-O3')
2385+
env.MergeFlags({'CCFLAGS': '-O3'})
23832386

23842387
# Combine the flags returned from running pkg-config with an optimization
23852388
# flag and merge the result into the construction variables.
23862389
env.MergeFlags(['!pkg-config gtk+-2.0 --cflags', '-O3'])
23872390

23882391
# Combine an optimization flag with the flags returned from running pkg-config
2389-
# twice and merge the result into the construction variables.
2392+
# for two distinct packages and merge into the construction variables.
23902393
env.MergeFlags(
23912394
[
23922395
'-O3',

SCons/EnvironmentTests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3177,11 +3177,12 @@ def test_NoClean(self) -> None:
31773177
def test_Dump(self) -> None:
31783178
"""Test the Dump() method"""
31793179

3180-
env = self.TestEnvironment(FOO = 'foo')
3180+
env = self.TestEnvironment(FOO='foo', FOOFLAGS=CLVar('--bar --baz'))
31813181
assert env.Dump('FOO') == "'foo'", env.Dump('FOO')
31823182
assert len(env.Dump()) > 200, env.Dump() # no args version
31833183

31843184
assert env.Dump('FOO', 'json') == '"foo"' # JSON key version
3185+
self.assertEqual(env.Dump('FOOFLAGS', 'json'), '"<<non-serializable: CLVar>>"')
31853186
import json
31863187
env_dict = json.loads(env.Dump(format = 'json'))
31873188
assert env_dict['FOO'] == 'foo' # full JSON version

0 commit comments

Comments
 (0)