summaryrefslogtreecommitdiff
path: root/SCons
Commit message (Collapse)AuthorAgeFilesLines
* Doc fiddling - Alias, Action, Decider [skip appveyor]Mats Wichmann2023-05-162-82/+115
| | | | | | | | | | | | | | * Signature of Alias() now matches implementation to avoid problem if kwargs used * Case of Alias with no targets is mentioned in text (was already shown in example) * Now mention that Action([item]) does not return a ListAction - previously implied that if arg was a list, a ListAction was *always* returned * Mention default Decider and sort the names of available decider functions, and add version marking. * Minor fiddling with Alias.py docstrings. Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge branch 'master' into bug/msys-pythonWilliam Deegan2023-05-03252-3574/+3934
|\
| * Merge branch 'master' into maint/validateOptionsWilliam Deegan2023-05-03248-2572/+2583
| |\
| | * Merge branch 'master' into maint/cheap-typingWilliam Deegan2023-05-032-18/+18
| | |\
| | | * Change bas64 decodestring -> decodebytesMats Wichmann2023-05-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The former was an alias in Python 3, deprecated since 3.1. Use the replacement. Signed-off-by: Mats Wichmann <mats@linux.com>
| | | * Eliminate pylint warning on direct use of __call__Mats Wichmann2023-05-021-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C2801: Unnecessarily calls dunder method __call__. Invoke instance directly. These were all in the same file (docbook tool) Signed-off-by: Mats Wichmann <mats@linux.com>
| | * | Add some cheap return and parameter annotationsMats Wichmann2023-05-01247-2537/+2539
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use: https://github.com/JelleZijlstra/autotyping to add "safe" return annotations. Where a parameter has a default value that is an obvious scalar type (bool, int, str, etc.) add those annotations as well. Also fixed two small bugs that popped up when sanity-checking with mypy. One in FortranCommon, where a return had been previously annotated to be a tuple of Action, which should be ActionBase - Action is the factory function, not the base class. The other was a typo in the error raised in _add_cppdefines - the message was formatted with the value of "define" which should have been "defines". Signed-off-by: Mats Wichmann <mats@linux.com>
| | * MSCommon: minor updates to README.rst [skip ci]Joseph Brill2023-04-141-18/+26
| | | | | | | | | | | | | | | | | | | | | Changes: * Fix typographical error (missing word). * Add lines between literal block markers and indented text. * Expand build tools lists in Visual Studio table.
| * | Minor cleanup ValidateOptions doc/code/testMats Wichmann2023-04-142-90/+133
| |/ | | | | | | | | | | | | | | | | | | | | | | Some nearby things in Main.py as well: - docstrings polished a bit, minor linting - move the list of predefined SConstruct file names into a constant defined at the top of the file, so it's a little less hidden, in the unlikely case of future changes. Manpage text and example revised a bit. Signed-off-by: Mats Wichmann <mats@linux.com>
| * dictify_CPPDEFINES: also handle single tupleMats Wichmann2023-03-222-22/+60
| | | | | | | | | | | | | | | | | | | | | | * Single-tuple CPPDEFINES was not handled. * Add some more unit tests. * Add some comments - that we need to keep in sync with processDefines, but don't actually call it (the routine *could* be rewritten to process the result of processDefines instead of the bare CPPDEFINES, but currently doesn't do that). Signed-off-by: Mats Wichmann <mats@linux.com>
| * Fix dictifyCPPDEFINES handlong of macro stringsMats Wichmann2023-03-212-34/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CPPDEFINES can contain name=value strings, either a single one, or one or more in a sequence type. After conversion (subsequent Append/Prepend to CPPDEFINES), these will be stored as tuples, but it is possible to hit cases where the type conversion has never been triggered. The C Scanner has its own routine to process CPPDEFINES, and missed these cases, which are now handled. The testcases in issue 4193 which showed this problem are now included in the C scanner unit tests, and the test for dictifyCPPDEFINES is expanded to check these two forms. Fixes #4193 Signed-off-by: Mats Wichmann <mats@linux.com>
| * Updates for 4.5.2. Added zipapp package to scons-localsWilliam Deegan2023-03-211-4/+4
| |
| * Fix problem when MergeFlags adds to existing CPPDEFINESMats Wichmann2023-03-092-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MergeFlags has a post-processing step if the *unique* flag evaluates True which loops through and removes the duplicates. This step uses slicing (for v in orig[::-1]), which fails if the item being cleaned is a deque - which CPPDEFINES can now be. It would also cause the deque to be replaced with a list. Detect this case and handle separately. Note the same post-processing step assures each modified object will be replaced - Override(parse_flags=xxx) silently counted on this so it does not end up sharing variables with the overridden env. This situation remains, and is accounted for by the patch. Unit test and e2e tests are extended to check that MergeFlags can now add correctly, and that Override leaves the variables independent, not shared. Fixes #4231 Signed-off-by: Mats Wichmann <mats@linux.com>
| * 4.5.1 release items4.5.1rel_4.5.1William Deegan2023-03-061-4/+4
| |
| * added example code which demonstrates the problem introduced in 4.5.0 and ↵William Deegan2023-03-062-9/+10
| | | | | | | | fixed in 4.5.1
| * Fix issue with CPPDEFINES and Clone environmentsMats Wichmann2023-03-062-106/+148
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| * updates4.5.0rel_4.5.0William Deegan2023-03-051-3/+3
| |
| * Post build commits for 4.5.0William Deegan2023-03-051-5/+5
| |
| * man: add a "New in..." to ValidateOPtions [skip appveyor]Mats Wichmann2023-03-031-3/+3
| | | | | | | | | | | | | | The new ValidateOptions had a :versionadded: in the docstring, but just noticed the actual manpage entry didn't have similar. Signed-off-by: Mats Wichmann <mats@linux.com>
| * [ci skip] Update versionadded for ValidateOptions()William Deegan2023-03-021-1/+1
| |
| * Update PR 4305: failing stub qt toolMats Wichmann2023-03-012-4/+87
| | | | | | | | | | | | | | | | | | | | Proposed addition of code to cause stub qt to fail, and test/import.py to detect this situation. Unfortunately, it doesn't seem to work... needs adjustment. Doc updates to record rename version. Signed-off-by: Mats Wichmann <mats@linux.com>
| * Fix qt3 -> QT3 typosWilliam Deegan2023-02-241-5/+5
| |
| * add placeholder tool qt to instruct users to switch to qt3William Deegan2023-02-242-0/+69
| |
| * moved the qt tool to qt3. Changed all QT envvars to be now prefixed with QT3William Deegan2023-02-242-6/+2
| |
| * move qt -> qt3 tool, adjust testing as wellWilliam Deegan2023-02-232-149/+153
| |
* | Fix Configure tests on win32/msys2Mats Wichmann2023-03-012-1/+8
|/ | | | | | | | | If selecting tool 'mingw', and using an msys2 Python, paths constructed to run a compiled check ended up with forward slashes, which gave an error when executed through cmd.exe. Cygwin does not have the same problem, as it uses "sh" as the shell when executing the command. Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #4303 from RedwanFox/fix_textfile_encoding_issueWilliam Deegan2023-02-202-2/+24
|\ | | | | set default encoding of written files to UTF-8, added ability to pass custom file encoding
| * Updated docs to indicate FILE_ENCODING will affect Substfile() as well as ↵William Deegan2023-02-182-6/+14
| | | | | | | | TextFile(). Added blurb to RELEASE.txt. Updated test fixture to include new utf-8 text for test
| * set default encoding of written files to UTF-8, added ability to passNickolai Korshunov2023-02-182-2/+16
| | | | | | | | custom file enconding
* | rewording of CHANGES.txt info. Changed versionadded to 4.5.0William Deegan2023-02-152-2/+2
| |
* | Tweak Append/Prepend e2e testsMats Wichmann2023-02-153-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Added another try block so complete prepend e2e test can be run on a branch where PR #4263 is not applied (for comparison). Added license header. Changed invalid-tuple unittest to use assertRaises (behavior is the same) Also added a versionadded and a versionchanged to docstrings. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Added DefaultEnvironment(tools=[]) to fixtures for CPPDEFINES. Added ↵William Deegan2023-02-102-2/+12
| | | | | | | | negative test for non-two-tuple. Minor wording change
* | Adjusted CPPDEFINES behavior for list and tupleMats Wichmann2023-02-095-78/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After the previous proposals, addition of a bare tuple is restored to the valued-macro behavior (this previously did not work consistently). Strings are now consistently split if they contain spaces, except if entered as a list member, in which case (as documented) they are left alone. tuples with nore than two members are now flagged as a UserError; previously the first two members were taken as name=value and any further members were silently ignored. More tests added. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Alter append logic to keep existing append of tuple value yielding -Dkey=valueWilliam Deegan2023-02-021-1/+13
| |
* | Fix some CPPDEFINES handling problemsMats Wichmann2023-01-303-14/+50
| | | | | | | | | | | | | | | | | | | | A few places were deciding what to do based on result of is_List, when the intent was really list-or-tuple-or-derivatives - changed to is_Sequence. Added some test cases, including a unit test for processDefines (which would have caught one of these cases). Signed-off-by: Mats Wichmann <mats@linux.com>
* | CPPDEFINES: reword some doc stuffMats Wichmann2023-01-302-22/+28
| | | | | | | | | | | | | | Fix a typo Try to further clarify how to add valued macros. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Fix some pyside complaintsMats Wichmann2023-01-302-4/+3
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* | Split out CPPDEFINES handling in Append methodsMats Wichmann2023-01-305-298/+469
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than having lots of special-case code for CPPDEFINES in four separate routines, add a new _add_cppdefines function to handle it, paying attention to append/prepend, unique/duplicating, and keep-original/replace-original. The existing special case handing was then removed from Append and AppendUnique (it was never present in Prepend and PrependUnique anyway - see #3876, but these now get it due to a call to the new function). Tuple handling is now consistent with list handling: a single tuple is treated as macro names to add, not as a name=value pair. A tuple or list has to be a member of a containing tuple or list to get the macro=value treatment. This *may* affect some existing usage. macro=value tuples without a value can now be entered either in (macro,) form or (macro, None) form. Internally, whenever append/prepend is done, existing contents are forced to a deque, which allows efficient adding at either end without resorting to the tricks the Prepend functions currently do (they still do these tricks, but only in non-CPPDEFINES cases). As a result, values from a dict are not stored as a dict, which has some effect on ordering: values will be *consistently* ordered, but the ones from the dict are no longer necessarily sorted. In SCons/Defaults.py, processDefines no longer sorts a dict it is passed, since Python now preserves dict order. This does not affect the E2E test for CPPDEFINES - since those all call an Append routine, CPPDEFINES will always be a deque, and so processDefines never sees a dict in that case. It could well affect real-life usage - if setup of CPPDEFINES was such that it used to contain a dict with multiple entries, the order might change (sorting would have presented the keys from that dict in alphabetical order). This would lead to a one-time rebuild for actions that change (after that it will remain consistent). In the E2E test CPPDEFINES/append.py some bits were reformatted, and the handler routine now accounts for the type being a deque - since the test does a text comparison of internally produced output, it failed if the word "deque" appeared. Some new test cases were added to also exercise strings with spaces embedded in them. Changes were made to the expected output of the E2E test. These reflect changes in the way data is now stored in CPPDEFINES, and in some cases in order. Most of these do not change the meaning (i.e. "result" changes, but "final" output is the same). These are the exceptions: - "appending a dict to a list-of-2lists", AppendUnique case: order now preserved as entered (previously took the order of the appended dict) - "appending a string to a dict", Append case: not stored as a dict, so ordering is as originally entered. - "appending a dict to a dict", Append case: no longer merge into a dict, so this is now an actual append rather than a merge of dicts which caused the uniquing effect even without calling AppendUnique (arguably the old way was incorrect). A new test/CPPDEFINES/prepend.py is added to test Prepend* cases. append.py and prepend.py are structured to fetch the SConstruct from a fixture file. append.py got an added test in the main text matrix, a string of the macro=value form. The same 5x5 maxtrix is used in the new prepend.py test as well ("expected" values for these had to be added as well). Cosmetically, append and prepend now print their test summary so strings have quotation marks - the "orig" lines in the expected output was adjusted. This change looks like: - orig = FOO, append = FOO + orig = 'FOO', append = 'FOO' The other tests in test/CPPDEFINES got copyright updating and reformatting, but otherwise do not change. Documentation updated to clarify behavior. Fixes #4254 Fixes #3876 Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #4297 from mwichmann/CheckLib-uniqueWilliam Deegan2023-01-283-24/+91
|\ | | | | Add unique kwarg to CheckLibs
| * Add unique kwarg to CheckLibsMats Wichmann2023-01-273-24/+91
| | | | | | | | | | | | | | | | | | | | Minor tweak to CheckFunc - the dummy prototype should have a dummy arg list too (comment from Python setuptools discussion). Might as well fail the official way: #error instead of C syntax error. Fixes #2768 Signed-off-by: Mats Wichmann <mats@linux.com>
* | Merge remote-tracking branch 'upstream/master' into ↵William Deegan2023-01-28149-6841/+15116
|\ \ | |/ | | | | fix_configure_marking_up_to_date
| * Add "append" kwarg to two configure checksMats Wichmann2023-01-242-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add append=True/False to CheckLib, CheckLibWithHeader in SConf. The "implementation", Conftest.CheckLib, already accepted this kwarg, but it could not be passed from an SConscript using the offical API. Updated manpage to describe and expanded a unit test to check. Fixes #2767 Additionally, clarified some things in manpage, including a recent user confusion about how to call CheckFunc. Signed-off-by: Mats Wichmann <mats@linux.com>
| * Added blurb to RELEASE.txt. Renamed function check_content_hash() from ↵William Deegan2023-01-231-13/+12
| | | | | | | | check_MD5().
| * Run latex after bibtex/biber only when necessaryLukas Schrangl2023-01-231-2/+2
| | | | | | | | | | | | Although comments in src/engine/SCons/Tool/tex.py indicated that latex should only be run after biber/bibtex if the .bbl file had changed, it was always run.
| * Merge branch 'master' into doc/msvsWilliam Deegan2023-01-2310-107/+405
| |\
| | * Merge branch 'master' into maint/gfortran-fiddleWilliam Deegan2023-01-232-68/+255
| | |\
| | | * Merge branch 'master' into doc/more-msvcWilliam Deegan2023-01-231-2/+16
| | | |\
| | | | * Add Python 3.12 supportMats Wichmann2023-01-221-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Updated one testcase which now generates a warning, failing the test (which expects no stderr). * Updated ActionTests.py to know about 3.12, and uses the current bytecode sequences (these might change later in the 3.12 cycle) * Added 3.11 and 3.12 to setup.cfg so tools which query "what Pythons does SCons support" from pypi metadata won't be fooled into thinking 3.11 isn't supported (or 3.12, though that's preliminary). Signed-off-by: Mats Wichmann <mats@linux.com>
| | | * | Doc: update msvc, add version table [skip appveyor]Mats Wichmann2023-01-181-66/+239
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes in 4.4 didn't marke new construction variables with the now preferred version add marker, so added these. The references to different versions gets so confusing that to try to help added a version correspondence table to the MSVC_VERSION construction varaiable doc. Signed-off-by: Mats Wichmann <mats@linux.com>
| | * | Fix editing mistake in fortran doc [skip appveyor]Mats Wichmann2023-01-181-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>