summaryrefslogtreecommitdiff
path: root/README.rst
AgeCommit message (Collapse)Author
2018-07-20Make 9.2.0 releasev9.2.0Ulf Magnusson
Adds support for automatically warning for references to undefined Kconfig symbols. See commit ca89d02 ("Add KCONFIG_STRICT flag for flagging refs. to undefined syms"). (There was an outdated docstring in that comment. KCONFIG_STRICT needs to be set to "y".)
2018-07-20Mention KCONFIG_STRICT in the READMEUlf Magnusson
Also fix up Kconfig.__init__() docstring to say that KCONFIG_STRICT needs to be "y".
2018-07-20Add KCONFIG_STRICT flag for flagging refs. to undefined symsUlf Magnusson
Settings KCONFIG_STRICT to y in the environment turns on warnings for all references to undefined symbols within Kconfig files (with the only gotcha that hex literals must be prefixed by 0x or 0X, to make it possible to distinguish them from undefined references). Always flagging undefined references gets awkward, as some projects (e.g. the Linux kernel) use multiple Kconfig trees with shared files, leading to some safe undefined references. It's helpful for other projects though. Having KCONFIG_STRICT as an environment variable is handy when multiple tools are involved. Piggyback a small README change re. warnings. Kconfiglib now has many more warnings than the C tools.
2018-07-18Make 9.1.0 releasev9.1.0Ulf Magnusson
Adds e08b695 ("Add def_int, def_hex, and def_string keywords"), getting rid of some Kconfig inconsistency.
2018-07-18Add def_int, def_hex, and def_string keywordsUlf Magnusson
Analogous to def_bool and def_tristate, setting the type and adding a default at the same time. This is a Kconfiglib extension. These keywords can be useful in projects that make use of symbols defined in multiple locations, and remove some Kconfig inconsistency.
2018-07-15Fix typo in READMEUlf Magnusson
2018-07-15Make 9.0.0 releasev9.0.0Ulf Magnusson
This release revamps the globbing design to make 'source' globbing, requiring at least at least one matching file. A new o(r)source statement can be used when it's okay for a pattern to not match any files. Relevant commit, with motivations: 7a428aa ("Switch to more sensible globbing statements (w/ backwards compatibility)"). Backwards compatibility is maintained by having g(r)source be an alias for o(r)source. A small API change was introduced too: Kconfig.srctree is now set to the empty string instead of None when $srctree is unset. This gives nice behavior for e.g. os.path.join().
2018-07-15Switch to more sensible globbing statements (w/ backwards compatibility)Ulf Magnusson
Instead of having 'source' and 'gsource', have 'source' always glob, but require the pattern to match at least one file, throwing KconfigError otherwise. Have separate 'osource' and 'orsource' statements (the o is for "optional") for cases where it's okay for the pattern to not match any files. This is analogous to 'include' and '-include' in Make. The biggest flaw with 'gsource' was that there was no way to do a globbing match while requiring something to match, possibly leading to subtle failures. Preserve backwards compatibility by having "gsource" and "grsource" be aliases for "osource" and "orsource", respectively. Also include some related changes: - Kconfig.srctree is now set to the empty string if $srctree is unset, rather than to None. This gives nice behavior with os.path.join() and os.path.relpath(), which treat the empty string as the current directory (without adding './', for os.path.join()). - When $srctree is set, Kconfig files in the current directory will no longer override Kconfig files in $srctree when the relative paths match. This was likely a bug all along in the C tools, and probably only makes sense for .config files. I've seen it cause breakage in Zephyr. - Clarify the behavior of $srctree in the Kconfig.__init__() docstring. - Make MenuNode.filename be relative to $srctree for the Kconfig file passed to Kconfig.__init__(). This makes it consistent. The major version will be bumped later due to the small Kconfig.srctree API change.
2018-07-13Make 8.1.1 releasev8.1.1Ulf Magnusson
This release adds commit ac692af ("Fix absolute $srctree prefixes showing up on gsource'd files"), which fixes a bug that could cause $srctree to be included in some paths for e.g. generated documentation.
2018-07-11Make 8.1.0 releasev8.1.0Ulf Magnusson
This release improves performance for projects that make heavy use of multiple definition locations for symbols, via commit 747e455 ("Massively speed up U-Boot parsing"). Two new warnings are included as well: - 652d991 ("Warn if int/hex/string symbols are evaluated logically") - 21b5351 ("Warn if int/hex 'default' is outside active 'range'")
2018-07-10Add hint re. "macro expanded to blank string"Ulf Magnusson
More environment variables are referenced now.
2018-07-10Make 8.0.0 releasev8.0.0Ulf Magnusson
New features: - 2433deb ("Add Kconfig preprocessor") implements a new Kconfig preprocessor, documented in https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kconfig-macro-language.txt. It is required to parse the linux-next Kconfigs now, and will appear in Linux 4.18. 'option env=...' symbols and the $FOO syntax for expanding environment variables will be supported for backwards compatibility for a while. Consider switching to $(FOO) though, which is the new syntax (and removing 'option env=...' symbols). Changed behavior: - c19fc11 ("Drop some compatibility and tighten up lexing") makes Kconfiglib flag invalid characters in Kconfig files as a syntax error in all context. They were previously ignored in some places for compatibility with old sloppy versions of the C tools. The C tools fixed it with commit c2264564 ("kconfig: warn of unhandled characters in Kconfig commands") in July 2015. Older kernels might require fixing up the Kconfig files a bit now. New warnings: - 4200e25 ("Generalize select-with-unsatisfied-deps warning") makes the select-with-unsatisfied-dependencies warning trigger when a symbol with m-valued direct dependencies is y-selected.
2018-07-10Remove reference to "speedy" test suite option in READMEUlf Magnusson
Has been removed (and is now always on).
2018-07-10Add Kconfig preprocessorUlf Magnusson
Implement the Kconfig preprocessor described in https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kconfig-macro-language.txt (which is now in linux-next and will appear in Linux 4.18). A new Kconfig.variables property holds all the preprocessor variables so that they can be inspected programmatically. Preprocessor variables are represented by a new Variable class. With the preprocessor, environment variables are referenced with $(FOO) instead of $FOO. For backwards compatibility, $FOO is accepted as well for now (and leaves "$FOO" as-is if FOO doesn't exist). The $FOO syntax might be dropped at some point in the future (together with a major version increase). It should be supported for a few months at least. Some internals were cleaned up too, mostly related to parsing. Some outdated documentation was fixed as well.
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.