summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-28Make 10.28.0 releasev10.28.0Ulf Magnusson
Adds commit b3f0061 ("menuconfig: Only list duplicated choice symbols once"), which improves the behavior of the menuconfig interface for an obscure situation involving named choices included multiple times.
2018-11-28menuconfig: Clarify the scope of the named choice special-casingUlf Magnusson
One thing that irks me a bit about it is that it might give the idea that menuconfigs have to include it, making things seem more complex than they really are.
2018-11-28menuconfig: Improve comment re. multiply-defined choice symbolsUlf Magnusson
The thing it's talking about usually happens when some file with a named choice is included multiple times with different dependencies.
2018-11-28menuconfig: Fix variable name typo in commentUlf Magnusson
2018-11-28menuconfig: Only list duplicated choice symbols onceUlf Magnusson
When a Kconfig file defined a named choice and was included multiple times, the choice symbols were listed multiple times in the menuconfig as well (due to commit 17d7c1e ("menuconfig: Show all symbols at each menu location for multi.def. choices")). That's probably not what you want. Tweak it so that each symbol is only shown once, with the prompt that was used for it at whatever choice definition location is entered. Also change how the choice selection is displayed before the choice is entered, so that the prompt used for the selected symbol at that particular location is used. Previously, the prompt at the first definition location for the symbol was always used. (Note that all of this is only about how things are displayed. It's not essential to functionality, in case you're writing your own menuconfig.)
2018-11-26Make 10.27.0 releasev10.27.0Ulf Magnusson
Adds some small performance optimizations: - Commit 120f551 ("Speed up more token membership tests") - Commit bb7044c ("Reorder some tuples to put y first")
2018-11-26Recommend Python 3Ulf Magnusson
Python 3.7 has finally caught up with Python 2.7 performance-wise.
2018-11-26Reorder some tuples to put y firstUlf Magnusson
CONFIG_FOO=y and 'default y' and the like are more common than the n versions, so test for them first. Turning the tuples into sets would be even better on Python 3, as it optimizes sets with constant keys into a LOAD_CONST, but it has a performance penalty on Python 2.
2018-11-26Speed up more token membership testsUlf Magnusson
Similar change to commit 4b23936 ("Speed up some token tests"), just for more tests. This especially helps for the "not a property line" case in _parse_properties(), which checks against all the cases. Saves 2-3% of parsing time together with the earlier change.
2018-11-25Whitespace nitUlf Magnusson
2018-11-25Speed up some token testsUlf Magnusson
Turn some of the hotter membership test tuples into global sets, like was already done for _TYPE_TOKENS. That saves some global lookups for the tuple members and avoids repeatedly recreating tuples. It's 30%-50% faster in a microbenchmark, even for two-element tuples (with global lookups for the members).
2018-11-25Move _TOKEN_TO_TYPE conversion into _set_type()Ulf Magnusson
Factors out some code. Also use a quick 'is not UNKNOWN' test first inside it, which will usually fail, since single-def symbols are more common. That avoids building a tuple too.
2018-11-24Make 10.26.0 releasev10.26.0Ulf Magnusson
Adds commit 67ce4eb ("Use constants when _tokens_i is known"), which adds more optimizations made possible by switching to more manual token handling.
2018-11-24Use constants when _tokens_i is knownUlf Magnusson
Same deal as for the initial token, except we sometimes know that we're dealing with the second token as well. Inline _expect_nonconst_sym_and_eol() and _expect_str(), which are single-use. That allows more specific error messages to be used as well. Also tweak an outdated comment in _tokenize() re. None-termination. Token fetching is more manual now.
2018-11-24Make 10.25.0 releasev10.25.0Ulf Magnusson
Adds a small missed optimization opportunity, in commit 74ce9d3 ("Optimize fetching of initial token on line").
2018-11-24Simplify eval_string() a bitUlf Magnusson
2018-11-24Optimize fetching of initial token on lineUlf Magnusson
Another possible optimization was missed in commit ab89ef6 ("Get rid of _next_token() and _peek_token()"): The index of the initial token on a line is known to be 0, so there's no need to check _tokens_i. Also reads a bit clearer.
2018-11-23Make 10.24.0 releasev10.24.0Ulf Magnusson
Tightens up syntax checking and improves a warning: - Commit 13a7bae ("Flag extra trailing tokens in all contexts") adds checking for extra trailing tokens in a few overlooked cases. - Commit f356ba8 ("Clarify that select/imply is a no-op for choice symbols") clarifies the warning when selecting/implying a choice symbol. Parsing performance was improved slightly as well.
2018-11-23Clarify that select/imply is a no-op for choice symbolsUlf Magnusson
The warning for selecting/implying a choice symbol could be misunderstood as saying that select/imply has no effect on choice symbols in a particular case. Select/imply never has an effect on choice symbols though. Rephrase the warning to make it clearer.
2018-11-23Flag extra trailing tokens in all contextsUlf Magnusson
The following cases were let through without a parse error (with the extra tokens just being ignored): - endif/endmenu/enchoice <extra tokens> - default FOO <extra tokens> (though 'default FOO if' flagged an error) Make them generate an error.
2018-11-23Get rid of _next_token() and _peek_token()Ulf Magnusson
These are pretty hot. Inline them to save a few % of parsing time. They're pretty simple anyway. _tokens_i was initialized to -1 to simplify the _next_token() implementation. With _next_token() gone, initialize it to 0 instead, which simplifies some other code.
2018-11-21Disable test dependent on dict ordering on Python 3.5 and earlierUlf Magnusson
The KCONFIG_WARN_UNDEF test often fails on Python 3.4 (3.5 not tested), but the output is still correct. It just differs due to dict ordering randomness. Python 3.6 iterates over dicts in insertion order in practice, and Python 3.7 made it part of the spec, so enable the test for 3.6 and later. Python 2.7 seems fine as well.
2018-11-21Make 10.23.0 releasev10.23.0Ulf Magnusson
- Commit ee25489 ("menuconfig: Print '----' instead of '---> (empty)'") makes the menuconfig display empty menus (e.g. from disabled 'menuconfig' symbols) in a less spammy way, matching the C tools. - Commit 6313925 ("Remove message re. Kconfiglib 10 backwards compat. break") removes an old message printed when the top-level Kconfig file can't be opened and $srctree is set. Hopefully it's been noticed by now. - Commit a1a4430 ("Use 'foo.__class__ is Bar' instead of 'isinstance(foo, Bar)'") improves parsing and evaluation performance a bit.
2018-11-21menuconfig: Mention that menus can be 'menuconfig' symbolsUlf Magnusson
They're either proper menus, choices, or 'menuconfig' symbols.
2018-11-21Make quotes consistent in parse error messagesUlf Magnusson
2018-11-21menuconfig: Print '----' instead of '---> (empty)'Ulf Magnusson
This matches the C tools and is a bit less spammy. Maybe it's less clear what it means at a glance, but it's probably less confusing for disabled 'menuconfig' symbols at least.
2018-11-21Link Zephyr's kconfig.py from merge_config.py exampleUlf Magnusson
Helps to have a fancier example too.
2018-11-21Remove message re. Kconfiglib 10 backwards compat. breakUlf Magnusson
The message has been in for three months now. Hopefully that was enough for it to get noticed.
2018-11-21Use 'foo.__class__ is Bar' instead of 'isinstance(foo, Bar)'Ulf Magnusson
This is 30%-60% faster for both the matching and non-matching case, as measured with timeit on Python 2.7 and 3.6, and saves at least a few percent of total parsing time (and probably some evaluation time too). isinstance(foo, tuple) is particularly slow. Symbol and Choice instances are always created by us, so potential subclassing shouldn't be a problem.
2018-11-18Make 10.22.1 releasev10.22.1Ulf Magnusson
Adds commit df61771 ("menuconfig: Never snap scroll back to max_scroll"), which fixes a small menuconfig UI nit. Add 'configuration-management' as a tag to setup.py as well.
2018-11-18sync_deps() docstring format nitUlf Magnusson
2018-11-18menuconfig: Never snap scroll back to max_scrollUlf Magnusson
When scroll > max_scroll (blank space at the bottom of the menu, and also scrolled down), moving the cursor down would snap the scroll back to max_scroll, with a small annoying jump. This could happen when going into show-all mode and moving the cursor down near the bottom of a menu, for example. Fix it by leaving the scroll as-is when scroll >= max_scroll (increasing it by one otherwise).
2018-11-18menuconfig: Tighten up _shown_nodes() a bitUlf Magnusson
Move the addition of the visible child nodes and use += instead of extend().
2018-11-18menuconfig: Get rid of a temporary list in the jump-to implemenationUlf Magnusson
Not noticeable performance-wise, but a bit neater.
2018-11-17Link Kconfig tips page in READMEUlf Magnusson
2018-11-17Make 10.22.0 releasev10.22.0Ulf Magnusson
Adds commit b65baa4 ("Add support for KCONFIG_ALLCONFIG"), which allows particular symbol values to be forced during all{def,no,mod,yes}config.
2018-11-17Add support for KCONFIG_ALLCONFIGUlf Magnusson
This allows some symbol values to be forced while running all{def,no,yes,mod}config.py. See Documentation/kbuild/kconfig.txt in the Linux kernel. Add a helper function load_allconfig() to Kconfiglib to avoid code duplication in the tools. Also add functions for enabling/disabling the warning that's generated when a symbol is assigned multiple times in a (set of) .config files and the values differ. It should be disabled when merging the KCONFIG_ALLCONFIG configuration file. Previously, only the warning generated when the assigned values are identical could be disabled. Disable all warnings related to assigning a symbol multiple times in examples/merge_config.py as well.
2018-11-17Kconfig formatting nit in docstringUlf Magnusson
2018-11-17Remove outdated comment in eval_string()Ulf Magnusson
2018-11-07Make 10.21.0 releasev10.21.0Ulf Magnusson
Adds two small library/menuconfig improvements: - Commit 7992519 ("Always strip trailing whitespace in 'MenuNode.help' and __str__()") tightens up the format of strings a bit, and documents it. - Commit b810bda ("menuconfig: Support HOME and END in the jump-to dialog") adds support for some keys that were missing from the jump-to dialog.
2018-11-07menuconfig: Support HOME and END in the jump-to dialogUlf Magnusson
Oversight. END can be handy for viewing all choices, menus, and comments, which appear at the end. Also support Ctrl-D as an alias for Page Down. Ctrl-U is already used by the edit box (erase to beginning of line). Also change the jump-to dialog title to hint that other things besides symbols can be jumped to.
2018-11-07Add a fast path for string parsingUlf Magnusson
For strings with no $ or \ in them (99.86% of all strings in the Linux x86 Kconfigs), we can just find() the matching quote directly. Saves a few % of tokenization time.
2018-11-06Comment nitUlf Magnusson
2018-11-06Always strip trailing whitespace in 'MenuNode.help' and __str__()Ulf Magnusson
Previously, you could get either one or two newlines at the end of MenuNode.help and the various __str__() methods, though this wasn't documented. Always stripping trailing whitespace is cleaner e.g. when using print(), which automatically appends a trailing newline, and makes things consistent. Hopefully nothing relied on the old undocumented behavior. It's fine for genrest.py at least.
2018-11-06Whitespace nitUlf Magnusson
2018-11-04Comment grammar nitUlf Magnusson
2018-11-04Make 10.20.0 releasev10.20.0Ulf Magnusson
Adds a small menuconfig improvement: Commit 35af004 ("menuconfig: Move cursor to choice selection when entering choices").
2018-11-04menuconfig: Move cursor to choice selection when entering choicesUlf Magnusson
Previously, the first entry was selected, like for menus. Also tweak _center_vertically() so that the menu is never scrolled down when all entries fit on the screen.
2018-11-03Make UNKNOWN falsyUlf Magnusson
Set UNKNOWN (representing 'no type') to 0, which is falsy, to simplify some checks. Also reorder some dictionary keys for consistency.
2018-11-02Make 10.19.1 releasev10.19.1Ulf Magnusson
Adds fixes for two obscure crashes, related to consecutive empty if's and toggling symbols without a type in the menuconfig: - Commit 0e6cd82 ("Fix removal of multiple consecutive 'if' nodes") - Commit db60270 ("menuconfig: Fix crash when toggling symbols without a type")