External projects might run check-compliance.py from a subdirectory,
while list_undef_kconfig_refs.py expects to find the top-level Kconfig
file in the current directory.
Due to obscure Kconfig ugliness (explained in a comment), the working
directory needs to be changed here, instead of using 'srctree'.
(Thinking of changing that Kconfig behavior so that it only applies to
.config files. Suspect it's been a bug in the C tools all along for
Kconfig files.)
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The warnings were fixed by commit c4123643b5 ("tests: fp_sharing:
Extract x86 configs to separate .conf").
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
VERBOSE if set to any value enables verbose build output,
setting to 0 does not have the intended effect.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
intList has been populated with the number of isrs, aka interrupts,
but nothing has not been using this information so we drop it and
everything used to construct it.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This allows for scripts using nrfjrog to specify the serial number of
the attached device to use instead of showing a list of available
devices by adding an optional parameter.
Signed-off-by: Jamie McCrae <jamie.mccrae@lairdtech.com>
Update Kconfiglib to get upstream commit eb6c21a9b33a2 ("Turn
MenuNode/Symbol/Choice.referenced() into a @property") in. It converts
the MenuNode.referenced() function into a property, which makes the API
more consistent (read-only stuff uses properties).
Also update scripts/ci/list_undef_kconfig_refs.py to access .referenced
as a property.
Piggyback a small is_num() simplification.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
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>
Fixes: #8380
This commit fixes the side-effect of PR #8211 where a 'ninja clean'
would try to remove dependency folders.
Changes:
- Symlinks are created during build and CMake targets now depends on
the symlinks. Thus, same behavior is achived with regards to
dependency handling, while at the same time, the output can be
cleaned as the dependencies are now attached to the symlinks.
- Dependencies have been changed so that generation of json files
depends on the trigger file and CMake depends upon the subdir txt
file. This prevents additional CMake runs after a clean.
Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Having to go back to the main display all the time gets awkward,
especially when searching to look up symbol information.
Allow the symbol information dialog to be opened from the search dialog
(with Ctrl-F, since '?' is already used there as a regex metacharacter),
and also allow a search to be started from the symbol information
dialog.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit gets upstream commit dc0b022247b85 ("Correctly report choice
locations in some warnings") in, which fixes some warnings that would
previously report the location of a choice as being "undefined" (which
is impossible).
Upstream commit message:
Menu nodes were added to choices after parsing their properties,
making some warnings generated during parsing (as opposed to in
_check_choice_sanity()) incorrectly give the choice as '<choice>
(undefined)'.
Add the node before parsing choice properties to fix those warnings.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Tailor the warning when the symbol has no prompt, explaining how
promptless symbols get values. Add some anti-select propaganda too.
- Reference the 'Setting configuration values' in the Board Porting
Guide. It explains Kconfig.defconfig files.
Fixes: #8388
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Update the doc build tools versions listed in requirements.txt (and
mentioned in the doc building instructions).
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Add a helper module scripts/ci/list_undef_kconfig_refs.py that searches
the entire Kconfig tree and reports any references to undefined Kconfig
symbols. Use it to add a new check to scripts/ci/check-compliance.py.
Also allow list_undef_kconfig_refs.py to be run standalone.
Example error:
Error: Found references to undefined Kconfig symbols:
BAR
===
- Referenced at Kconfig:12:
config FOO
bool
depends on BAR
- Referenced at Kconfig:16:
menu "menu"
depends on BAR
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit fixes a pretty nasty bug that could cause properties on
symbols and choices defined in multiple locations to end up in the wrong
order, potentially affecting evaluation.
Alexander Wachter ran into this for an out-of-tree build.
Multi.def. symbols are rare in the Linux kernel, which is what the
Kconfiglib test suite uses for compatibility testing, so this managed to
slip through. Comprehensive selftests have been added for property
ordering on nested multi.def. symbols/choices.
This bug was introduced by commit e307ba340c ("kconfiglib: Record
which MenuNode has each property").
Commit message from Kconfiglib (c8801514d63aa)
==============================================
Fix incorrectly ordered properties for some nested multi.def. symbols
_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").
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Some prj.conf files seem to deliberately override settings from the
board configuration (e.g. samples/bluetooth/hci_usb/prj.conf, with
GPIO=y). Disable the warning about a symbol being assigned more than
once to avoid warnings for those cases.
A list similar to WARNING_WHITELIST could be added later if more
warnings need to be disabled.
Also refactor the warning checking code a bit to get rid of some not's.
Suggested by Sebastian Bøe.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fixes: #8210
Following changes has been made to ensure correct behavior on different
system:
- Python script to detect changes to directories, including empty ones.
When files are modified the list is updated
If sub-directories are added / removed a trigger file is touched to
notify cmake to re-run
- Windows: To detect changes to header files in include for
parse_syscalls.py all files must be individual monitored.
Hence all headers are globbed added to dependencies.
CMake configure depends on the folders so the added /
removed files are picked up.
- Other: Folders are monitored through the python list file so that
added / remove / modified
Added / removed sub-directories are detected through trigger
file in order to re-run cmake.
Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
This commit fixes an issue when user searches for a nonexistent object
(e.g. adsdsaasda) and presses enter.
Having all the key checks in one continuous if statement makes sure that
the very last 'else' statement does not get executed when enter is
pressed.
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
In particular, this will turn assignments to undefined Kconfig variables
into errors, which are very easy to miss otherwise (e.g. when Kconfig
symbols get renamed or removed).
Warnings generated by anything tested by CI (scripts/sanitycheck) will
be caught.
Have a whitelist of warnings that are not turned into errors. Some
warnings currently whitelisted should be turned into errors as well, but
would require a bit of work.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
In some cases, node label could be generated with "/" character
in name string, which prevents compilation
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
In verbose mode (-v) progress of running test cases number out of total
number is not printed. Thus, if there are many test cases, it is
impossible to follow the progress. This commit adds printing of current
test case and total numbers to the verbose output.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Symbols that are assigned values in .config files must have satisfied
dependencies, and must have a prompt. Otherwise, the assigned value is
ignored. A warning is printed if the symbol ends up with a different
value than the assigned value as a result.
It might be difficult to know how to fix the problem just from seeing
the current warning. Add some hints to it to help out:
- The symbol information dialog in menuconfig is good for figuring out
dependencies that need to be enabled. Mention menuconfig in the
warning.
- The page for the symbol in the autogenerated Kconfig docs can be
helpful too, so link it. There's a slight chance that it'll be
outdated, but it's usually correct when working on the master
branch.
Automatically enabling dependencies is much trickier than it might seem
at first, due to the generality of Kconfig. See
https://github.com/zephyrproject-rtos/zephyr/issues/8181 for some
discussion.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Update Kconfiglib to upstream revision 9fba375c65341 (+ local Zephyr
modifications) to get commit 94020beb311eb ("Make Kconfig._choices
public") in. It will be used to generate Kconfig reference pages for
choices.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Bring in the changes from upstream 321ab2e17 ("runner: core: fix
docstrings for ReST integration"). This is a minimal change necessary
to avoid documentation build issues. The rest of West has gained other
features that are too late to pull in to the RC period, so just bring
in what's needed to get to v1.12.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Fail in tests where we have an OOPS or a panic. Right now and in many
cases we continue and test case might be reported as PASS.
Cases that have the tag ignore_faults will ignore those faults (cases
that are testing faults for example).
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Export tests to a file with Section, subsection and identifier as
columns making it easy to import testcases into test management system.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Commit 93d3a42776 changed the interface
of extract_controller() but did not change the recursive call within.
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
- Pressing 'c' ('n' was taken) toggles a mode where the names of all
symbols are shown before their prompts. This saves going into the
help display when you just want the name.
- The name of the symbol/choice now appears in the main text of the
help dialog rather than in the title, where it might be hard to
spot, as pointed out by Carles Cufi.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Unquoted string defaults work through a quirk of Kconfig (undefined
symbols get their name as their string value), but look confusing. It's
done inconsistently now too.
Suggested by Kumar Gala.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Correctly process multiple include files given to the
!include command of the YAML loader.
The fix only targets the sequential definition of include files.
Fixes#7067
Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
For DWARF v2, DW_AT_data_member_location is encoded as a set of operations. The member_offset is in that case a list that starts with an operation (typically DW_OP_plus_uconst), so member_offset[0] is not the offset.
This solves the kernel/poll test (issue #7885)
Allow check-compliance.py to be run from any path with a valid Git tree,
removing the unnecessary and artificial limitation imposed in the case
of gitlint.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
- Show the value of each symbol in the jump-to dialog.
- Search names and prompts separately in the jump-to dialog.
Previously, '_BAR$' wouldn't match FOO_BAR if it had a prompt,
because '_BAR$' was matched against the string 'FOO_BAR "prompt"'.
- Show the working directory in save/load dialog boxes. Paths will be
relative to it, and Carles Cufi pointed out that it might not be
obvious.
Also allow ~ to be used to refer to the home directory.
- Implement scroll offset for edit boxes. This makes it clearer when
they're scrolled horizontally.
Piggyback an update of Kconfiglib to the latest version (no functional
changes).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This section got added in commit 470349c25a ("Bluetooth: settings:
Add support for per-submodule handlers"), but sanitycheck didn't know
about it and was whining.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
On some arches like ARC, the member location tag is a list with
the offset and then the member size. We just need the offset.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Make all menu paths ("(top menu) -> menu -> submenu -> ...") exclude
implicit submenus, which are shown indented in the menuconfig interface
and are created when items depend on the symbol before them.
Previously, implicit submenus were excluded in the menu path at the top
of the menuconfig interface, but were included in the menuconfig symbol
information dialog and in the docs generated by genrest.py.
This makes it consistent, and un-spams the documentation for some
symbols a bit.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Ninja and GNU make don't play well with each other. Both try to start
enough processes to keep the system's CPUs busy, resulting in an
O(N^2) system load in the number of processors.
Long term, Ninja seems likely to support the GNU make jobserver
mechanism for sharing access to parallelism. But for now we can get
90% of the way there with a simple hack: just run ninja in serial mode
with -j1. Sanitycheck when run in non-trivial circumstances has
PLENTY of parallelism just from the number of test cases.
One interesting note is that even with -j1, system loads under ninja
are rather higher. That may be because of significant work done in
the (serial) makefiles that dilutes the parallelism of the eventual
build, or possibly because ninja itself is multithreaded in its setup
code. So I tweaked the number of jobs down to keep the load roughly
where it is with make.
With this change, I see no difference in behavior or system load, and a
~24% improvement in runtime.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This is not strictly necessary for flashing and debugging, and is
causing issues in Linux environments where users run "make flash" as
root instead of installing udev rules.
Fixes: #7676
(Though we will need to revisit this when adding commands that run
CMake).
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Leading/trailing whitespace in prompts requires ugly workarounds in
genrest.py, as e.g. *prompt * is invalid RST. strip() all prompts in
Kconfiglib and get rid of the genrest.py workarounds. Add a warning too.
The Kconfiglib update has some unrelated cleanups and fixes (that won't
affect Zephyr).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Though commands like "west flash -h" now have help for generic runner
configuration options, runner-specific context is not printed.
In order to print this information, we would ideally want to know the
currently available runners from a build directory. Otherwise, we
can't print the current cached configuration, and the user will likely
be overwhelmed by a giant list of options etc. available for all the
runners in the package.
However, we can't print that information out without re-doing the
build, which is not safe to do when the user just gives '--help'.
To provide more complete help without causing side effects in the
default help output, add a new -H/--context option, which explicitly
re-runs the build (unless --skip-rebuild was given), parses the cache,
and prints context-sensitive help. This can be combined with the -r
option to restrict help to a particular runner.
Examples:
- Print context for all available flash runners:
west flash -H --build-dir build-frdm_k64f/
- Print context for just one runner:
west flash -H --build-dir build-frdm_k64f/ -r jlink
- Print context for all available debug runners, if current
working directory is a build directory:
west debug -H
If no context is available because there is no CMake cache file, this
command can still be used to obtain generic information about
runners. It emits a warning in this case.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Add the build directory to the central runner configuration.
This is commonly useful information.
The first place we can use it is to eliminate guessing the current
working directory when building objects to parse .config.
It's not necessary to modify the build system for this, so leave the
relevant command line flag among the general options.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Continue better integration of the runner subpackage into west by
moving the common runner configuration options into the command
core. This allows commands like "west flash -h" to display help for
common overrides like --kernel-hex.
Adjustments needed to make this happen are:
- Change the build system to separate common configuration values from
runner-specific options and arguments
- Prepare the runner core by defining a new RunnerConfig class that
represents the common configuration, and accepting that from a new
create() method, which replaces create_from_args().
- Convert all concrete runner classes to use the new style of
argument parsing and initialization.
- Group the command options appropriately for help output readability
There's still a bit of tool-specific stuff in the common
configuration (gdb and openocd configuration in particular); a more
generic way to deal with that will be necessary to better support
things like non-GDB debuggers, but that's out of scope of this patch.
All the runner-specific options are still in the runner packge, which
currently prevents them from being included in "west flash -h" etc.
Fixing that is also out of scope of this patch.
This has the ancillary benefit of getting rid of the legacy 'debug'
argument to ZephyrBinaryRunner, which is no longer appropriate since
verbose debug logging is handled by log.py in west.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Replace all informational messages with calls to log functions.
Cases which must interact via the terminal and standard output are not
modified.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>