summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-06-22Make 7.0.0 releasev7.0.0Ulf Magnusson
New features: - db92bb7 ("Add dependency loop detection") adds long-overdue dependency loop detection. Previously, dependency loops would trigger hard-to-debug Python RecursionError exceptions during evaluation. They now generate a KconfigError instead, with a helpful message that shows the items in the loop. Backwards-incompatible changes (major version bumped to 7): - eb6c21a ("Turn MenuNode/Symbol/Choice.referenced() into a @property") fixes some inconsistency in the recently-added referenced-symbols APIs. Oversight. Other changes: - f6eb4f4 ("Add Symbol/Choice.referenced() convenience methods") makes it easier to get all the symbols/choices referenced by a symbol or choice. Previously, you'd have to loop through all the menu nodes (definition locations) yourself, which might not be obvious. - ca89ca0 ("Rename KconfigSyntaxError to KconfigError") changes to a better exception name, as KconfigSyntaxError was raised for some things that aren't syntax errors. The old name is kept as an alias for now for backwards compatibility.
2018-06-22Turn MenuNode/Symbol/Choice.referenced() into a @propertyUlf Magnusson
Having it as a function is inconsistent, since all other read-only fields use properties. Oversight. Major version will be bumped to 7, though the function version wasn't in for long.
2018-06-22Add Symbol/Choice.referenced() convenience methodsUlf Magnusson
Returns the union of the MenuNode.referenced() sets for all the menu nodes of the symbol/choice.
2018-06-20Simplify MenuNode.referenced() a bitUlf Magnusson
Can get the initial set from expr_items(self.dep), since it's always included and always returns a new set().
2018-06-20Rename KconfigSyntaxError to KconfigErrorUlf Magnusson
This exception is generated for semantic errors and e.g. when dependency loops are detected as well, so the name is bad. Keep the old name as an alias for now for backwards compatibility.
2018-06-19Add dependency loop detectionUlf Magnusson
Pretty long overdue. Until now, dependency loops have raised a hard-to-debug Python RecursionError during evaluation. A Kconfiglib exception is raised now instead, with a message that lists all the items in the loop. See the comment at the start of _check_dep_loop_sym() for an overview of the algorithm. At a high level, it's loop detection in a directed graph by keeping track of unvisited/visited nodes during depth-first search. (A third "visited, known to not be in a dependency loop" state is used as well.) Choices complicate things, as they're inherently loopy: The choice depends on the choice symbols and vice versa, and the choice symbols in a sense all depend on each other. Add the choice-to-choice-symbol dependencies separately after dependency loop detection, so that there's just the choice-symbol-to-choice dependencies to deal with. It simplifies things, as it makes it possible to tell dependencies from 'prompt' and 'default' conditions on the choice from choice symbol dependencies. Do some flag shenanigans to prevent the choice from being "re-entered" while looping through the choice symbols. Maybe this could be cleaned up a bit somehow... Example exception message: Dependency loop =============== A (defined at tests/Kdeploop10:1), with definition... config A bool depends on B ...depends on B (defined at tests/Kdeploop10:5), with definition... config B bool depends on C = 7 ...depends on C (defined at tests/Kdeploop10:9), with definition... config C int range D 8 ...depends on D (defined at tests/Kdeploop10:13), with definition... config D int default 3 if E default 8 ...depends on E (defined at tests/Kdeploop10:18), with definition... config E bool (select-related dependencies: F && G) ...depends on G (defined at tests/Kdeploop10:25), with definition... config G bool depends on H ...depends on the choice symbol H (defined at tests/Kdeploop10:32), with definition... config H bool prompt "H" if I && <choice> depends on I && <choice> ...depends on the choice symbol I (defined at tests/Kdeploop10:41), with definition... config I bool prompt "I" if <choice> depends on <choice> ...depends on <choice> (defined at tests/Kdeploop10:38), with definition... choice bool prompt "choice" if J ...depends on J (defined at tests/Kdeploop10:46), with definition... config J bool depends on A ...depends again on A (defined at tests/Kdeploop10:1)
2018-06-19allnoconfig: Remove leftover commentUlf Magnusson
2018-06-18Add Nordic Semiconductor ASA as shared menuconfig copyright holderUlf Magnusson
Largely paid work, and it's copied into Zephyr, so it was a request. All other source files are still copyright me. Nothing changes in practice. I went for shared copyright to make sure the ISC license can never be changed.
2018-06-15Link to ACRN utilitiesUlf Magnusson
2018-06-15Rename _copy_props_to_sc() to _add_props_to_sc()Ulf Magnusson
The properties themselves aren't really copied, just added to the Symbol/Choice property lists.
2018-06-15Comment wording nitUlf Magnusson
2018-06-15Rename _copy_deps_to_sc() to _copy_props_to_sc()Ulf Magnusson
More descriptive. Menu node properties are copied, not just their dependencies.
2018-06-15menuconfig: Remove redundant int() argumentUlf Magnusson
Base 10 is the default.
2018-06-14Make 6.1.1 releasev6.1.1Ulf Magnusson
Just adds commit dc0b022 ("Correctly report choice locations in some warnings").
2018-06-14Correctly report choice locations in some warningsUlf Magnusson
Menu nodes were added to choices after parsing their properties, making some warnings generated during parsing (as opposed to in _check_choice_sanity()) incorrectly give the choice as '<choice> (undefined)'. Add the node before parsing choice properties to fix those warnings.
2018-06-14Remove redundant str()Ulf Magnusson
.format() will implicitly format the exception as a string.
2018-06-14Make 6.1.0 releasev6.1.0Ulf Magnusson
Fixes: - c880151 ("Fix incorrectly ordered properties for some nested multi.def. symbols") fixes a bug that could cause symbols/choices defined in multiple locations and nested in particular ways within if's and menus to get their properties in the wrong order. The Linux kernel wasn't affected (which is how it managed to slip through), but projects that make heavy use of symbols defined in multiple locations might have been. Comprehensive selftests have been added to cover property ordering on nested multi.def. symbols/choices. New features: - 4af3e0c ("menuconfig: Support starting a search from the info dialog") and 330017a ("menuconfig: Support viewing symbol info from within the jump-to dialog") makes working with the menuconfig a bit smoother to work with. - 68043b2 ("Add MenuNode function that returns referenced items") makes it easier to find out what symbols/choices a symbol, choice, menu, or comment references, which is handy e.g. for searching.
2018-06-14Comment formatting nitUlf Magnusson
2018-06-14Test property ordering on nested multi.def. choicesUlf Magnusson
This case wasn't covered.
2018-06-14Fix MenuNode.referenced() on Kconfig.top_nodeUlf Magnusson
The property lists weren't created for Kconfig.top_node, making referenced() crash. Add a MenuNode constructor and create the property lists there instead of in _parse_properties().
2018-06-14Fix incorrectly ordered properties for some nested multi.def. symbolsUlf Magnusson
_propagate_deps() visits menu nodes roughly breadth-first, meaning properties on symbols and choices defined in multiple locations could end up in the wrong order when copied from the menu node for some unlucky if/menu nestings. Fix it by moving the menu-node-to-symbol/choice property copying in _finalize_tree() so that it's guaranteed to happen in definition order. This bug was introduced by commit 63a4418 ("Record which MenuNode has each property").
2018-06-13Add MenuNode function that returns referenced itemsUlf Magnusson
MenuNode.referenced() returns all symbols (and choices, for choice symbols) referenced in the properties (prompt, defaults, selects, ranges, etc.) and property conditions of the menu node. Handy e.g. when generating cross-references.
2018-06-12Grammar nitUlf Magnusson
2018-06-12Simplify expr_items()Ulf Magnusson
Same cleanup as for _make_depend_on(). Rename 'deps' to 'res' as well. The result can be used for other stuff besides figuring out dependencies.
2018-06-12Simplify _make_depend_on() some moreUlf Magnusson
Rearrange and break out common stuff. Already rename the 'sym' parameter to 'sc', as it could be a choice as well.
2018-06-12Simplify _make_depend_on()Ulf Magnusson
Relations have the same format as AND/OR expressions and can be handled with the same code. This gives an extra recursion for relational expressions (because they can only have symbols as operands), but they're much rarer than other expression types.
2018-06-12Replace a 'raise InternalError' with _internal_error()Ulf Magnusson
Oversight
2018-06-12Remove redundant 'pass' from exception classesUlf Magnusson
The docstrings make the body non-empty already.
2018-06-12menuconfig: Fix searching for nonexistent objectsTomasz Gorochowik
This commit fixes an issue when user searches for a nonexistent object (e.g. adsdsaasda) and presses enter. Having all the key checks in one continuous if statement makes sure that the very last 'else' statement does not get executed when enter is pressed. Note - backported from: https://github.com/zephyrproject-rtos/zephyr/pull/8332
2018-06-12Simplify allnoconfig.py and allyesconfig.pyUlf Magnusson
We can rely on set_value() being a no-op when setting non-bool/tristate symbols to 0/1/2 (due to those values being invalid for other types). Remove some long duplicated comments too.
2018-06-11Add a function for getting all items in an expressionUlf Magnusson
Handy e.g. when searching.
2018-06-11menuconfig: Support viewing symbol info from within the jump-to dialogUlf Magnusson
Ctrl-F (Ctrl-H clashes with backspace) brings up the information dialog for the selected item in the jump-to dialog. Since it's now possible to jump directly from the information dialog to the jump-to dialog and vice versa, recursive invocation becomes possible. Work around it with a flag to _info_dialog() that makes '/' return if the information dialog was launched from within the jump-to dialog. (Recursive invocations work code-wise, but act in a confusing way.)
2018-06-11menuconfig: Support starting a search from the info dialogUlf Magnusson
It's annoying to have to leave the information dialog just to do a search related to something you saw in the information dialog. Stay in the information dialog if the search is canceled.
2018-06-11Mention KCONFIG_CONFIG in the all*config.py scriptsUlf Magnusson
This environment variable was inherited from the C tools. kconfiglib.standard_config_filename() looks at it.
2018-06-11README nitUlf Magnusson
2018-06-11README: Mention environment variable expansion in READMEUlf Magnusson
Also move the description of the Kconfig extensions out of 'Other features' and into a separate section under 'Library features'.
2018-06-07Add license tag to alldefconfig.pyUlf Magnusson
2018-06-06standard_config_filename() style nitUlf Magnusson
2018-06-06genconfig: Fix weird wording in descriptionUlf Magnusson
2018-06-06Make 6.0.1 releasev6.0.1Ulf Magnusson
Just to fix the rendering of the README on PyPI with commit b727f4d ("Fix link to allyesconfig.py in README").
2018-06-06Fix link to allyesconfig.py in READMEUlf Magnusson
No longer just an example either. This also makes the README render properly on PyPI.
2018-06-06README nitUlf Magnusson
2018-06-06Make 6.0.0 releasev6.0.0Ulf Magnusson
Changed behavior (giving the major version bump): - cbf32e2 ("Expand environment variables in strings directly") makes 'option env' "bounce" symbols redundant, though they are still supported for backwards compatibility (with the caveat that they must have the same name as the environment variables they reference to preserve behavior). A warning is printed if 'option env="FOO"' appears on a symbol that's not named FOO. This change will likely appear in the C tools soon as well. Other new features: - The menuconfig implementation is now bundled in the PyPI package, along with implementations of the Kconfig oldconfig and all{def,no,yes,mod}config tools. A genconfig script is provided for generating a C header from the configuration, as well as (optionally) the sync_deps() directory structure for implementing incremental builds. - 63a4418 ("Record which MenuNode has each property") makes it possible to generate documentation for symbols defined in multiple locations with each property shown on the right definition. See genrest.py in Zephyr. This change also cleans up the parsing code a bit. Dependency propagation is now done after parsing, in _finalize_tree(). - 94020be ("Make Kconfig._choices public") and fc73c46 ("Provide lists with all menus and comments") gives easier access to Kconfig items of a specific type, without having to walk the menu tree. This turns out to be handy e.g. when generating documentation and implementing search. Improvements and new warnings: - da40c01 ("Force encoding to UTF-8 by default on Python 3") - 7427079 ("Get rid of the predefined UNAME_RELEASE symbol") - f64591c ("Warn if prompt contains leading or trailing whitespace") - c14e411 ("Warn if quotes are omitted around string defaults") Misc. minor refactoring and cleanup has been done as well.
2018-06-06Add license tags to scriptsUlf Magnusson
Everything's ISC.
2018-06-05Fix formatting for script linksUlf Magnusson
2018-06-05Fix links to all{no,yes,mod}config scriptsUlf Magnusson
2018-06-05README nitsUlf Magnusson
2018-06-05Clean up and update README, cover bundled toolsUlf Magnusson
Explain the soon-to-be-bundled tools. Also rearrange and clean up some sections.
2018-06-05Turn syncconfig.py into genconfig.py and generate headerUlf Magnusson
There should be a script available that generates the output header for the build. It usually makes sense to generate both the header and any incremental build information at the same time (automatically during build), so roll them both into the same script.
2018-06-04Package the *config scriptsUlf Magnusson
These currently include menuconfig, oldconfig, syncconfig, alldefconfig, and all{no,mod,yes}config, which probably cover what 90% of people will need to use. More scripts could be added later. Use the entry_points mechanism (http://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-script-creation), which gives something that works out-of-the-box on Windows. It also removes the .py suffix for the installed scripts.