Skip to content

Commit

Permalink
Merge branch 'master' into jbrill-msvc-detect
Browse files Browse the repository at this point in the history
# Manually resolved conflicts:
#	RELEASE.txt
  • Loading branch information
jcbrill committed Jun 29, 2024
2 parents 1cae687 + 268a942 commit 5000a65
Show file tree
Hide file tree
Showing 195 changed files with 1,111 additions and 829 deletions.
20 changes: 10 additions & 10 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
# linux builds done in Travis CI for now
- Visual Studio 2017
- Visual Studio 2019
- Visual Studio 2022
#- Visual Studio 2022 # Temporary disable while failing on 14.40 build tools

cache:
- downloads -> appveyor.yml
Expand Down Expand Up @@ -37,38 +37,38 @@ environment:
# Test oldest and newest supported Pythons, and a subset in between.
# Skipping 3.7 and 3.9 at this time
- WINPYTHON: "Python312"

- WINPYTHON: "Python310"

- WINPYTHON: "Python38"

- WINPYTHON: "Python36"

# remove sets of build jobs based on criteria below
# to fine tune the number and platforms tested
matrix:
exclude:
# test python 3.6 on Visual Studio 2017 image
# XXX test python 3.6 on Visual Studio 2017 image
# test python 3.8 on Visual Studio 2017 image
- image: Visual Studio 2017
WINPYTHON: "Python312"
- image: Visual Studio 2017
WINPYTHON: "Python310"
- image: Visual Studio 2017
WINPYTHON: "Python38"
WINPYTHON: "Python36"

# test python 3.8 on Visual Studio 2019 image
# test python 3.10 on Visual Studio 2019 image
- image: Visual Studio 2019
WINPYTHON: "Python312"
- image: Visual Studio 2019
WINPYTHON: "Python310"
WINPYTHON: "Python38"
- image: Visual Studio 2019
WINPYTHON: "Python36"

# test python 3.10 and 3.11 on Visual Studio 2022 image
# test python 3.12 on Visual Studio 2022 image
- image: Visual Studio 2022
WINPYTHON: "Python36"
WINPYTHON: "Python310"
- image: Visual Studio 2022
WINPYTHON: "Python38"
- image: Visual Studio 2022
WINPYTHON: "Python36"

# Remove some binaries we don't want to be found
# Note this is no longer needed, git-windows bin/ is quite minimal now.
Expand Down
22 changes: 0 additions & 22 deletions .flake8

This file was deleted.

18 changes: 18 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
access SCons internals.
- Migrate setup.cfg logic to pyproject.toml; remove setup.cfg.
- Update .gitattributes to match .editorconfig; enforce eol settings.
- Replace black/flake8 with ruff for more efficient formatting & linting.

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


RELEASE 4.7.0 - Sun, 17 Mar 2024 17:22:20 -0700
Expand Down
19 changes: 19 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY
- The Variables object Add method now accepts a subst keyword argument
(defaults to True) which can be set to inhibit substitution prior to
calling the variable's converter and validator.
- AddOption and the internal add_local_option which AddOption calls now
recognize a "settable" keyword argument to indicate a project-added
option can also be modified using SetOption.
NOTE: If you were using ninja and using SetOption() for ninja options
in your SConscripts prior to loading the ninja tool, you will now
see an error. The fix is to move the SetOption() to after you've loaded
the ninja tool.
- ListVariable now has a separate validator, with the functionality
that was previously part of the converter. The main effect is to
allow a developer to supply a custom validator, which previously
could be inhibited by the converter failing before the validator
is reached.

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



Expand All @@ -154,6 +170,9 @@ DEVELOPMENT
The repo-wide line-ending is now `lf`, with the exception of a few
Windows-only files using `crlf` instead. Any files not already fitting
this format have been explicitly converted.
- Repository linter/formatter changed from flake8/black to ruff, as the
latter grants an insane speed boost without compromising functionality.
Existing settings were migrated 1-to-1 where possible.
- The test runner now recognizes the unittest module's return code of 5,
which means no tests were run. SCons/Script/MainTests.py currently
has no tests, so this particular error code is expected - should not
Expand Down
5 changes: 3 additions & 2 deletions SCons/Action.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
5 changes: 3 additions & 2 deletions SCons/Defaults.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
37 changes: 17 additions & 20 deletions SCons/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
to_String_for_subst,
uniquer_hashables,
)
from SCons.Util.envs import is_valid_construction_var
from SCons.Util.sctyping import ExecutorType

class _Null:
Expand Down Expand Up @@ -581,26 +580,20 @@ def __getitem__(self, key):
return self._dict[key]

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

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

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

def __delitem__(self, key):
Expand Down
5 changes: 3 additions & 2 deletions SCons/Environment.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
5 changes: 3 additions & 2 deletions SCons/Platform/Platform.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
5 changes: 3 additions & 2 deletions SCons/Platform/posix.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
5 changes: 3 additions & 2 deletions SCons/Platform/sunos.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
5 changes: 3 additions & 2 deletions SCons/Platform/win32.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
5 changes: 3 additions & 2 deletions SCons/Scanner/Scanner.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
SPDX-License-Identifier: MIT
SPDX-FileType: DOCUMENTATION
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
Expand Down
Loading

0 comments on commit 5000a65

Please sign in to comment.