Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid west cmake diagnostics when using board alias #33138

Closed
pabigot opened this issue Mar 8, 2021 · 1 comment · Fixed by #33436
Closed

invalid west cmake diagnostics when using board alias #33138

pabigot opened this issue Mar 8, 2021 · 1 comment · Fixed by #33436
Assignees
Labels
area: Build System area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@pabigot
Copy link
Collaborator

pabigot commented Mar 8, 2021

Zephyr supports board aliases which allow more natural names to be used for boards at the command line.

Sometime in the past couple weeks use of this feature has started to produce verbose gratuitous warnings. E.g.:

rm -rf build && west build -b pca10056

with

set(pca10056_BOARD_ALIAS nrf52840dk_nrf52840)

in a file identified by the ZEPHYR_BOARD_ALIASES environment variable now produces:

tirzah[165]$ rm -rf build && west build -b pca10056
-- west build: generating a build system
Including boilerplate (Zephyr base): /mnt/nordic/zp/zephyr/cmake/app/boilerplate.cmake
-- Application: /mnt/nordic/zp/zephyr/samples/hello_world
-- Zephyr version: 2.5.99 (/mnt/nordic/zp/zephyr)
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.5") found components: Interpreter 
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
CMake Warning at /mnt/nordic/zp/zephyr/cmake/extensions.cmake:2143 (message):
  

     **********************************************************************
     *
     *                    WARNING
     *
     * CMake variable BOARD set to "nrf52840dk_nrf52840" in:
     *     /mnt/nordic/zp/zephyr/cmake/app/boilerplate.cmake
     *
     * This is too late to make changes! The change was ignored.
     *
     * Hint: BOARD must be set before calling find_package(Zephyr ...).
     *
     **********************************************************************

Call Stack (most recent call first):
  /mnt/nordic/zp/zephyr/cmake/app/boilerplate.cmake:9999 (zephyr_variable_set_too_late)
  /mnt/nordic/zp/zephyr/cmake/app/boilerplate.cmake:233 (set)
  /mnt/nordic/zp/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /mnt/nordic/zp/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Aliased BOARD=pca10056 changed to nrf52840dk_nrf52840
-- Board: pca10056
-- Cache files will be written to: /home/pab/.cache/zephyr
...

The warning is clearly wrong, as the board is being set correctly, and is inappropriate, as the alias was correct.

@pabigot pabigot added the bug The issue is a bug, or the PR is fixing a bug label Mar 8, 2021
@nashif nashif added the priority: low Low impact/importance bug label Mar 8, 2021
tejlmand added a commit to tejlmand/zephyr that referenced this issue Mar 17, 2021
Fixes: zephyrproject-rtos#33138

Board alias and deprecated board handling is setting the BOARD variable
after zephyr_boilerplate_watch(BOARD) has been executed.

This results in the board changed warning.

This commit moves the zephyr_boilerplate_watch(BOARD) code below the
board alias and deprecation handling.

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand
Copy link
Collaborator

Fixed: #33436

carlescufi pushed a commit that referenced this issue Mar 18, 2021
Fixes: #33138

Board alias and deprecated board handling is setting the BOARD variable
after zephyr_boilerplate_watch(BOARD) has been executed.

This results in the board changed warning.

This commit moves the zephyr_boilerplate_watch(BOARD) code below the
board alias and deprecation handling.

Signed-off-by: Torsten Rasmussen <[email protected]>
jeremybettis pushed a commit to jeremybettis/zephyr that referenced this issue Mar 18, 2021
Fixes: zephyrproject-rtos#33138

Board alias and deprecated board handling is setting the BOARD variable
after zephyr_boilerplate_watch(BOARD) has been executed.

This results in the board changed warning.

This commit moves the zephyr_boilerplate_watch(BOARD) code below the
board alias and deprecation handling.

Signed-off-by: Torsten Rasmussen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants