zephyr/scripts
Ulf Magnusson 54a5997f5c kconfiglib: Add dependency loop detection
Update Kconfiglib to get upstream commit ca89ca0c0c420 ("Add dependency
loop detection") in.

Upstream commit message
=======================

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)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-20 15:53:38 -04:00
..
checkpatch scripts: cleanup scripts directory 2018-04-03 09:28:09 -04:00
ci kconfig: Fail in CI if Kconfig files reference undefined symbols 2018-06-18 11:25:35 +02:00
cmake
cross_compiler
dts scripts: extract: globals.py: fix node name when it includes "@" 2018-06-12 03:54:26 -04:00
footprint
gitlint
kconfig kconfiglib: Add dependency loop detection 2018-06-20 15:53:38 -04:00
meta/west scripts: west: cherry-pick upstream 321ab2e17 2018-06-08 16:06:16 -05:00
sanity_chk release: update footprint data 2018-06-11 10:37:14 -05:00
support scripts: make runner a west subpackage 2018-05-19 07:01:39 +03:00
.gitignore
check_host_is_ok.py
check_link_map.py
checkpatch.pl checkpatch: downgrade COMPLEX_MACRO to a warning 2018-05-08 08:56:12 -07:00
checkstack.pl
dir_is_writeable.py cmake: Add function for checking if a directory is write-able 2018-04-27 12:06:02 +02:00
elf_helper.py Fix struct offsets (DWARF v2 compatibility) 2018-05-25 16:49:42 +02:00
file2hex.py
filter-known-issues.py
gen_alignment_script.py
gen_gdt.py
gen_idt.py
gen_kobject_list.py scripts: generalize kobject -> enum naming 2018-05-23 11:37:47 -07:00
gen_mmu_x86.py
gen_offset_header.py
gen_priv_stacks.py
gen_syscall_header.py gen_syscall_header.py: fix include issue 2018-03-28 20:52:08 -04:00
gen_syscalls.py gen_syscalls.py: fix include issue 2018-03-28 20:52:08 -04:00
parse_syscalls.py
process_gperf.py
py2-requirements.txt doc: install pyocd using pip2 2018-02-06 19:40:42 -05:00
qemu-machine-hack.py
requirements.txt doc: update doc build tools documentation 2018-06-18 12:42:18 -04:00
sanitycheck usb: tests: Add usb_bos_desc to sanitycheck table 2018-06-20 15:47:00 -04:00
spelling.txt
subfolder_list.py cmake: Using symlinks on unix like os'es for dependencies 2018-06-19 17:00:27 +02:00
tags.sh
waitpid
west scripts: create meta-tool package, "west" 2018-05-19 07:01:39 +03:00
west-win.py scripts: create meta-tool package, "west" 2018-05-19 07:01:39 +03:00