summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-10-28Add uncommitted test filesUlf Magnusson
2017-10-28Test suite work, cleanup, const sym invalidation fixUlf Magnusson
2017-10-28Nearly finalize APIUlf Magnusson
Probably just some usability tweaks left. Having to do STR_TO_TRI[] for comparisons against 'assignable' values is kinda ugly and confusing.
2017-10-27Mention kconfiglib-2-backup branchUlf Magnusson
2017-10-27BackupUlf Magnusson
2017-10-27BackupUlf Magnusson
2017-10-25BackupUlf Magnusson
2017-10-25BackupUlf Magnusson
2017-10-24Kconfiglib 2 backupUlf Magnusson
WIP
2017-10-22Notify about upcoming releaseUlf Magnusson
2017-10-02Clean up _expand_sym_refs() a bitUlf Magnusson
Get the symbol name without the '$' straight from the regex.
2017-10-02Explain common 'source' gotcha in warningUlf Magnusson
$FOO in 'source "$FOO"' refers to a Kconfig symbol rather than an environment variable. Seems there might be some tools derived from the kernel Kconfig implementation that work differently here.
2017-10-02Test suite style nitsUlf Magnusson
2017-10-02Remove empty Comment.__init__()Ulf Magnusson
Didn't even notice that it had become empty...
2017-10-02Rename _dep to _direct_dependentsUlf Magnusson
Clearer.
2017-10-02_type_and_val() nitUlf Magnusson
2017-10-02Mention that pypy speeds up the test suiteUlf Magnusson
2017-10-02line_profile a bit moreUlf Magnusson
Add some micro-optimizations that speed up allyesconfig.py by 10-20% with CPython. Clean up some minor stuff too.
2017-10-02Make 1.0.6 releasev1.0.6Ulf Magnusson
Fixes an imply-related issue: 1774239 (Make 'imply' consider direct dependencies). Imply support should be solid now.
2017-10-02Make 'imply' consider direct dependenciesUlf Magnusson
Bad oversight. Weak reverse dependencies (from imply) are not considered if the direct dependencies of a symbol are not met (the 'if'/'depends on' dependencies from the symbol and its parents, taking location into account if the symbol is defined in multiple places). Caused a wrong value for the symbol FS_FAT in the U-Boot Kconfigs, where 'imply' is more heavily used compared to the kernel. Add a new variable _direct_deps that corresponds to dir_dep from the C implementation. Before 'imply', dir_dep was only used for a 'select'-related warning in the C implementation. Add a bunch of tests to cover 'imply' semantics. Should be solid now.
2017-10-01Mention ranges too in commentUlf Magnusson
Also be a bit more consistent in how property variables are ordered.
2017-10-01Make 1.0.5 releasev1.0.5Ulf Magnusson
The only fix is 2a2fcbd (Propagate dependencies to range conditions), which fixes an obscure issue with dependencies on 'range x y' properties. Also includes some internal cleanup and optimization.
2017-10-01Propagate dependencies to range conditionsUlf Magnusson
Just like for other properties, conditions on ranges get local 'depends on' and parent dependencies propagated to them. Oversight. Did not trigger any deviations for the kernel defconfigs. Pretty specific circumstances were required for breakage, like a symbol depending on the particular value of a symbol with a 'range' and parent deps 'n', or a symbol with ranges being defined in multiple locations with different parent deps. (There is one symbol that both has ranges and is defined in multiple locations: BCH_CONST_M. The second definition adds a default rather than a range though.)
2017-10-01Micro-optimize _tokenize() some moreUlf Magnusson
Slightly modifying _STRING_LEX allows the (common) symbol reference case to be detected earlier and removes some assignments. Also modify some comments and air things out a bit.
2017-09-30Get rid of _referenced_symsUlf Magnusson
Calculate as needed instead, using _get_expr_syms(). Simplifies the parsing code. Also rename _get_expr_syms*() to _expr_syms*() and make it append to a list. Handy for the new way it's being used.
2017-09-30Get rid of _selected_syms and _implied_symsUlf Magnusson
Calculate as needed instead. Old cruft.
2017-09-30Get rid of _all_referenced_symsUlf Magnusson
Calculate it as needed instead. It's not used internally. Also move get_referenced_symbols() to the Item base class, as the logic is identical for symbols/choices/menus/comments. Finally a non-silly use for it.
2017-09-30Clean up dependency handlingUlf Magnusson
- Menu/Comment._dep_expr and Symbol/Choice._menu_dep are really the same thing internally in the C implementation (the dependency for the "menu node", which is also used to implicitly create menus), and it simplifies the code to treat them like that here too. - Reuse the calculated _menu_dep (which has parent and 'depends on' dependencies) when propagating dependencies to properties. - Get rid of the temporary lists. It's now easy to use plain 'for' loops to add the properties. - Catch attempts to use select/imply from menus and choices early and error out. - Add comments clarifying which variables are only used when displaying items.
2017-09-29Move _is_header_line to a better spotUlf Magnusson
There's already a "misc." section. Also fix typo in docstring.
2017-09-29Make 1.0.4 releasev1.0.4Ulf Magnusson
Fixes: - After 250b370 (Refactor load_config() and fix minor issues), print_undef_assign=True also considers "# CONFIG_NOT_DEFINED is not set", which acts like an "n" assignment in practice. - 7cbfa47 (Fix undef. assign warning in set_user_value()) Also contains some internal cleanup and optimization.
2017-09-29Refactor load_config() and fix minor issuesUlf Magnusson
Minor fixes: - Even with print_undef_assign=True, "# CONFIG_NOT_DEFINED is not set" would not generate a warning. - Change the warning when a variable is set more than once in the .config to be a bit more explicit. - Only de-quote and unescape assignments to string variables, which is nicer and matches the C implementation.
2017-09-29.config header parsing nitsUlf Magnusson
Rearrange a bit and document that a trailing newline does not need to be added. Clean up the tests a bit too.
2017-09-29Fix undef. assign warning in set_user_value()Ulf Magnusson
Previously we'd crash instead of printing the warning, because we didn't pass 'filename' and 'linenr' to _stderr_msg(). This code path currently can't be reached via load_config() and needs an explicit set_user_value(), so the bug went undetected. Fix by breaking out a separate _warn_undef_assign() that defaults 'filename' and 'linenr' to None, similar to _warn().
2017-09-29Reorganize whitespace stripping in _tokenize()Ulf Magnusson
By consistently stripping trailing whitespace instead of stripping initial whitespace in the string/operator case, we do less redundant work and handle the '\n's at the end of lines better. Shaves a few % off the _tokenize() runtime in cProfile and line_profiler.
2017-09-29Rename _kconfig_syms to _defined_symsUlf Magnusson
More explicit.
2017-09-29Only invalidate defined symbolsUlf Magnusson
Think I had it in the back of my head somewhere that not invalidating undefined symbols could break some obscure cases, but turns out it's perfectly safe: Nothing can change the value of an undefined symbol. They always get their name as their value. There's no need to unset user values on them either, because set_user_value() already refuses to to set one on them. Lets us get rid of the Python 2/3 compatibility hack and instead iterate over a plain list of defined symbols.
2017-09-29Make _already_written local to write_config()Ulf Magnusson
The clear loop in write_config() already guarantees that _already_written will be set for all symbols that could be written out to the .config. Clarifies the scope. Also change the code to only clear _already_written for defined symbols. No other symbols could ever be written out. Gives a nice loop over a plain list.
2017-09-29_get_visibility() choice clarification nitUlf Magnusson
2017-09-28Fix unified diff output for the defconfig testsUlf Magnusson
Would get crammed in between the arch/defconfig string and the "FAIL".
2017-09-28Refactor get_value()Ulf Magnusson
- Get rid of the use_defaults* variables and clean up the defaults logic. As a side effect, '_write_to_conf' is now set in all paths and doesn't need to be set initially in the function. - Rename 'new_val' to just 'val'. - Clean up the range handling for INT/HEX a bit. - Other minor nits.
2017-09-28Print unified diff on test suite failuresUlf Magnusson
Compares the .config's generated by us and the C implementation. Speeds up debugging compared to manually generating them. Clean up the test code a bit too.
2017-09-28Fix incorrect year in READMEUlf Magnusson
Typo
2017-09-28Get rid of _comment()Ulf Magnusson
Can be handled inline in a nicer way, especially with writelines().
2017-09-28Refactor and optimize .config generationUlf Magnusson
- Use the nifty writelines() function, which I had completely missed. Saves creating a large temporary string for each .config (though it's probably not a big deal). Since writelines() doesn't add any newlines, tweak the string literals to add them. - Get rid of _make_block_conf(). This helper made more sense in ancient versions where there was a separate _Block class. - Rename _make_conf() to _add_config_strings() to be a bit more explicit. - Also rename the 'append_fn' parameter to 'add_fn'. - Misc. minor nits.
2017-09-27Undefault _parse_expr()'s 'transform_m'Ulf Magnusson
Better to be explicit. Weren't that many users left now either.
2017-09-27Rename Config._filename to Config._kconfig_filenameUlf Magnusson
Mirrors Config._config_filename and makes it clearer which file each variable refers to.
2017-09-27Refactor _parse_expr(), fix get_kconfig_filename()Ulf Magnusson
Those are related: The hack in _parse_expr() accidentally overwrote the _filename variable, causing get_kconfig_filename() to return the wrong filename if the base Kconfig file ended with a 'source' statement. Remove the hack and explicitly pass all the variables. It might have made more sense in an older version of the code. Also add back the grammar in a different format, some more comments, and a mind dump from tinkering with the parsing code.
2017-09-27Undefault _parse_expr()'s 'filename' and 'linenr'Ulf Magnusson
Single user, not worth the obfuscation. Also fix an outdated reference re. 'transform_m' and remove the grammar as it makes things seem more complex than they really are.
2017-09-27Make 1.0.3 releasev1.0.3Ulf Magnusson
Fixes two minor issues that didn't trigger for the kernel defconfigs but were found by inspecting the Kconfig C sources: - 5f3d307 (Fix 'default' on non-visible choice symbols) - f76a524 (Hide non-tristate symbols in non-y tristate choices) Also includes some minor optimizations and a lot of code cleanups, including prefixing all internal identifiers with _.
2017-09-27Warn if the Makefile patch hasn't been appliedUlf Magnusson
The old error from the test suite was cryptic.