Commit Graph

13 Commits

Author SHA1 Message Date
Marc Herbert 8b859cea2d west: promote config_get*() functions from sign.py to the base class
These two functions have stood the test of the time and they have
absolutely nothing specific to sign.py

This has the benefit of transitioning away from west's global and
deprecated logging interface
(https://github.com/zephyrproject-rtos/west/issues/149) and this
deprecation is what prompted this commit: see #79240.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-10-15 04:06:42 -04:00
Dominik Ermel 0dfd191e04 scripts: west_commands: Remove no longer needed load_dot_config(path)
The functionality of the function is now covered by BuildConfiguration
class.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-04-08 16:38:28 +02:00
Martí Bolívar 112e1d32b2 scripts: west_commands: remove unused helper
The cached_runner_config() helper is no longer used, so remove it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 09:51:13 -04:00
Martí Bolívar 9ca1de18eb scripts: west_commands: add .config parsing helper
Rolling yet another parser turns out to be the best way to let west
extensions respond to Kconfig values. See source code comments in the
patch for details.

The sanitylib library has some similar functionality but it isn't
exactly the same, and it gets strings wrong. For example, that parser
can't handle this option:

CONFIG_FOO="he said \"no\" to me"

This one can, and it has a couple of other features we'll find useful
for west extensions eventually besides.

(Not to mention that sanitylib also rolled its own CMake cache parser,
which also exists in west_commands.)

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-19 09:51:13 -04:00
Martí Bolívar 6e4c2b9be9 scripts: clean up west build/flash/debug help
Just changes to the west help output; no functional changes expected.

Make option descriptions lowercase to match the argparse module's
conventions. When multiple sentences are required, move them to parser
prolog/epilog or argument group description sections.

Clarify some points that have confused multiple people.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-29 08:47:04 -04:00
Torsten Rasmussen e819fa46cd scripts: west-commands: Updates needed when removing ZEPHYR_BASE env
This commit includes the following fixes in order to remove environment
setting of ZEPHYR_BASE is west extension commands.

- Build command
  west build --pristine will now use the ZEPHYR_BASE variable found
  in CMakeCache.txt in the build folder.

  This ensures that the pristine command is executed from the same
  Zephyr that was used for compilation.

- Board command
  The west boards command no longer sets Zephyr base before invoking
  cmake -P cmake/boards.cmake

  Instead boards.cmake uses find_package(Zephyr) to ensure consistent
  behavior with Zephyr samples, so that the detection of Zephyr base is
  uniform across CMake commands.

  It also changes BOARD_ROOT_SPACE_SEPARATED to BOARD_ROOT in order to
  be consistent with existing user documentation.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Martí Bolívar 6dab163cad scripts: fix west sign when ZEPHYR_BASE is unset
Due to cleanups in west targeted at getting rid of zephyr-specific
code, extension commands can no longer rely on ZEPHYR_BASE being set
in the calling environment at import time (it's still set at run()
time for now, though, to keep west build working).

Add a new helper to make dealing with this easier from west sign.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 09:06:09 +02:00
Ulf Magnusson bb634167ae west: commands: Make functions that don't use 'self' static
Fixes this pylint warning:

    R0201: Method could be a function (no-self-use)

Another option would be to turn them into regular functions, but that'd
be a bigger change.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:04:58 -04:00
Marti Bolivar 814bc7ba8e scripts: remove runner related cruft
There's some old cache variables that don't matter anymore in here.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-26 01:25:54 +02:00
Ulf Magnusson 859c4ed2cd west: Fix unused import and variable
Making a clean slate for a pylint test in CI.

'_' is a common name for non-problematic unused variables in Python.
pylint knows not to flag it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-07 08:12:34 -04:00
Carles Cufi 31bdad5299 west: Implement CMake helpers in scripts/west_commands
Move the existing CMake and build functionality from the west repository
to zephyr. The rationale behind this move is that it's very tightly
coupled with the Zephyr build system and is only used by the extension
commands implemented in the zephyr tree.
If additional extension commands in third-party repos want to use the
functionality they can add $ZEPHYR_BASE/scripts/west_commands to the
Python system path.

The implmentations in the west repo will be deprecated.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-03 21:55:13 +02:00
Marti Bolivar 8c095285d1 scripts: west_commands: refactor run_common.py
Pull out some more common functionality we will need elsewhere into a
separate file.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-02-07 08:44:19 -05:00
Marti Bolivar 8c4479994c scripts: west_commands: refactor build.py
This is a prep work patch for adding another command.  Refactor
build.py to use a new Forceable superclass and find_build_dir() helper
routine. Fix a help string while we are here.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-02-07 08:44:19 -05:00