| Age | Commit message (Collapse) | Author |
|
This case wasn't covered.
|
|
The property lists weren't created for Kconfig.top_node, making
referenced() crash.
Add a MenuNode constructor and create the property lists there instead
of in _parse_properties().
|
|
_propagate_deps() visits menu nodes roughly breadth-first, meaning
properties on symbols and choices defined in multiple locations could
end up in the wrong order when copied from the menu node for some
unlucky if/menu nestings.
Fix it by moving the menu-node-to-symbol/choice property copying in
_finalize_tree() so that it's guaranteed to happen in definition order.
This bug was introduced by commit 63a4418 ("Record which MenuNode has
each property").
|
|
MenuNode.referenced() returns all symbols (and choices, for choice
symbols) referenced in the properties (prompt, defaults, selects,
ranges, etc.) and property conditions of the menu node.
Handy e.g. when generating cross-references.
|
|
Handy e.g. when searching.
|
|
The defconfig tests tend to find any issue quickly, so keep those first.
Go alldefconfig -> allnoconfig -> allmodconfig -> allyesconfig after
that, and do the sanity checks at the end.
|
|
Verified to produce identical output to 'make allmodconfig', for all
arches.
Will be packaged.
|
|
Will be packaged.
Piggyback test suite cleanups to make test names match the name of the
script being tested.
|
|
standard_kconfig() gets the top-level Kconfig file from the first
command-line argument, defaulting to "Kconfig". This removes some
boilerplate from tools.
|
|
Move to the root, simplify a bit, provide an entry point function (for
setuptools's entry_points).
|
|
Handy e.g. when implementing advanced search features.
|
|
Useful in various places outside the library, e.g. in the upcoming
packaged allyesconfig implementation, and when generating documentation.
|
|
Put to-be-packaged stuff in the root.
Use allnoconfig_simpler.py, and rename allnoconfig.py to
allnoconfig_walk.py and keep it as an example.
|
|
Had missed sys.exit(msg).
|
|
Commit cbf32e2 ("Expand environment variables in strings directly")
added direct expansion of environment variables is strings, with commit
b9384a1 ("Restore compatibility with $UNAME_RELEASE") adding a hack to
restore compatibility with the predefined $UNAME_RELEASE symbol, used by
DEFCONFIG_LIST in the Linux kernel.
With the compatibility hack in place, there's no longer any need to
define UNAME_RELEASE as a proper symbol. Remove it.
|
|
Shaves ~6% off the _parse_help() runtime for the x86 Kconfigs in
cProfile.
|
|
This allows accurate documentation to be generated for symbols and
choices defined in multiple locations. There are now MenuNode.defaults,
MenuNode.selects, etc., lists that mirror the corresponding
Symbol/Choice lists.
Symbol/Choice.__str__() now correctly show property locations as well,
by simply concatenating the strings returned by MenuNode.__str__() for
each node.
_parse_properties() was modified to add all properties directly to the
menu node instead of adding them to the contained symbol or choice. The
properties are then copied up to symbols and choices in
_finalize_tree(). Dependency propagation is handled at the same time.
As a side effect, this cleans up the code a bit and de-bloats
_parse_properties().
Update the menuconfig implementation to use the new functionality. It
now lists the menu nodes for symbols and choices with the correct
properties for each node (previously, all defaults, selects, implies,
and ranges appeared on the first definition).
|
|
Make "$FOO" directly reference the environment variable $FOO in e.g.
'source' statements, instead of the symbol FOO. Use os.path.expandvars()
to expand strings (which preserves "$FOO" as-is if no environment
variable FOO exists).
This gets rid of the 'option env' "bounce" symbols, which are mostly
just spam and are buggy in the C tools (dependencies aren't always
respected, due to parsing and evaluation getting mixed up). The same
change will probably appear soon in the C tools as well.
Keep accepting 'option env' to preserve some backwards compatibility,
but ignore it when expanding strings. For compatibility with the C
tools, bounce symbols will need to be named the same as the environment
variables they reference (which is the case for the Linux kernel).
This is a compatibility break, so the major version will be bumped to 6
at the next release.
The main motivation for adding this now is to allow recording properties
on each MenuNode in a clean way. 'option env' symbols interact badly
with delayed dependency propagation.
Side note: I have a feeling that recording environment variable values
might be redundant to trigger rebuilds if sync_deps() is run at each
compile. It should detect all changes to symbol values due to
environment variables changing value.
|
|
Also make printing of warnings to stderr optional. It's on by default,
since it's almost always what you want.
This makes printing and processing of warnings more flexible, compared
to always printing warnings to stderr as soon as they're generated. It
was inspired by wanting to promote certain warnings to errors in Zephyr,
which previously required capturing stderr.
|
|
I've had to implement the logic for walking reverse dependencies (from
select) a couple of times now, and it's always a bit tricky to get
right. Reduce code duplication and simplify things by adding a helper
function split_expr() that splits an expression into a list of either
its AND or OR operands.
A nice side effect is that e.g. the warning generated for selecting a
symbol with unsatisfied direct dependencies now lists the selecting
symbols in the order that they appear in the Kconfig files.
split_expr() might be helpful for splitting other types of expressions
as well, e.g. to put operands on separate lines when generating
documentation.
|
|
Oversight
|
|
Extending the scope of is_menuconfig so that it's True for all items
whose children should be displayed in a separate menu turns out to be
handy when implementing menuconfig-like functionality.
Keep the old name for backwards compatibility. It's good enough.
|
|
This is redundant from an evaluation perspective, as && has higher
precedence than ||, but is easier to read.
A && B || C && D is now rendered as "(A && B) || (C && D)".
|
|
- Detect Symbol directly instead of as (not tuple) + (not choice)
- Test explicitly for a tuple (non-Symbol) in NOT
- Add some tests to get better coverage for NOT and parentheses
|
|
The Kconfig object is replaced immediately after it.
|
|
Example warning:
warning: user value 0x100 on the hex symbol HEX (defined at Kconfig:18) ignored due to being outside the active range ([0x13, 0x73]) -- falling back on defaults
This is a Kconfiglib-exclusive warning. It might be tricky to implement
in the C tools, due to weird two-phase handling of int/hex symbols.
There is unfortunately no easy way to map the warning back to a .config
line, as the active 'range' can't be known in general until the entire
configuration has been read (consider 'range 0 10 if FOO' for example).
Instead, the warning is generated when the symbol value is calculated.
|
|
Removed in linux-next.
|
|
Just for completeness.
|
|
'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.
|
|
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.
|
|
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.
|
|
Not that important of a stat, plus there might be more tests that
process defconfig files soon, making it kinda meaningless.
|
|
No great need to log timestamps anymore.
|
|
The 'for' overrode 'srcarch', which is currently harmless, but ugly.
|
|
Makes sense as SRCARCH holds the arch/ subdirectory and _arch might be
confused for ARCH.
|
|
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.
|
|
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().
|
|
Unused leftover from Kconfiglib 1.
|
|
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.
|
|
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.
|
|
Previously, setting a choice symbol to y would only update
user_selection on the parent choice and not the symbol's own user_value.
Now both are updated.
The point of the old behavior was to remember the m mode selections of a
choice when it was switched back and forth between m and y mode, which
was a feature I thought the C implementation had. On closer inspection,
the C implementation never had that feature, though it might appear like
it if you only make "lucky" changes (if you never select any symbols in
y mode that were n in m mode).
The new behavior is simpler and easier to understand: Symbol.user_value
now always matches the value assigned in a .config file or via
set_value(), provided the value was well-formed. This might avoid some
special-casing in scripts too.
The loss in usability is pretty minimal.
|
|
Oversight during refactoring. defconfig files should be searched for in
in arch/$SRCARCH/ rather than arch/$ARCH/, to account for
$ARCH != $SRCARCH.
Adds a few tests to test_defconfig(). Some of the ARCH/defconfig
combinations might be nonsensical, but that's fine.
Make all test functions take $SRCARCH as well as $ARCH, which makes the
implementation straightforward.
|
|
List the ARCH/SRCARCH pairs that don't conform to the arch/$ARCH/Kconfig
pattern directly.
|
|
Don't think anything currently depends on it where it would matter for
the test suite, but might as well.
|
|
Just to have clean output. The warnings themselves are accurate.
|
|
These are easiest to check after parsing, since a symbol/choice can be
defined in multiple locations:
- Warn if a symbol or choice defined without a type. Also warn for
choice value symbols defined without a type, even if they
automatically get their type from the choice. This feature isn't
well-known and probably not used deliberately.
- Warn if a choice is defined without a prompt
- Warn of a choice default symbol is not contained in the choice
Also move _name_and_loc_str() from the symbol class to the global scope
and generalize it to be able to handle choices.
|
|
Might break U-Boot if they ever upgrade Kconfiglib, because they have a
'select y' in there (which the C tools don't flag since they only look
for quotes), but it's a one-line fix.
|
|
Mirrors 9059a3493ef ("kconfig: fix relational operators for bool and
tristate symbols") in the C implementation.
|
|
The fancy regex isn't really justified. Much faster with replace() too,
though this is an unlikely hotspot.
Could have used a \g<0> backreference to refer to the entire match
instead of using a capturing group too. Hadn't discovered that.
Add some selftests for escape() and unescape() too.
|
|
|