Skip to content

Build System: defconfig: Base defconfig not used on fully qualified oot board #98231

@LuskeyNoah

Description

@LuskeyNoah

Describe the bug

When using a fully qualified board (I'm using a test native_sim/native/64/two) my interpretation of the documentation here is that the the defconfig files should be matched with native_sim_defconfig, as well as each file getting more specific with each qualifier
(e.g. native_sim_defconfig, native_sim_native_defconfig, native_sim_native_64_defconfig, native_sim_native_64_two_defconfig)

If both the common plank_defconfig file and one or more board qualifiers specific plank_<qualifiers>_defconfig files exist, then all matching files will be used. This allows you to place configuration which is common for all board SoCs, CPU clusters, and board variants in the base plank_defconfig and only place the adjustments specific for a given SoC or board variant in the plank_<qualifiers>_defconfig.

Depending on your interpretation of the documentation, the you may have a different opinion on which configs with "intermediate" qualifiers should be included... However, I would consistently expect at least native_sim_defconfig and native_sim_native_64_two_defconfig to be used regardless of interpretation of docs and it is not.

Right now only native_sim_native_64_two_defconfig is used. I have reproduced this in a ztest test case available on a public fork of the Zephyr repo

Regression

  • This is a regression.

Steps to reproduce

Steps to reproduce (on a Linux machine):

  1. Check out the branch luskey/qualifier-maybe-bug from https://github.com/LuskeyNoah/zephyr/ (or simply cherry pick this commit)
  2. Navigate to tests/cmake/hwm/board_extend and build for native_sim/native/64/two (west build -b native_sim/native/64/two)
  3. Run the zephyr application and observe the results

Relevant log output

(.venv) ➜  board_extend git:(luskey/qualifier-maybe-bug) west build -t run
-- west build: running target run
[1/10] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.2.99 (/home/luskey/zephyr-workdir/zephyr), build: v4.2.0-6916-g55c4ed63f984
[7/10] Linking C executable zephyr/zephyr.elf
Generating files from /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build/zephyr/zephyr.elf for board: native_sim
[9/10] cd /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build && /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build/zephyr/zephyr.exe
*** Booting Zephyr OS build v4.2.0-6916-g55c4ed63f984 ***
Running TESTSUITE soc_board_extend
===================================================================
START - test_native_sim_extend
 PASS - test_native_sim_extend in 0.000 seconds
===================================================================
START - test_qualifier_matching

    Expectation failed at WEST_TOPDIR/zephyr/tests/cmake/hwm/board_extend/src/main.c:108: soc_board_extend_test_qualifier_matching: IS_ENABLED(CONFIG_SET_BY_NATIVE_SIM) is false


    Expectation failed at WEST_TOPDIR/zephyr/tests/cmake/hwm/board_extend/src/main.c:111: soc_board_extend_test_qualifier_matching: IS_ENABLED(CONFIG_SET_BY_NATIVE_SIM_NATIVE) is false


    Expectation failed at WEST_TOPDIR/zephyr/tests/cmake/hwm/board_extend/src/main.c:114: soc_board_extend_test_qualifier_matching: IS_ENABLED(CONFIG_SET_BY_NATIVE_SIM_NATIVE_64) is false

 FAIL - test_qualifier_matching in 0.000 seconds
===================================================================
TESTSUITE soc_board_extend failed.

------ TESTSUITE SUMMARY START ------

SUITE FAIL -  50.00% [soc_board_extend]: pass = 1, fail = 1, skip = 0, total = 2 duration = 0.000 seconds
 - PASS - [soc_board_extend.test_native_sim_extend] duration = 0.000 seconds
 - FAIL - [soc_board_extend.test_qualifier_matching] duration = 0.000 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION FAILED
FAILED: zephyr/CMakeFiles/run_native /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build/zephyr/CMakeFiles/run_native 
cd /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build && /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build/zephyr/zephyr.exe
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/luskey/zephyr-workdir/zephyr/tests/cmake/hwm/board_extend/build --target run

Impact

Functional Limitation – Some features not working as expected, but system usable.

Environment

  • OS: Linux
  • Toolchain: 0.17.4, x86_64-zephyr-elf
  • Commit (fork): 55c4ed6

Additional Context

No response

Metadata

Metadata

Assignees

Labels

area: Build SystembugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions