summaryrefslogtreecommitdiffstats
path: root/SCons/Script/SConsOptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Update NEXT_RELEASE to 4.9.0William Deegan2025-03-021-1/+1
|
* Integrate `from __future__ import annotations`Thaddeus Crews2024-11-161-2/+3
|
* Fix short-option processingMats Wichmann2024-09-161-6/+67
| | | | | | | | | | Override the _process_short_opts method from optparse so it behaves better. This fix is lifted directly from #3799, leaving an additional part to apply later. Fixes #3798 Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix some AddOption issuesMats Wichmann2024-09-111-7/+13
| | | | | | | | | | | | | The optparse add_option method supports an additional calling style that is not directly described in SCons docs, but is included by reference ("see the optparse documentation for details"): it takes a single arg consisting of a premade option object. Because the optparse code detects that case based on seeing zero kwargs, and we always add at least one (default=) that would fail for AddOption. Fix for consistency, but don't advertise it further: not addewd to manpage synoposis/description. Signed-off-by: Mats Wichmann <mats@linux.com>
* Tweak SConsOptions docstringsMats Wichmann2024-09-061-47/+73
| | | | | | | | | | | | Indicate more clearly (for the API docs) that something is an SCons addition/modification, since that doc shows members inherited from the optparse class - this was always easier to tell in the code than in the doc. A few other minor rearrangements and comments and a few type annotations. Does not change any behavior. Signed-off-by: Mats Wichmann <mats@linux.com>
* Tweak some docstrings for OptionsMats Wichmann2024-06-201-36/+26
| | | | | | Also change the build matrix on AppVeyor so we can hopefully get to a pass. Signed-off-by: Mats Wichmann <mats@linux.com>
* AddOption now recognizes "settable" optionMats Wichmann2024-06-171-60/+76
| | | | | | | | | | | | | | | | 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. There was a TODO in SCons/Script/SConsOptions.py about removing three hardcoded ninja options in the "settable" list once this change was made. When that was done it turned out one test failed, because it called the SetOption before the ninja tool was initialized. Logic reordered in the test, but this is a thing to watch out for. Closes #3983. Signed-off-by: Mats Wichmann <mats@linux.com>
* Cleanup Warnings moduleMats Wichmann2024-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | * Added docstrings on warning classes and module docstring. * Move globals to top of file. * Typing. * Dropped DeprecatedSourceCodeWarning, last use was removed, with the feature, for SCons 3.1.2. * Dropped TaskmasterNeedsExecuteWarning, now enforced by Python via an abstract base class (unused/unneeded since 4.0.0). * Dropped DeprecatedMissingSConscriptWarning. This was a transitional warning, no longer needed; can use MissingSConscriptWarning, which also is no longer used but is left in in case it might be useful. * Two in-use warnings added to manpage section on enabling warnings (cache-cleanup-error, future-reserved-variable). * Improve unittest a bit. * Sphinx build set not to show inherited memerber for Warnings - got ugly exception stuff otherwise. Signed-off-by: Mats Wichmann <mats@linux.com>
* review feedback: legacysched to legacy_schedAndrew Morrow2024-01-201-1/+1
|
* wipAndrew Morrow2024-01-191-1/+1
|
* adding info to the man page, changed debug keyStenGruener2023-10-281-1/+1
|
* adding unit test, --debug flag, comments in changes.txtStenGruener2023-10-281-1/+1
|
* Add ability to save "local" help onlyMats Wichmann2023-08-011-5/+56
| | | | | | | | | | | | | An additional keyword argument, "local_only", is now recorgnized by Help(). If true, and "append" is True, then only project-defined help messages are saved into the help text. That is, save help added by calls to AddOption, but not SCons' own help, which is added a different way. Fixes #2356 Fixes #3686 Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge remote-tracking branch 'upstream/master' into json_debug_time_outputWilliam Deegan2023-06-051-11/+11
|\
| * Add some cheap return and parameter annotationsMats Wichmann2023-05-011-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | added --debug=json, which will dump object counts and memory into ↵William Deegan2023-04-221-1/+1
|/ | | | scons_stats.json in invocation directory
* Fixed using --diskcheck=none from command line. It was always broken. ↵William Deegan2022-12-201-1/+4
| | | | SetOption('diskcheck','none') has been working all along. Also refactored the DiskChecker class to have more meaningful properties and not shadow default python objects (list, dir)..
* Added --experimental=tm_v2 which switches to use Andrew Morrow's new ↵William Deegan2022-12-041-2/+2
| | | | ParallelJob implementation. WHich should scale much better for highly parallel builds
* doc and docstring updatesWilliam Deegan2022-08-171-6/+5
|
* Added throw_exception parameter to ValidateOptions() which allows you to ↵William Deegan2022-08-151-4/+27
| | | | select either have ValidateOptions() issue error message and exit,or throw an exception and then you can handle it your own way. per dmoody's sugguestion
* Fixed typoWilliam Deegan2022-06-141-2/+2
|
* Added option to allow scons to determine if it should skip ninja regeneration.Daniel Moody2022-06-071-1/+2
|
* Additional Help updatesMats Wichmann2022-02-041-60/+63
| | | | | | | Drop the previous change to join lines even if the option part overflows its gutter. Signed-off-by: Mats Wichmann <mats@linux.com>
* Tweak the scons help messageMats Wichmann2022-02-031-79/+88
| | | | | | | | | | | | | Processing changed a bit - some lines can now be joined instead of split (if the usage part is short so the combination will still fit). Dropped the "Ingored for compatibility" chunk from the printout. The usage: message was changed as it didn't mention variables. A number of tests expected the exact value of that line, and so were updated. Updated docstrings (for the API docs). Signed-off-by: Mats Wichmann <mats@linux.com>
* Allow disable_execute_ninja and disable_ninja to be set via SetOptionWilliam Deegan2021-07-211-31/+43
|
* Tweak doc of experimental option [skip travis]Mats Wichmann2021-07-131-4/+6
| | | | | | | | | | | | Twiddled the way the experimental option is described, and listed ninja as the available feature. Also reformatted the exception call in the code for unknown feature, behavior was not changed. Essentially, this is a doc-only change. Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge branch 'master' into ninja-generationWilliam Deegan2021-05-241-16/+31
|\
| * Enable SetOption for implicit_deps*Mats Wichmann2021-05-081-8/+22
| | | | | | | | | | | | The SetOption table in the docs is reformatted for easier editing. Signed-off-by: Mats Wichmann <mats@linux.com>
| * Make sure SetOption list is up to dateMats Wichmann2021-05-081-10/+11
| | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* | Add --experimental=ninjaWilliam Deegan2021-04-131-2/+2
|/
* address sider issueWilliam Deegan2021-04-121-1/+1
|
* better handle all/none and multiple options, expanded tests to cover suchWilliam Deegan2021-04-121-4/+29
|
* Address mwichmann's feedbackWilliam Deegan2021-04-101-4/+4
|
* address mwichmann's review commentWilliam Deegan2021-04-101-1/+1
|
* Add docs for --experimental switchWilliam Deegan2021-04-091-11/+27
|
* Change site-dir arg handlingMats Wichmann2021-03-251-2/+2
| | | | | | | | | | | | | | | | chat discussion: this should work to not use a site_dir: $ export SCONSFLAGS=--site-dir=foo $ scons --no-site-dir Commit changes the two options to write to the same variable, so "last one on command line wins" works out. Added a test for this to test/site_scons/site-dir.py. Manpage updated to clarify the order of considering SCONSFLAGS, since order does matter. Signed-off-by: Mats Wichmann <mats@linux.com>
* SConsOptions: don't modify original optionsMats Wichmann2021-03-111-1/+1
| | | | | | | Just to be safe, make a new list since we took a reference to the original. Signed-off-by: Mats Wichmann <mats@linux.com>
* Drop dictionary has_key references: Py2-ism.Mats Wichmann2021-03-111-1/+4
| | | | | | | | | | | | | | 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>
* Merge branch 'master' into topic/grossag/newhashesWilliam Deegan2021-03-071-1/+1
|\
| * Add timing of sconsign write if --debugMats Wichmann2021-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | More improvementsAdam Gross2020-12-151-1/+1
| | | | | | | | | | | | | | 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.
* | Address most review feedbackAdam Gross2020-12-141-8/+17
| | | | | | | | Only thing left is to pick a hash format based on the sconsign database name.
* | Merge branch 'master' into topic/grossag/newhashesWilliam Deegan2020-12-121-6/+2
|\ \ | |/
| * One more unneeded try-import-fixupMats Wichmann2020-11-191-6/+2
| | | | | | | | | | | | gettext is always present now, so extra steps not needed. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Merge branch 'master' into topic/grossag/newhashesAdam Gross2020-11-061-9/+11
|\ \ | |/
| * Update some copyright strings and drop __revision__ [skip appveyor]Mats Wichmann2020-09-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Merge pull request #3758 from mwichmann/GetSet-optsWilliam Deegan2020-09-191-1/+2
| |\ | | | | | | Align SetOption doc with settable options list
| | * [PR #3758] be more explicit about syncing SetOption list [ci skip]Mats Wichmann2020-07-291-1/+2
| | | | | | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>
| | * Align SetOption doc with settable options list. [skip appveyor]Mats Wichmann2020-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | List is recast into a table for readability. Comments in both places remind to keep lists in sync. Signed-off-by: Mats Wichmann <mats@linux.com>
| * | [PR #3784] adjust opt-abbreviation msg after PR reviewMats Wichmann2020-08-251-1/+1
| | | | | | | | | | | | Signed-off-by: Mats Wichmann <mats@linux.com>