summaryrefslogtreecommitdiff
path: root/README.rst
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-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-15Link to ACRN utilitiesUlf Magnusson
2018-06-14Make 6.1.1 releasev6.1.1Ulf Magnusson
Just adds commit dc0b022 ("Correctly report choice locations in some warnings").
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-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-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-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-05-30Update source links in READMEUlf Magnusson
To-be-packaged scripts now live in the root.
2018-05-27oldconfig: Move from examples/ to rootUlf Magnusson
All the packaged code will appear in the root.
2018-05-23Update genrest.py link to new locationUlf Magnusson
2018-05-21Fix link to genrest.pyUlf Magnusson
2018-05-07Add screenshots showing incremental searchUlf Magnusson
Should probably move the screenshots out into a separate section soon.
2018-05-03menuconfig: Add a mode that shows invisible itemsUlf Magnusson
When show-all mode is enabled, all items in the current menu are shown, including promptless and invisible items. Promptless items are shown with their name within <> brackets in place of the prompt. This will make it possible to jump to invisible items once the jump-to feature is added. It is also a handy feature on its own. .config loading from within the interface will make use of it as well, in case the current menu becomes complete invisible. Piggyback various code cleanups. Rename _visible* to _shown*, as it now includes invisible items in show-all mode.
2018-05-01Formatting nitsUlf Magnusson
2018-05-01Make 5.0.0 releasev5.0.0Ulf Magnusson
New features: - ed3ceaa ("Make warnings available in a list") API changes: - 8983f7e ("Make disable_warnings() disable all warnings") This is a minor API behavior change, so the major version is bumped. It's unlikely to break anything people were depending on.
2018-05-01Fix link to genrest.py outputUlf Magnusson
2018-05-01Make 4.3.0 releasev4.3.0Ulf Magnusson
4.2.1 should have been 4.3.0. That was not a bugfix release. Braino.
2018-05-01Make 4.2.1 releasev4.2.1Ulf Magnusson
New features: - 105c835 ("Add helper for splitting expressions") - 509e374 ("Add Choice.direct_dep field") A terminal menuconfig implementation has been added which relies on these features. Other improvements: - c1c5ef2 ("Print a warning for malformed .config lines") - 09b8c58 ("Give filename and context for UnicodeDecodeError")
2018-05-01Rename examples/menuconfig.py to menuconfig_example.pyUlf Magnusson
To avoid confusing it with the new terminal menuconfig implementation. Clean up the README a bit at the same time, removing some stuff that's less essential now (e.g. the menuconfig_example.py "screenshot").
2018-05-01Fix genrest.py linkUlf Magnusson
2018-05-01Add genrest.py from the Zephyr project as an exampleUlf Magnusson
2018-05-01Formatting fixUlf Magnusson
2018-05-01Fix README formattingUlf Magnusson
2018-05-01Add a terminal menuconfig implementationUlf Magnusson
Uses the 'curses' module, which is in the Python standard library. Only Python 3 is supported, mostly due to Unicode support. Windows support is provided through an external package which adds support for the 'curses' module on Windows. See the changes and the docstring in the newly added menuconfig.py for more information. Piggyback a README notes mentioning that Kconfiglib supports Unicode.
2018-04-07Make 4.2.0 releasev4.2.0Ulf Magnusson
New features and improvements: - 7245bad ("Parenthesize && expressions within || expressions") makes expressions more readable. - 2259d35 ("Generalize is_menuconfig to non-symbol items") can simplify menuconfig implementations. - c7ac6f8 ("Add parent deps to the right in _T_IF") makes parent dependencies consistently appear on the right in expressions, with the outermost parent dependency the furthest to the right. New warnings: - 7ba79ca ("Warn if user (.config) value is outside of 'range'") - 225ec4b ("Warn if a choice symbol is selected or implied") Some obscure false positive warnings for named choices were fixed too. This came up in https://github.com/zephyrproject-rtos/zephyr/issues/6948. - e8408a0 ("Move sanity checking to after _finalize_tree()")
2018-03-20Add kconfig.py from Zephyr as a real-world exampleUlf Magnusson
2018-03-18Add print_config_tree.py example script (#42)Ricardo F
Works like menuconfig.py, but just dumps the tree, with a specified .config file as base. Handy for diffing.
2018-03-17Make 4.1.0 releasev4.1.0Ulf Magnusson
Only adds daac69d ("Add a globbing source statement"). 'gource' doubles as an include-if-exists function.
2018-03-16Link to pymenuconfigUlf Magnusson
A menuconfig implementation built on top of Kconfiglib using TkInter.
2018-03-13Mention rsource and gsource in READMEUlf Magnusson
2018-03-11Fix broken formattingUlf Magnusson
2018-03-11Make 4.0.0 releasev4.0.0Ulf Magnusson
Includes a small API behavior change, hence the major version bump: - db63301 ("Return "" for unwritten symbols in Symbol.config_string") New features: - Support for incremental builds using the same scheme as the include/config/ directory in the C tools. See the new Kconfig.sync_deps() function and commit 378dedc ("Add support for incremental builds"). - Minimal configuration (defconfig) writing, generating identical files to the C implementation. See commit 652f11b ("Add minimal configuration file generation support"). The C 'make savedefconfig' implementation is currently broken in obscure cases involving tristate choices (due to broken invalidation code), so the tests are disabled for now. I have a patch for the C implementation that I will submit. Fixes: - user_value wasn't set for choice symbols set to y via load_config() with replace=True. Fixed by commit 0bd841d ("Properly remember y user values for choice symbols"). Didn't affect correctness, only the API. Other changes: - 778ec47 ("Only write '# CONFIG_FOO is not set' for visible symbols") mirrors a change I made to the C tools. - bbe3ae9 ("Do not write the defconfig_list symbol to .config") mirrors another change made to the C tools. - Misc. refactoring and cleanup.
2018-03-11Add minimal configuration file generation supportUlf Magnusson
Works like 'make savedefconfig' in the C tools. Call it write_min_config() rather than write_defconfig() to be a bit more explicit. Add a test similar to test_defconfig that compares Kconfiglib minimal configuration output against the C implementation, for all defconfig files. Disable the tests for now. The C tools have a bug that causes an incorrect configuration to be generated for tristate choices in some cases. They will be re-enabled once those are fixed.
2018-03-01Only write '# CONFIG_FOO is not set' for visible symbolsUlf Magnusson
This mirrors a change I made to the C tools, which is now in linux-next: https://www.spinics.net/lists/linux-kbuild/msg17074.html. Add a note to the README to make it clear that the test suite now needs to be run against recent kernels in order to pass. Copy-pasted commit message from the C tools commit below: === Background === - Visible n-valued bool/tristate symbols generate a '# CONFIG_FOO is not set' line in the .config file. The idea is to remember the user selection without having to set a Makefile variable. Having n correspond to the variable being undefined in the Makefiles makes for easy CONFIG_* tests. - Invisible n-valued bool/tristate symbols normally do not generate a '# CONFIG_FOO is not set' line, because user values from .config files have no effect on invisible symbols anyway. Currently, there is one exception to this rule: Any bool/tristate symbol that gets the value n through a 'default' property generates a '# CONFIG_FOO is not set' line, even if the symbol is invisible. Note that this only applies to explicitly given defaults, and not when the symbol implicitly defaults to n (like bool/tristate symbols without 'default' properties do). This is inconsistent, and seems redundant: - As mentioned, the '# CONFIG_FOO is not set' won't affect the symbol once the .config is read back in. - Even if the symbol is invisible at first but becomes visible later, there shouldn't be any harm in recalculating the default value rather than viewing the '# CONFIG_FOO is not set' as a previous user value of n. === Changes === Change sym_calc_value() to only set SYMBOL_WRITE (write to .config) for non-n-valued 'default' properties. Note that SYMBOL_WRITE is always set for visible symbols regardless of whether they have 'default' properties or not, so this change only affects invisible symbols. This reduces the size of the x86 .config on my system by about 1% (due to removed '# CONFIG_FOO is not set' entries). One side effect of (and the main motivation for) this change is making the following two definitions behave exactly the same: config FOO bool config FOO bool default n With this change, neither of these will generate a '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied). That might make it clearer to people that a bare 'default n' is redundant. This change only affects generated .config files and not autoconf.h: autoconf.h only includes #defines for non-n bool/tristate symbols. === Testing === The following testing was done with the x86 Kconfigs: - .config files generated before and after the change were compared to verify that the only difference is some '# CONFIG_FOO is not set' entries disappearing. A couple of these were inspected manually, and most turned out to be from redundant 'default n/def_bool n' properties. - The generated include/generated/autoconf.h was compared before and after the change and verified to be identical. - As a sanity check, the same modification was done to Kconfiglib. The Kconfiglib test suite was then run to check for any mismatches against the output of the C implementation.
2018-02-28Add support for incremental buildsUlf Magnusson
Implement a scheme from the C tools where symbols get corresponding files that are touch'ed whenever the symbol's value changes. This can be used to add e.g. Makefile dependencies between source files and particular symbols. See the docstring of the new sync_deps() function for more information. Piggyback a small sanity check for write_autoconf().
2018-02-27Make 3.2.0 releasev3.2.0Ulf Magnusson
Adds a Kconfig extension contributed by RomaVis: aea0232 ("Implement 'rsource' statement ('source' with relative path)").
2018-02-16Make 3.1.0 releasev3.1.0Ulf Magnusson
Only includes 2a88c0c ("Include direct deps. in Symbol/Choice.__str__()").
2018-02-08README nitUlf Magnusson
Might've sounded a bit snarky -- wasn't meant to.
2018-02-08Make 3.0.0 releasev3.0.0Ulf Magnusson
- Only includes e8b4ecb ("Don't special-case user_value for choice symbols set to y"). Since that's a tiny change to the behavior of the API, the major version is bumped.
2018-02-07Make 2.7.0 releasev2.7.0Ulf Magnusson
Just adds f66cd71 ("Allow "n"/"m"/"y" as aliases for 0/1/2 in set_value()").
2018-02-06Add oldconfig.py example scriptUlf Magnusson
Implements the standard 'make oldconfig' functionality, prompting the user for the values of new symbols to update an old .config file. This came up in https://github.com/zephyrproject-rtos/zephyr/issues/5426.
2018-02-03Add example that finds references to undefined symbolsUlf Magnusson
Does a global search over all architectures in the kernel, which should avoid false positives. Referencing an undefined symbol in a particular architecture can be fine in a Kconfig file that's shared by multiple architectures, but if the symbol isn't defined by any architecture, it's likely to be an error (or a potential cleanup).
2018-01-30Make 2.6.0 releasev2.6.0Ulf Magnusson
This release tightens up syntax checking and adds all the warnings generated by the C implementation (plus a few extra ones), making Kconfiglib more viable as a replacement for the C tools, rather than just being an auxiliary library. Syntax checking changes: - a84848b ("Tighten up syntax checking") - 8716316 ("Generate a parse error for extra tokens at EOL") - 416083a ("Flag constant symbols where they're not allowed") Warning changes: - 9c309400 ("Add some post-parsing warnings") - da0bfa3a ("Error out for malformed hex/int/string defaults") - 5d2041a9 ("Add more choice type and prompt sanity checks") - 67f825fc ("Warn if there's more than one help text") - 990c780f ("Add some warnings related to selects and implies") - 7432ade8 ("Warn if a symbol is defined with multiple types") - 5eeea863 ("Improve int/hex sanity checking") - ad94bb45 ("Sanity-check range values") - e930c140 ("Warn if a symbol/choice has multiple prompts") - 60d12911 ("Warn if help text is empty") - d43d2e83 ("Warn if menuconfig statement has no prompt") - 3db12f72 ("Warn if a choice symbol has defaults") - 0eadd61c ("Warn if choice symbol has prompt outside choice") Also includes various code nits.