summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-17Remove TILE architecture from test suiteUlf Magnusson
Removed in linux-next.
2018-03-16Link to pymenuconfigUlf Magnusson
A menuconfig implementation built on top of Kconfiglib using TkInter.
2018-03-13Test grsource with nonexistent fileUlf Magnusson
Just for completeness.
2018-03-13Mention rsource and gsource in READMEUlf Magnusson
2018-03-13Add a globbing source statementUlf Magnusson
'gsource' works like 'source', but takes a glob pattern and sources all matching files. Works as a no-op if no files match, and hence doubles as an include-if-exists function, similar to '-include' in 'make'. Add a 'grsource' statement as well, mirroring 'rsource'. Came up in https://github.com/ulfalizer/Kconfiglib/pull/40.
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-11Properly remember y user values for choice symbolsUlf Magnusson
Commit e8b4ecb ("Don't special-case user_value for choice symbols set to y") was meant to make user_value reflect an y value assigned to a choice symbol, but didn't get it right for load_config() with replace=True: The user value was set at first, but was then unset again due to a misplaced '_was_set = True' assignment. This commit makes y choice symbol user values always be remembered. The correctness of generated files was not affected, since the user selection of a choice is actually remembered as Choice.user_selection. The previous commit just turned into a no-op for load_config() with replace=True.
2018-03-10testsuite.py: Break out a defconfig_files() helperUlf Magnusson
defconfig_files() yields all the defconfig files for a particular arch/ subdirectory. This will allow reuse when savedefconfig is tested. Also simplify the code a bit.
2018-03-09testsuite.py: Don't count defconfig filesUlf Magnusson
Not that important of a stat, plus there might be more tests that process defconfig files soon, making it kinda meaningless.
2018-03-06Simplify test suite loggingUlf Magnusson
No great need to log timestamps anymore.
2018-03-06Avoid shadowing test_defconfig() 'srcarch' parameterUlf Magnusson
The 'for' overrode 'srcarch', which is currently harmless, but ugly.
2018-03-06testsuite.py: Use 'srcarch' instead of '_arch' in test_defconfig()Ulf Magnusson
Makes sense as SRCARCH holds the arch/ subdirectory and _arch might be confused for ARCH.
2018-03-06testsuite.py: Refactor run_compatibility_tests()Ulf Magnusson
Get rid of the compare_configs flag and just do the comparison from the test functions themselves with a helper. Also get rid of the test_load() test. That's indirectly tested through the other tests, and test_alldefconfig() runs first and is speedy.
2018-03-05Use comments instead of docstrings for internal functionsUlf Magnusson
The original idea was that it might be handy to look up docstrings for internal functions from the Python prompt (or an IDE) while figuring out the code. Not sure it's that useful in practice though. Comments shorten the code a bit, and might make it clearer at a glance that the function is internal.
2018-03-05Move 'val' initialization a bit later in tri_value()Ulf Magnusson
Makes it harder to miss.
2018-03-05Remove _get_* prefix from internal worker functionsUlf Magnusson
The _get_* prefixes don't improve readability and are inconsistent: All other getters are simply named after the thing they fetch. Leftover from Kconfiglib 1.
2018-03-05Fix defconfig_list-related comment typoUlf Magnusson
s/the defconfig_list/the defconfig_list symbol/
2018-03-05Do not write the defconfig_list symbol to .configUlf Magnusson
Mirrors the following change to the C tools, now in linux-next: commit c21a6e352766005d42c1ccae32b31e0438903eb9 Author: Masahiro Yamada <yamada.masahiro@socionext.com> Date: Sat Feb 17 03:38:32 2018 +0900 kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list The 'defconfig_list' is a weird attribute. If the '.config' is missing, conf_read_simple() iterates over all visible defaults, then it uses the first one for which fopen() succeeds. config DEFCONFIG_LIST string depends on !UML option defconfig_list default "/lib/modules/$UNAME_RELEASE/.config" default "/etc/kernel-config" default "/boot/config-$UNAME_RELEASE" default "$ARCH_DEFCONFIG" default "arch/$ARCH/defconfig" However, like other symbols, the first visible default is always written out to the .config file. This might be different from what has been actually used. For example, on my machine, the third one "/boot/config-$UNAME_RELEASE" is opened, like follows: $ rm .config $ make oldconfig 2>/dev/null scripts/kconfig/conf --oldconfig Kconfig # # using defaults found in /boot/config-4.4.0-112-generic # * * Restart config... * * * IRQ subsystem * Expose irq internals in debugfs (GENERIC_IRQ_DEBUGFS) [N/y/?] (NEW) However, the resulted .config file contains the first one since it is visible: $ grep CONFIG_DEFCONFIG_LIST .config CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" In order to stop confusing people, prevent this CONFIG option from being written to the .config file. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05Simplify sync_deps() value testsUlf Magnusson
Use the result from the initial str_value call in more places. Also add a comment to make it clear how _write_to_conf is calculated, mirroring the ones in write_config() and write_autoconf().
2018-03-03_write_old_vals() consistency nitUlf Magnusson
2018-03-03Simplify initial auto.conf setupUlf Magnusson
Instead of creating an empty initial auto.conf and immediately loading it, look for a missing auto.conf in _load_old_vals() and treat that the same as an empty auto.conf (by returning after clearing the old values). The initial auto.conf will then be written as normal by _write_old_vals(). Also flesh out the sync_deps() docstring a bit: - Make it clear that sync_deps() should be run at each build - Be more explicit about what it means for a symbol to have changed (different output in autoconf.h)
2018-03-03Accept existing directory with no auto.conf in sync_deps()Ulf Magnusson
An initial empty auto.conf will be created, just as when sync_deps() creates the directory. This is more flexible. There's no good reason to require the directory to be created by sync_deps().
2018-03-01Simplify _parse_factor() error handlingUlf Magnusson
"malformed expression" should be clear enough for a missing end parenthesis too. Expressions are generally short.
2018-03-01Give .config location in invalid bool/tristate value warningUlf Magnusson
Oversight
2018-03-01Make expression type constants equal their corresponding tokensUlf Magnusson
This gets rid of _TOKEN_TO_REL and removes the conversion in _parse_factor(). It's pretty easy to understand too. Having e.g. just EQUAL and no _T_EQUAL would be too confusing, so keep the separate names still. Piggyback small _REL_TO_STR and _T_OPEN_PAREN code nits.
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-28More sync_deps() docstring nitsUlf Magnusson
2018-02-28sync_deps() docstring nitUlf Magnusson
2018-02-28Rename _sync_sym_files() to _sync_deps()Ulf Magnusson
Forgot to rename the helper as well after renaming sync_sym_files() to sync_deps().
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-28Remove small write_{config,autoconf}() optimizationsUlf Magnusson
They're really minor, and copying them around when new output functions are added gets a bit silly. These functions are used as a reference too, so maximum readability helps.
2018-02-28Return "" for unwritten symbols in Symbol.config_stringUlf Magnusson
The previous return value was None. Returning "" makes write_config() neater and feels a bit more Pythonic. It might simplify the implementation of some planned features as well. This is a small API break, so the major version will be bumped to 4 in the next release. Only code that explicitly tests Symbol.config_string against None will be affected: 'if sym.config_string is None:' will break, but not 'if not sym.config_string:'.
2018-02-27Move sym._written setting earlierUlf Magnusson
Makes the logic a bit clearer, and might save some branching.
2018-02-27testsuite.py: Remove write_and_verify_header()Ulf Magnusson
Unused leftover from Kconfiglib 1.
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-27Implement 'rsource' statement ('source' with relative path)Roman
The 'rsource' statement works like 'source', but looks relative to the Kconfig file that has the 'rsource' rather than relative to the base Kconfig file. Using 'rsource' makes it possible to move subtrees with Kconfig files around without breaking references to other Kconfig files. So far, this is a Kconfiglib-exclusive feature.
2018-02-25Clarify the purpose of _STRING_LEXUlf Magnusson
The main purpose of _STRING_LEX is being able to tell strings from constant symbol references during tokenization. The old comment was implying that its only purpose is handling the "missing quotes" in e.g. source foo/Kconfig Update the comment to make _STRING_LEX clearer.
2018-02-25menuconfig.py: More style and comment nitsUlf Magnusson
- Use generator expression rather than list comprehension - Fix dubious English
2018-02-25menuconfig.py: Style and comment nitsUlf Magnusson
2018-02-23menuconfig.py: Remove unused STR_TO_TRI importUlf Magnusson
Piggyback a small note to clarify that symbols defined without a type are pretty obscure.
2018-02-16Make 3.1.0 releasev3.1.0Ulf Magnusson
Only includes 2a88c0c ("Include direct deps. in Symbol/Choice.__str__()").
2018-02-16Include direct deps. in Symbol/Choice.__str__()Ulf Magnusson
Direct dependencies are significant for 'imply' even if the symbol has no properties, so they need to be included to get semantically equivalent output. Making the direct dependencies clear is helpful in general too, even if you can usually infer them from the properties they get propagated to.
2018-02-09oldconfig.py style nitsUlf Magnusson
2018-02-09Simplify tri_value_str() in oldconfig.pyUlf Magnusson
2018-02-09Simplify visibility check in Choice._get_selection()Ulf Magnusson
The visibility of a symbol in an y-mode choice can only be n or y, so it's sufficient to check that it's not n (0).
2018-02-08oldconfig.py comment nitUlf Magnusson
2018-02-08Give hint about recognizing undefined symbolsUlf Magnusson