summaryrefslogtreecommitdiff
path: root/README.rst
AgeCommit message (Collapse)Author
2018-10-03Make 10.9.3 releasev10.9.3Ulf Magnusson
Adds commit 21e47ce ("Fix parse error message on the line after help texts"), which fixes incorrect line contents being reported for parse errors on the line after a help text.
2018-10-02Link olddefconfig.py in the READMEUlf Magnusson
2018-10-02Mention documentation generation earlyUlf Magnusson
2018-10-02API should be stable by nowUlf Magnusson
2018-10-02Make 10.9.2 releasev10.9.2Ulf Magnusson
Adds some documentation nits: - 08abf44 ("Mention that pydoc works after installing with pip") - 6aaf01c ("Clean up documentation a bit re. named choice") - 6fe5198 ("menuconfig: Mark quit_dialog() as internal")
2018-10-02Mention that pydoc works after installing with pipUlf Magnusson
Also mention that menuconfig.py has documentation.
2018-10-01Make 10.9.1 releasev10.9.1Ulf Magnusson
Adds commit 43e7711 ("setup: Use a list instead of a tuple for 'classifiers'"), which fixes a setup.py issue on Python 3.7.
2018-10-01Make 10.9.0 releasev10.9.0Ulf Magnusson
Adds commit 3b692df ("olddefconfig: Add script"), which bundles a new script that mimics 'make olddefconfig'. This could also be accomplished by entering the menuconfig interface and saving, but its more awkward. Some minor internal documentation clarifications and cleanups are included as well: - Commit 53db3ee ("Clarify node_iter() documentation re. iteration order") - Commit c1dcaa3 ("Refactor parsing to get rid of _saved_line") - Commit 6aab113 ("Don't set filename and linenr on 'if' menu nodes")
2018-09-27Make 10.8.1 releasev10.8.1Ulf Magnusson
Adds commit c91e17c ("Give clearer errors for bad endchoice/endif/endmenu nesting"). Previously, an endchoice/endif/endmenu without a corresponding choice/if/menu generated a cryptic "unrecognized construct" error.
2018-09-26Point out the Linux kernel Kconfigs being hugeUlf Magnusson
2018-09-23Make 10.8.0 releasev10.8.0Ulf Magnusson
Adds support for user-defined preprocessor functions in Python, which can be used to get information from existing Python tools into Kconfig, e.g. to have Kconfig symbols depend on hardware information stored in some other format. See commit b6827ca ("Add support for user-defined Python preprocessor functions").
2018-09-23Add support for user-defined Python preprocessor functionsUlf Magnusson
Allow preprocessor functions to be defined in Python by putting a module called 'kconfigfunctions' into sys.path. Internally, this simply adds the functions to the predefined functions in Kconfig._functions. User-defined Python functions make it simple to integrate information from existing Python tools into Kconfig, e.g. to have Kconfig symbols depend on hardware information stored in some other format. This might be used to get device tree information into Kconfig in Zephyr. Piggyback module docstring documentation for some extensions that were previously only mentioned in the README.
2018-09-14Make 10.7.0 releasev10.7.0Ulf Magnusson
Adds commit b9b2ebb ("menuconfig: Add RGB color support to styles."), which makes it possible to specify colors in MENUCONFIG_STYLE using #RRGGBB notation. The rendered colors may be more or less exact depending on terminal capabilities. In the best case, we can redefine colors. Otherwise, we fall back on the closest available color. Contributed by Mitja Horvat (punkfluid).
2018-09-09Make 10.6.1 releasev10.6.1Ulf Magnusson
Adds commit af6c8dc ("menuconfig: Fix some glitching on small terminals"), which fixes some minor graphical glitching in the menuconfig interface when the terminal is too small for things to fit. Commit 374f488 ("Clean up kernel Makefile patch and add new targets") adds some new targets to the Linux makefile patch as well, though the makefile patch isn't bundled on PyPI.
2018-09-09Mention the jump-to menuconfig functionality in the text tooUlf Magnusson
2018-09-09Replace all menuconfig screenshots with a single gif animationUlf Magnusson
Makes the README much less spammy.
2018-09-08Clean up kernel Makefile patch and add new targetsUlf Magnusson
Add two new targets: - 'make kmenuconfig' runs the menuconfig interface - 'make dumpvarsconfig' lists all referenced environment variables together with their values (assuming they used the preprocessor syntax) Remove the 'kconfiglibtestconfig' target, which is no longer used. Also clean up the target definitions. The joys of ancient code.
2018-09-08Add some more thanks to the READMEUlf Magnusson
2018-09-08Make 10.6.0 releasev10.6.0Ulf Magnusson
New features: - Commit ac8d152 ("menuconfig: Add support for custom color schemes (aka styles)"), contributed by Mitja Horvat (pinkfluid), adds support for configuring the style (colors and attributes) of menuconfig interface elements by setting a new MENUCONFIG_STYLE environment variable. The format of MENUCONFIG_STYLE is documented in the menuconfig.py module docstring. This format is now used internally as well to define the predefined styles. - Commit a092257 ("Allow macro expansion within symbol names") adds support for expanding macros within symbol names. This could be used e.g. to define template Kconfig files that get instantiated by setting preprocessor variables before including them. Other changes: - Commit 6683213 ("Allow user values on 'option env' symbols") makes it possible to give 'option env' symbols user values. There's no good reason to disallow it (it's a leftover from an older way of implementing them), and it simplifies the code a bit. Note that 'option env' symbols are only supported for backwards compatibility at this point. Environment variables can be expanded directly.
2018-08-29Make 10.5.0 releasev10.5.0Ulf Magnusson
Adds a small menuconfig tweak that could avoid some user confusion: Commit 66a2bf5 ("menuconfig: Do not use red for invisible symbols outside of show-all mode")
2018-08-29Make 10.4.0 releasev10.4.0Ulf Magnusson
New features: - Commit 84bd863 ("menuconfig: Add a more 'make menuconfig'-like color scheme") adds an alternative menuconfig color scheme contributed by contributed by Mitja Horvat (pinkfluid). The new color scheme can be enabled by setting the environment variable MENUCONFIG_THEME to 'aquatic'. The default color scheme now also uses bold text for the selected entry, like the 'aquatic' theme. Fixes: - Commit d1e2a65 ("menuconfig: Always show implicit submenus with visible nodes") fixes a display issue involving prompt-only conditions where visible child nodes could disappear outside of show-all mode. Other changes: - Commit 0ed2ba0 ("Improve the running-without-Makefile-patch documentation") updates the documentation on how to run Kconfiglib on the Linux kernel without using the Makefile patch. - Misc. internal menuconfig refactoring.
2018-08-26Make 10.3.0 releasev10.3.0Ulf Magnusson
New features: - Commit 20de53b ("Add a Kconfig.kconfig_filenames attribute") and commit 932d0f7 ("Add a Kconfig.env_vars attribute that lists env. variables") make lists of all Kconfig files and referenced environment variables available. This could be used e.g. to implement alternative incremental build schemes. Note that the sync_deps() mechanism already indirectly catches any relevant changes to files and environment variables though (anything that changes the configuration output). - Commit 17d7c1e ("menuconfig: Show all symbols at each menu location for multi.def. choices") makes it so that if a named choice is defined in multiple locations, each of which adds options, you can select any of the options regardless of via menu entry you enter the choice. Previously, you could only select the options defined at that menu entry's location. Named choices with symbols in more than one location are completely broken in the C tools, so there's no reference for the behavior there. This seems less confusing at least. Suggested by Mitja Horvat (pinkfluid). Fixes: - Commit 0b46af4 ("menuconfig: Don't return when selecting a choice symbol with children") improves menuconfig behavior in an extremely obscure case. - Commit 1c2c4ae ("oldconfig: Fix help display command for choices") makes '?' print the help for choices in oldconfig. The command was accidentally set to '??' there. - Commit ddfd5df ("Improve menu structure for promptless choices") fixes a menuconfig display issue for promptless choices (which can appear "legitimately" if a named choice is defined in multiple locations to add extra options). Cleanup: - Commit 2320b7a ("oldconfig: Use Kconfig.node_iter() and clean up") - Some manual tree walking in other places has also been rewritten to use Kconfig.node_iter().
2018-08-24Make 10.2.1 releasev10.2.1Ulf Magnusson
Fixes broken-looking menuconfig include path information for items in the top-level Kconfig file, via commit 64600b3 ("menuconfig: Hide the include path for top-level items").
2018-08-24Make 10.2.0 releasev10.2.0Ulf Magnusson
Adds commit 13884e9 ("Show include paths in menuconfig symbol information"), which adds a MenuNode.include_path attribute to Kconfiglib. MenuNode.include_path holds the Kconfig include path of the menu node, which shows how its Kconfig file got 'source'd, starting from the top-level Kconfig file. MenuNode.include_path is used to show include paths in the menuconfig symbol information. It will also be used in genrest.py in Zephyr, which generates an RST Kconfig reference.
2018-08-23Make 10.1.1 releasev10.1.1Ulf Magnusson
Includes two small bug fixes: - Commit 9b77511 ("Fix file descriptor leak for the top-level Kconfig file") - Commit d158fed ("Fix recursive 'source' error reporting")
2018-08-23Make 10.1.0 releasev10.1.0Ulf Magnusson
New features: - Commit 7dae988 ("Add a generic node iterator") adds a Kconfig.node_iter() helper generator for iterating through all menu nodes in the menu tree, in definition order. Optionally, symbols defined in multiple locations are only generated once. This generator is now used internally by write_config() as well. Suggested by Mitja Horvat (pinkfluid). - Commit d2c1430 ("Introduce Kconfig.unique_defined_syms and Kconfig.unique_choices") adds versions of Kconfig.defined_syms/choices that only include symbols and choices defined in multiple locations once, while still preserving definition order. This is almost always what you want when iterating through (just) symbols and choices. It removes set() hackery (where it's easy to accidentally mess up the order) and the like. Fixes: - Commit 4ebc2aa ("Flag extra tokens after 'if'/'depends on'/'visible if' expressions") tightens up syntax checking so that extra trailing tokens after 'if', 'depends on', and 'visible if' expressions raise a syntax error, instead of being silently ignored. Oversight.
2018-08-21Make 10.0.1 releasev10.0.1Ulf Magnusson
Adds commit 7f3844f ("Make symbol order match between headers and .config files"), which fixes a bug introduced by commit 71872a8 ("Massively speed up U-Boot parsing"). The ordering of symbols in header files now matches the order in .config files again, which was always the intent. It makes things more readable, and is nice for version control too.
2018-08-18List new Kconfig.__init__() $srctree behavior among changes in READMEUlf Magnusson
2018-08-18Make 10.0.0 releasev10.0.0Ulf Magnusson
Adds commit 8a3999b ("Fix $srctree logic for the top-level Kconfig file"), which fixes an old braino: The top-level Kconfig file passed to Kconfig.__init__() wasn't looked up relative to $srctree, breaking out-of-tree operation for scripts unless ugly manual $srctree hacks were added. All Kconfig files are now consistently looked up relative to $srctree. This is a backwards-incompatible change (though with a simple fix), so the major version is bumped. A note is printed on errors that might be due to the changed behavior.
2018-08-18Make 9.4.2 releasev9.4.2Ulf Magnusson
This just reverts commit 8a3999f ("Fix $srctree logic for the top-level Kconfig file"), so that it can go in a major release instead. I realized it has enough breakage potential for existing scripts to warrant a major version bump.
2018-08-17Make 9.4.1 releasev9.4.1Ulf Magnusson
- Commit 8a3999b ("Fix $srctree logic for the top-level Kconfig file") fixes a major braino where the top-level Kconfig file passed to Kconfig.__init__() wasn't looked up relative to $srctree, breaking out-of-tree operation for e.g. menuconfig. All Kconfig files are now consistently looked up relative to $srctree. - Misc. internal code cleanup
2018-08-11Make 9.4.0 releasev9.4.0Ulf Magnusson
Kconfiglib changes: - Commit 1f864b1 ("Support custom printing of symbols/choices in expressions") adds support for printing symbols and choices with a custom format in expressions. This makes it simpler to implement things like like turning all symbols/choices into links when generating documentation, and printing symbol values after symbols. - Commit 6aea8d0 ("Don't pass encoding= to Popen()") fixes an accidental Python 3.6+ requirement when using the $(shell) preprocessor function with Python 3. menuconfig changes: - Commit 8efc358 ("menuconfig: Omit tristate value hint for int/string/hex defaults") removes the boolean value hints to the right of defaults in the symbol information for string/int/hex symbols. Stuff like '- 74 (value: "n")' isn't helpful, and looks confusing. - Commit 3511f24 ("menuconfig: Make symbol information less spammy") makes the symbol information more compact in general, e.g. by skipping value hints where they aren't helpful ('FOO(=y)' instead of 'FOO(=y) (=y)'), and by shortening stuff like '(value: "y")' to just '(=y)'.
2018-07-27Make 9.3.0 releasev9.3.0Ulf Magnusson
- b650ccd ("Use universal newlines mode in $(shell) implementation") improves the behavior of $(shell) on Windows. A trailing \r\n-style newline sequence is now stripped in full, instead of leaving \r in there. - 6899f91 ("Restore compatibility with old kernels") restores some compatibility with old kernels originally dropped by c19fc11 ("Drop some compatibility and tighten up lexing"). It turns out that people are still running Kconfiglib on kernels from at least 2013 (see https://github.com/ulfalizer/Kconfiglib/pull/48).
2018-07-20Make 9.2.1 releasev9.2.1Ulf Magnusson
Just adds commit 5452ad3 ("Fix detection of hex literals"). Braino. Include some int and hex literals in the Kstrict testcase too.
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)