cmake: shields: skip validating SHIELD if its not defined#103718
cmake: shields: skip validating SHIELD if its not defined#103718gudnimg wants to merge 3 commits intozephyrproject-rtos:mainfrom
SHIELD if its not defined#103718Conversation
nordicjm
left a comment
There was a problem hiding this comment.
is a good idea, however is not acceptable in the current form. You would need to add a test which is always executed on every CI run that includes a shield so that all shields in-tree (or e.g. added by a PR) are checked to be valid, because this PR removes that check
I can try writing a test for this. But I am not sure how to enforce the test is always run. Is there a specific tag I should use in the testcase YAML file? |
|
|
The scope for testing is automatically determined by test_plan.py script based on changes in a PR. On a case, where only a single test was changed, only such test will be in the scope. This would skip the "dedicated shield test". But I guess it's not an issue, since in such PR nothing is touched with shield application mechanism, hence no need to run it. I believe that such a test will be excluded in other cases as long as it doesn't use any tags which are excluded in the optimization process https://github.com/zephyrproject-rtos/zephyr/blob/main/scripts/ci/tags.yaml |
There was a problem hiding this comment.
Nice improvement, only a minor nit observed.
I think this could be merged for benefit of all, and then work on a better solution for checking new shields.
afaik, shields in-tree are not checked to be valid on every PR, the ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/list_shields.py code only lists available shields, but not their content or whether they are valid.
@nordicjm do you have any pointers to where all the shields are actually tested to be valid that are influenced by this PR ?
they are checked, see this demonstration: |
but that only checks the shield.yml itself, not the content of the shield. That's what I mean by checking whether the shield itself is valid. |
Correct yes, it checks that the yaml file is valid, likewise with the snippets one, I don't think we should go from having a basic check to no check at all. Would be fine if there is a way to add a test that runs on every PR that tests them all instead, but no clue how to do that |
and that's a fair point. Especially as I'm actually more worried of the non-existing shield implementation check we have today, than a malformed yml. |
|
I can drop the "draft" status if you want to consider the merge. I unfortunately haven't found enough time to work on / look into the shield test coverage problem these past two weeks. |
When SHIELD is not set, no shield are applied but list_shields.py still runs which takes around 140ms. Then additional 100ms are spent on string operations in CMake. This reduces the build configuration time by ~250ms on my machine. Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
4094e03 to
e253c1b
Compare
|
Resolved two open comments. And also synced the branch with |
The compliance check only runs when shield-related files change. Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
So that 'ninja shields' command doesn't fail when SHIELD isn't defined Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
|
@nordicjm I've added a new compliance check to try and start tackling this problem 3bc49c1. If I understand correctly, this does the equivalent validation/testing as already is done in
@tejlmand One problem I'm running into here is how to guarantee a mapping from a shield to a compatible board. If we can make that work, we can automatically run a build where we can smoke test a shield where the CI runs Idea: Force upstream I feel at least this problem is outside the scope of this PR... That is, validating more than current |



When
SHIELDis not set, no shields are applied butlist_shields.pystill runs which takes around 140ms. Then additional 100ms are spent on string operations in CMake.This reduces the build configuration time by ~250ms on my machine.
This is the same idea as #103709
It would be nice to avoid parsing all shields if possible when the build doesn't use any shields.
Before (271ms):
After (4.5ms):
