Skip to content

Commit 5000a65

Browse files
committed
Merge branch 'master' into jbrill-msvc-detect
# Manually resolved conflicts: # RELEASE.txt
2 parents 1cae687 + 268a942 commit 5000a65

File tree

195 files changed

+1111
-829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+1111
-829
lines changed

.appveyor.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ image:
88
# linux builds done in Travis CI for now
99
- Visual Studio 2017
1010
- Visual Studio 2019
11-
- Visual Studio 2022
11+
#- Visual Studio 2022 # Temporary disable while failing on 14.40 build tools
1212

1313
cache:
1414
- downloads -> appveyor.yml
@@ -37,38 +37,38 @@ environment:
3737
# Test oldest and newest supported Pythons, and a subset in between.
3838
# Skipping 3.7 and 3.9 at this time
3939
- WINPYTHON: "Python312"
40-
4140
- WINPYTHON: "Python310"
42-
4341
- WINPYTHON: "Python38"
44-
4542
- WINPYTHON: "Python36"
4643

4744
# remove sets of build jobs based on criteria below
4845
# to fine tune the number and platforms tested
4946
matrix:
5047
exclude:
51-
# test python 3.6 on Visual Studio 2017 image
48+
# XXX test python 3.6 on Visual Studio 2017 image
49+
# test python 3.8 on Visual Studio 2017 image
5250
- image: Visual Studio 2017
5351
WINPYTHON: "Python312"
5452
- image: Visual Studio 2017
5553
WINPYTHON: "Python310"
5654
- image: Visual Studio 2017
57-
WINPYTHON: "Python38"
55+
WINPYTHON: "Python36"
5856

59-
# test python 3.8 on Visual Studio 2019 image
57+
# test python 3.10 on Visual Studio 2019 image
6058
- image: Visual Studio 2019
6159
WINPYTHON: "Python312"
6260
- image: Visual Studio 2019
63-
WINPYTHON: "Python310"
61+
WINPYTHON: "Python38"
6462
- image: Visual Studio 2019
6563
WINPYTHON: "Python36"
6664

67-
# test python 3.10 and 3.11 on Visual Studio 2022 image
65+
# test python 3.12 on Visual Studio 2022 image
6866
- image: Visual Studio 2022
69-
WINPYTHON: "Python36"
67+
WINPYTHON: "Python310"
7068
- image: Visual Studio 2022
7169
WINPYTHON: "Python38"
70+
- image: Visual Studio 2022
71+
WINPYTHON: "Python36"
7272

7373
# Remove some binaries we don't want to be found
7474
# Note this is no longer needed, git-windows bin/ is quite minimal now.

.flake8

Lines changed: 0 additions & 22 deletions
This file was deleted.

CHANGES.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
7575
access SCons internals.
7676
- Migrate setup.cfg logic to pyproject.toml; remove setup.cfg.
7777
- Update .gitattributes to match .editorconfig; enforce eol settings.
78+
- Replace black/flake8 with ruff for more efficient formatting & linting.
7879

7980
From Raymond Li:
8081
- Fix issue #3935: OSErrors are now no longer hidden during execution of
@@ -157,6 +158,23 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
157158
SCons.Environment to SCons.Util to avoid the chance of import loops. Variables
158159
and Environment both use the routine and Environment() uses a Variables()
159160
object so better to move to a safer location.
161+
- Performance tweak: the __setitem__ method of an Environment, used for
162+
setting construction variables, now uses the string method isidentifier
163+
to validate the name (updated from microbenchmark results).
164+
- AddOption and the internal add_local_option which AddOption calls now
165+
recognize a "settable" keyword argument to indicate a project-added
166+
option can also be modified using SetOption. Fixes #3983.
167+
NOTE: If you were using ninja and using SetOption() for ninja options
168+
in your SConscripts prior to loading the ninja tool, you will now
169+
see an error. The fix is to move the SetOption() to after you've loaded
170+
the ninja tool.
171+
- ListVariable now has a separate validator, with the functionality
172+
that was previously part of the converter. The main effect is to
173+
allow a developer to supply a custom validator, which previously
174+
could be inhibited by the converter failing before the validator
175+
is reached.
176+
- Regularized header (copyright, licens) at top of documentation files
177+
using SPDX.
160178

161179

162180
RELEASE 4.7.0 - Sun, 17 Mar 2024 17:22:20 -0700

RELEASE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
6262
- The Variables object Add method now accepts a subst keyword argument
6363
(defaults to True) which can be set to inhibit substitution prior to
6464
calling the variable's converter and validator.
65+
- AddOption and the internal add_local_option which AddOption calls now
66+
recognize a "settable" keyword argument to indicate a project-added
67+
option can also be modified using SetOption.
68+
NOTE: If you were using ninja and using SetOption() for ninja options
69+
in your SConscripts prior to loading the ninja tool, you will now
70+
see an error. The fix is to move the SetOption() to after you've loaded
71+
the ninja tool.
72+
- ListVariable now has a separate validator, with the functionality
73+
that was previously part of the converter. The main effect is to
74+
allow a developer to supply a custom validator, which previously
75+
could be inhibited by the converter failing before the validator
76+
is reached.
6577

6678
FIXES
6779
-----
@@ -109,6 +121,9 @@ IMPROVEMENTS
109121
- Make the testing framework a little more resilient: the temporary
110122
directory for tests now includes a component named "scons" which can
111123
be given to antivirus software to exclude.
124+
- Performance tweak: the __setitem__ method of an Environment, used for
125+
setting construction variables, now uses the string method isidentifier
126+
to validate the name (updated from microbenchmark results).
112127
- MSVC: Visual Studio 2015 Express (14.0Exp) does not support the sdk version
113128
argument. Visual Studio 2015 Express does not support the store argument for
114129
target architectures other than x86. Script argument validation now takes into
@@ -138,6 +153,7 @@ DOCUMENTATION
138153
before contents of package submodules.
139154
- Updated manpage description of Command "builder" and function.
140155
- Updated the notes about reproducible builds with SCons and the example.
156+
- Regularized header (copyright, licens) at top of documentation files using SPDX.
141157

142158

143159

@@ -154,6 +170,9 @@ DEVELOPMENT
154170
The repo-wide line-ending is now `lf`, with the exception of a few
155171
Windows-only files using `crlf` instead. Any files not already fitting
156172
this format have been explicitly converted.
173+
- Repository linter/formatter changed from flake8/black to ruff, as the
174+
latter grants an insane speed boost without compromising functionality.
175+
Existing settings were migrated 1-to-1 where possible.
157176
- The test runner now recognizes the unittest module's return code of 5,
158177
which means no tests were run. SCons/Script/MainTests.py currently
159178
has no tests, so this particular error code is expected - should not

SCons/Action.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright The SCons Foundation
3+
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4+
SPDX-License-Identifier: MIT
5+
SPDX-FileType: DOCUMENTATION
46
57
This file is processed by the bin/SConsDoc.py module.
6-
See its __doc__ string for a discussion of the format.
78
-->
89

910
<!DOCTYPE sconsdoc [

SCons/Defaults.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright The SCons Foundation
3+
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4+
SPDX-License-Identifier: MIT
5+
SPDX-FileType: DOCUMENTATION
46
57
This file is processed by the bin/SConsDoc.py module.
6-
See its __doc__ string for a discussion of the format.
78
-->
89

910
<!DOCTYPE sconsdoc [

SCons/Environment.py

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
to_String_for_subst,
7777
uniquer_hashables,
7878
)
79-
from SCons.Util.envs import is_valid_construction_var
8079
from SCons.Util.sctyping import ExecutorType
8180

8281
class _Null:
@@ -581,26 +580,20 @@ def __getitem__(self, key):
581580
return self._dict[key]
582581

583582
def __setitem__(self, key, value):
584-
# This is heavily used. This implementation is the best we have
585-
# according to the timings in bench/env.__setitem__.py.
586-
#
587-
# The "key in self._special_set_keys" test here seems to perform
588-
# pretty well for the number of keys we have. A hard-coded
589-
# list worked a little better in Python 2.5, but that has the
590-
# disadvantage of maybe getting out of sync if we ever add more
591-
# variable names.
592-
# So right now it seems like a good trade-off, but feel free to
593-
# revisit this with bench/env.__setitem__.py as needed (and
594-
# as newer versions of Python come out).
595583
if key in self._special_set_keys:
596584
self._special_set[key](self, key, value)
597585
else:
598-
# If we already have the entry, then it's obviously a valid
599-
# key and we don't need to check. If we do check, using a
600-
# global, pre-compiled regular expression directly is more
601-
# efficient than calling another function or a method.
602-
if key not in self._dict and not is_valid_construction_var(key):
603-
raise UserError("Illegal construction variable `%s'" % key)
586+
# Performance: since this is heavily used, try to avoid checking
587+
# if the variable is valid unless necessary. bench/__setitem__.py
588+
# times a bunch of different approaches. Based the most recent
589+
# run, against Python 3.6-3.13(beta), the best we can do across
590+
# different combinations of actions is to use a membership test
591+
# to see if we already have the variable, if so it must already
592+
# have been checked, so skip; if we do check, "isidentifier()"
593+
# (new in Python 3 so wasn't in benchmark until recently)
594+
# on the key is the best.
595+
if key not in self._dict and not key.isidentifier():
596+
raise UserError(f"Illegal construction variable {key!r}")
604597
self._dict[key] = value
605598

606599
def get(self, key, default=None):
@@ -2579,8 +2572,12 @@ def __getitem__(self, key):
25792572
return self.__dict__['__subject'].__getitem__(key)
25802573

25812574
def __setitem__(self, key, value):
2582-
if not is_valid_construction_var(key):
2583-
raise UserError("Illegal construction variable `%s'" % key)
2575+
# This doesn't have the same performance equation as a "real"
2576+
# environment: in an override you're basically just writing
2577+
# new stuff; it's not a common case to be changing values already
2578+
# set in the override dict, so don't spend time checking for existance.
2579+
if not key.isidentifier():
2580+
raise UserError(f"Illegal construction variable {key!r}")
25842581
self.__dict__['overrides'][key] = value
25852582

25862583
def __delitem__(self, key):

SCons/Environment.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright The SCons Foundation
3+
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4+
SPDX-License-Identifier: MIT
5+
SPDX-FileType: DOCUMENTATION
46
57
This file is processed by the bin/SConsDoc.py module.
6-
See its __doc__ string for a discussion of the format.
78
-->
89

910
<!DOCTYPE sconsdoc [

SCons/Platform/Platform.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright The SCons Foundation
3+
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4+
SPDX-License-Identifier: MIT
5+
SPDX-FileType: DOCUMENTATION
46
57
This file is processed by the bin/SConsDoc.py module.
6-
See its __doc__ string for a discussion of the format.
78
-->
89

910
<!DOCTYPE sconsdoc [

SCons/Platform/posix.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
3-
Copyright The SCons Foundation
3+
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4+
SPDX-License-Identifier: MIT
5+
SPDX-FileType: DOCUMENTATION
46
57
This file is processed by the bin/SConsDoc.py module.
6-
See its __doc__ string for a discussion of the format.
78
-->
89

910
<!DOCTYPE sconsdoc [

0 commit comments

Comments
 (0)