Skip to content

Conversation

FelixWang47831
Copy link
Contributor

@FelixWang47831 FelixWang47831 commented Sep 2, 2025

For non-pristine build, there is warning, which is unnecessary. For example:

If I have run "west build -b frdm_ke17z ./samples/hello_world -p " before, after make some code changes, I want to run a non-pristine build:
(.venv) ➜ zephyr git:(main) ✗ west build
WARNING: This looks like a fresh build and BOARD is unknown; so it probably won't work. To fix, use --board=.
Note: to silence the above message, run 'west config build.board_warn false'
ninja: no work to do.

It's not a fresh build and the "board" variable can be got from CMake Cache.
This patch is trying to get board after cmake cache is got by "self._update_cache()".

This is a regression introduced by #94231

When using non-pristine build with command "west build",
it will report warning:
WARNING: This looks like a fresh build and BOARD is
unknown; so it probably won't work

However, the "board" variable can be got from CMake Cache.
This patch is trying to get board after "_update_cache".

Signed-off-by: Felix Wang <[email protected]>
Copy link

sonarqubecloud bot commented Sep 2, 2025

@FelixWang47831 FelixWang47831 marked this pull request as ready for review September 2, 2025 08:06
@zephyrbot zephyrbot added the area: West West utility label Sep 2, 2025
@pdgendt pdgendt requested review from tejlmand and nordicjm September 2, 2025 08:23
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried reproducing this but could not. What kind of changes did you make between:
west build -b frdm_ke17z ./samples/hello_world -p
and
west build

so that you got that warning? for me it works just fine if I just change .c files

@FelixWang47831
Copy link
Contributor Author

FelixWang47831 commented Sep 2, 2025

Hi @carlescufi Actually I have encountered this warning even without any code changes.
image

Have you run "west config build.board_warn false" before?

@carlescufi
Copy link
Member

carlescufi commented Sep 2, 2025

Have you run "west config build.board_warn false" before?

Something is off here, because:

❯ west build -b frdm_ke17z ./samples/hello_world -p
[builds]

❯ west config build.board_warn
true

❯ west build
ninja: no work to do.

I cannot reproduce your issue at all. @pdgendt can you reproduce it?

@henrikbrixandersen
Copy link
Member

I cannot reproduce your issue at all. @pdgendt can you reproduce it?

I can reproduce it here.

@pdgendt
Copy link
Contributor

pdgendt commented Sep 2, 2025

I cannot reproduce your issue at all. @pdgendt can you reproduce it?

I can reproduce it here.

Yes, me too

@pdgendt
Copy link
Contributor

pdgendt commented Sep 2, 2025

I cannot reproduce your issue at all. @pdgendt can you reproduce it?

Do you have a board configured with

$ west config build.board

@pdgendt
Copy link
Contributor

pdgendt commented Sep 2, 2025

CC @nordic-krch

$ git bisect bad
5718af02c522c195f24951d5e439b9638250a0f5 is the first bad commit
commit 5718af02c522c195f24951d5e439b9638250a0f5
Author: Krzysztof Chruściński <[email protected]>
Date:   Thu Aug 7 16:39:31 2025 +0200

    scripts: west_command: build: Support for conditional platform configs

    extra_configs or extra_args can use additional filtering which was not
    supported by the west build command. West is not aware of arch so that
    filter type is not supported but platform (board) is known so it can
    be used to apply expected configuration.

    Signed-off-by: Krzysztof Chruściński <[email protected]>

 scripts/west_commands/build.py | 46 ++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 15 deletions(-)

Copy link
Contributor

@nordic-krch nordic-krch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing that. It was me, moving board finding to the earlier stage.

Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason that I wasn't seeing the warning is that I had board.build defined in my config, which then provided a board for every build.

@pdgendt
Copy link
Contributor

pdgendt commented Sep 3, 2025

Thanks for fixing that. It was me, moving board finding to the earlier stage.

@nordic-krch I'm actually looking back to your change, with what you introduced the board can get a different value based on if the cache is updated or not.
Maybe the solution is to move the following up in the function instead?

self._sanity_check()
self._update_cache()

EDIT: Adding DNM for now

@pdgendt pdgendt added the DNM This PR should not be merged (Do Not Merge) label Sep 3, 2025
@FelixWang47831
Copy link
Contributor Author

This issue will be fixed by #95383. Hence close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: West West utility DNM This PR should not be merged (Do Not Merge)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants