| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| | |
Update Util.py
|
| | |
|
| |
| |
| |
| | |
It looks like here is the only call of containsOnly(). This func looks a bit confusing: name like containsAll/Any, same signature but other semantics.
So I propose to kick it out at all, with tests )
|
|\ \
| | |
| | | |
Update Util.py
|
| |/
| |
| |
| | |
all() and any() are `Built-in Functions`.
https://docs.python.org/3/library/functions.html#built-in-funcs.
|
|/
|
| |
Calling dict() is redundant here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modified failing tests to use the new defaulted .sconsign database based on the hash algorithm
For MD5, default database will be .sconsign.dblite
For other algorithms the default will be .sconsign_<hashname>.dblite.
For all cases where the user changes the hash algorithm used, the database will be .sconsign_<hashname>.dblite (including md5)
For sub-scons directories it remains as .sconsign
Also added unit-tests for Util.py for the new hash default changes.
It's difficult to setup a fips-compliant platform using containers, and instead we mock that.
option--config uses multiple types of hash algorithms so was skipped.
Removed one f-string (python 3.5 doesn't support those)
Corrupt.py is using an explicit .sconsign so that was left as-is, and only the parent default .sconsign was changed for work test 1.
A fetch-database name option was added to the testing framework.
The unlink_sconsignfile was not updated as no usages of it were found.
|
|
|
|
|
|
| |
The original check was causing issues where 3.8 in Windows was throwing an unexpected error.
This should hopefully fix 3.8 in Windows while maintaining the same support in Linux.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Refactored code to match PR requirements
Changed result ==... result== to result in(...)
Updated the man page to reference the defaulting behavior for FIPS machines.
Updated a typo and design of change in the CHANGES.txt file
Made an ugly bit of code in Util.py that fixes it so python3.9 has MD5 support enabled in FIPS mode.
The code is much more ugly than before, with the tradeoff being it's testable and usable.
In python >= 3.9, SCons will now always default to MD5.
Next commit will work on getting the tests to auto-skip the md5-required steps on versions <= python 3.8.
|
|
|
|
| |
Test suite currently failing with FIPS enabled due to hard-coded MD5 tests.
|
|
|
|
|
|
|
|
| |
The NodeList had code to sort of manually build up a new list
due to some issues over slicing in very early Python 3. Added some
return-type annotations.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
|
|
| |
Prior to commit 69dcebbd, CLVar could be initialized with no
arguments, which would set its default value to an empty list.
After that commit, the default value is a list with a single
`None` element. This commit reverts CLVar back to the previous
default value while preserving the intent of the original commit.
|
|
|
|
| |
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
|
|
|
| |
Return types on a few more funcs
Use a __doc__ assignment for funcs that have per-platform implementations.
Cygwin get_native_path now uses subprocess for its call.
doctest examples added to CLVar docstring.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
|
|
|
|
|
|
|
| |
Also remove a bit of syntax that was not introduced until Py3.8 -
the use of a / as an argument in a function signature.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix up UniqueList - remves a Py2-era method and correct args on others;
add a __repr__ which does the uniquing.
Add "we know what we're doing" pylint comments on apparent redefinitions
of builtins and globals that the type tests and type converters do.
Add some more pylint comments on "local" (rather than top of file) imports.
Remove WindowsError reference (necessitated changing some tool code
as well) - partial fix for #3939, WinodwsError is no longer distinct
Simplified semi-deepcopy stuff (and quieted complaints)
Add class docstrings and fixup some docstrings.
AddMethod examples had reversed arguments - now rendered as a
doctest, and actually works. Fixed up other examples to (mostly)
be doctest as well.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
|
|
|
| |
Remove obsolete __getslice__ and __setslice_ definitions
add Node.fs.scandir to call new (Py3.5) os.scandir
Node.fs.makedirs now passes the exist_ok flag
Cachedir creation now uses this fs.makedirs with exist_ok=True
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the reproducer in issue #1742 was run on git head, it failed in a
different way than in the issue: an exception "list index out of range",
caused by the test setting CC="" in the Environment call(). While this
is a rather unuseful thing to do in general, the resulting call to
env.WhereIs should not throw an exception because the general WhereIs
function ends up indexing into something that can't be indexed. Avoid
this by returning None immediately if the list of names to look for
is empty. Note this does _not_ fix issue 1742, it just avoids the new
problem it was failing on.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a test for in-place adding of a string containing multiple words.
The CLVar testcase in UtilTests is converted to use multicharacter
argument words to tickle the parent class's tendency to do "list()"
directly on an argument - overriding that behavior, but only for
strings, is the whole purpose of the class. That is,
"bbb" should not become ['b', 'b', 'b'] but instead ["bbb"].
We wouldn't see if that was happening when all the words in the
test were single-character.
Fixes #2399
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|\
| |
| | |
Don't chop some shlib names in _get_shlib_stem and adjustixes
|
| |
| |
| |
| | |
matches the expected library suffix (for example so for a shared library.) Not worth checking for very unusual and bad practice
|
| |
| |
| |
| | |
adjustixes. Note: This could have a perf impact
|
| |
| |
| |
| | |
filename=prefix or filename=suffix and still prepend and append prefix and suffix respectively
|
| |
| |
| |
| | |
Don't truncate them to blank string
|
| |
| |
| |
| |
| |
| |
| |
| | |
Sider fix - repeated __contains__ in one test
Simplify __contains__ in Environment
Add comment on performance hack in the two uniquer functions
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases, added a __contains__ method instead,
not because it necessarily was needed, but for completeness.
Also one completely unrelated change because it happened to
be sitting modified in the tree when I committed modified files:
be a little more cautious about building CHECK_METHODS in
our subclassing of the optparse Option class... current
cpython starts it at None, then fills it in, so it shouldn't
be None when we subclass.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A line is now emitted showing sconsign sync time if --debug=time
Some calls to time.time replaced with time.perf_counter, where the
objective was to time sections of code (i.e. where there wasn't
an actual need to get time-since-epoch) - Python recommends this
as getting the best-available timer.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
BuilderBase class traps __bool__ call and raises InternalError.
On Py 3.10a the unit test for this got optimized out, avoid this.
While we're at it, eliminate remaining references to __nonzero__,
which was a Py2-ism, replaced by __bool__.
Closes #3860
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
| |
| |
| |
| |
| | |
Now that we have a much more limited selection of supported algorithms,
I don't need the code to actually call the hash function in set_hash_format.
This also means that I don't need a try/except and can instead use getattr().
|
| |
| |
| |
| |
| |
| |
| | |
1. Fix failure finding UserError.
2. Fix bad string formatting.
3. Add test case covering passing an invalid hash format.
4. Remove blake2b, as I haven't tested it. We can add it some day if people want it.
|
| |
| |
| |
| | |
Only thing left is to pick a hash format based on the sconsign database name.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
Fixes #3014
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
| |
| |
| |
| |
| | |
This was requested in the code review. The sconsign database file name is still
.sconsign.dblite if the hash format is not overridden, but if it is, the name
will be something like .sconsign_sha256.dblite.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
Fixes #3028
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
| |
| |
| | |
available via Python's winreg package. It's (long been) part of Python's standard library so using pywin32 as a backup is not necessary
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Touches the first and second levels of SCons (except SCons.Tool),
not tests or docs which remain TODO.
Make sure docstring is first non-comment content, eliminate cases where
docstring is set elsewhere but assigns to __doc__ - this approach of
course worked inside Python, but confuses various tools.
Some module-level docstrings modified a bit, in particular
the convention of having the name of the module as the first line
is dropped, replaced by a summary description going there instead -
this improves the look in the API Docs, which otherwise display
something like:
SCons.Foo - SCons.Foo
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Eliminate unneeded imports, and a few unneeded statements -
usually "pass" where it is not syntactically needed.
A couple of import try blocks were eliminated or changed
when they're "cannot happen" due to current floor Python version.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
| |
| |
| |
| | |
Fixes one sider issue and a code error that broke some tests
|
|/
|
|
|
|
|
| |
This change adds support for a new --hash-format parameter that can be used to
override the default hash format used by SCons. The default remains MD5, but
this allows consumers to opt into SHA1, SHA256, or any other hash algorithm
offered by their implementation of hashlib.
|
|
|
|
|
|
|
|
| |
These changes are prompted by complaints Sphinx makes about
existing docstrings; split from the Sphinx-build PR to make
for easier reviewing.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
|
|
|
|
| |
In Python3 this is the default.
Signed-off-by: Mats Wichmann <mats@linux.com>
|
|
with current python packaging practices
|