-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
twister: Not possible to build/run tests with binary blob dependencies in downstream trees #76867
Comments
@nashif even though this got auto-assigned to you, I could try creating a fix myself, assuming we have some consensus on what kind of fix is most acceptable. |
@ifyall @sylvioalves @erwango there are HCI drivers for your respective platforms which depend on The whole |
@jhedberg, we do have a downstream CI to run Wi-Fi and BLE tests as all ESP32-based boards use |
That's indeed an interesting solution which I hadn't thought of. I suppose it'd still require some kind of "awareness" of the build system to decide whether to build against the mock implementation or to link against the blobs. |
@ifyall asked me to respond. Currently we are not performing any BLE tests; we're only checking for compilation errors with BLE apps so we're using west blobs fetch just to build. My team is currently working on enabling functional BLE tests; I can share our process when we are up and running. |
sure, but IMO this is an enhancement, not a bug. zephyr/boards/silabs/dev_kits/xg27_dk2602a/xg27_dk2602a.yaml Lines 15 to 18 in 2aa31a3
this appears in many boards and is more or less what used to be a good way to not build and test networking/bluetooth for boards that did not support any of those subsystems, it is not being consistently used and we need a better way, so this might help at one level if we find a solution here. a feature enabled by a board that requires binary blob and filtering on those is something new. I am still not sure how this will work in general and with twister in particular. |
Sure, makes sense.
True, although the whole usage of
The problem is that it's used for boards which do not support these features, but also for boards which do support them, but can't be built in CI due to blob dependencies. We already have the tags, and they should really be all that's needed to match up boards with samples & tests for 99% of the cases.
Today, twister makes two implicit assumptions: that both When considering what twister should or shouldn't do, you mentioned (I think it was on Discord) that Whichever of the two approaches we take, we would still need to encode information about which features have blob dependencies. This could be on a very granular level (e.g. specifying exact Kconfig options and which module's blobs they depend on), or on a more high level by having each board list which tags it supports but only if the relevant blobs have been fetched. The less granular approach would be simpler, although it would mean that fetching blobs can't be automated on a general level. Downstream trees would instead need to have specific knowledge of relevant boards and which blobs they may require - I think this is an acceptable compromise. Anyway, in practice we'd go from the following in the board yaml: supported:
- bluetooth to something like: supported-with-blobs:
- bluetooth Upstream CI with twister would simply ignore the |
Note that if we support west lazy modules loading one day, we'd have the same need for |
We support for samples/tests to depend on particular modules (see e.g. |
Isn't the use case slightly different though? What we'd need e.g. for Bluetooth is not samples or tests that always depend on blobs, rather they depend on them only when built for a specific subset of platforms. Or to frame it slightly differently (and more generally), here the issue is that the underlying implementation of a Zephyr feature (which already has plenty of existing samples and tests) depends on blobs if you try to build it for some subset of platforms that support the feature. |
Let's hold on this, a better strategy and design is needed. Right now our testing is targeted at devices and platforms, i.e. we focus on running a test on as many platforms as possible instead of focusing on testing and targeting features, possible with the least number of targets to verify this feature. So we bend backwards to make some tests build and run on each platform without any value added or coverage added to the original goal of testing. In short, we should be validating Zephyr features and focus on those, it is not about platforms and validating their capabilities. There is also ther other side of the problem, CI. Most of the filters we have mostly go back to CI run-time and scope optimization deprioritizing the need someone might have to run some tests on target hardware (this issue).
No, twister does not need Twister expects many things to be setup an ready and does not try to do this for you. If you do not have a toolchain installed, it does not pull the toolchain for you.
As with many similar issues, we should try always to go back and solve the issue at the core, and not in twister, which should be completely agnostic to all of this and should never care about blobs or anything else we might add in the future. IMO this could also be solved on the west/kconfig side of things, because the problem first appears when you try to build a sample with west/cmake for a board that needs some blob, for example for bluetooth. IMO this should be solved at this level. Given that we have all the blobs defined in the module.yaml file and we parse those yaml files already and generate Kconfigs for modules, we could do the same for blobs and have the Kconfig enabling the feature (bluetooth) depend a blob kconfig and the existence of such blob in the tree (y if it was fetched, n if it was not). You can in this case also issue a warning to the user telling them that a certain feature requires blobs and so on... now you get:
If we do that, some of the current filters limiting overall testing can be removed and we can think about inclusion and coverage strategies without having to change twister to be aware of blobs. |
We're in agreement on this point then. What I meant by "as appropriate" was "whatever is necessary to fulfill dependencies"
Ok, I didn't realize that there was this kind of linkage from module.yml to Kconfig already. In that case that does indeed sound like promising way to solve the issue. E.g. the Silabs Bluetooth HCI driver Kconfig definition would become something like:
That solves controlling enabling of a feature that requires blobs, but it still leaves open the question of how to filter for these in twister's test plan generation. E.g. with the above dependencies you'd be able to successfully build Bluetooth apps for Silabs platforms even if the blobs are not present, but since the HCI driver wasn't actually built (even though its DT node might have |
look at
so this can be extended and improved a bit to be specific and generate a HAL specfic blob kconfig... |
@nashif I've proceeded with doing this as part of #77386. @tejlmand also helped create a fix to make CI pass with it here: #77476 Unfortunately, this doesn't seem to get me any closer to a solution for the problem described here, so I'm back to looking at other ways.
I understand and agree, but right now it looks like we're clearly misusing
That's exactly the opposite of what we're using it for (at least in the case of Bluetooth tests & samples). It seems to me like for CI purposes we'd need another test configuration option that's solely used to define which minimal set of upstream platforms are sufficient to get coverage of the feature in question, i.e. it wouldn't impact in any way which platforms the test can theoretically be built for and run on.
For me it's not even about running the tests right now. For starters I'd just like to build them (with twister). I guess what I'll do is to bravely remove the |
@nashif what are your thoughts if we'd add such a new option for tests, which would then allow us to remove most Bluetooth uses of |
I think this is already what I think adding If you want to remove |
I'm not sure what part of the documentation you looked at, but
The above makes it pretty clear (IMO) that
Sure, that might indeed make sense. One thing that is missing from most Bluetooth samples and tests that I looked at is Regarding weekly tests, you said:
Do you mean that the weekly build even ignores |
I agree with platform_allow, was commenting that I don't see a proper explanation of
No, I mean that if you decide to use some less restrictive filtration than |
It is there https://docs.zephyrproject.org/latest/develop/test/twister.html#tests
|
Describe the bug
Since upstream Zephyr CI has the policy of never fetching binary blobs, test configurations which require such blobs have been disabled in various ways. For example, the Silabs Bluetooth HCI driver depends on
west blobs fetch hal_silabs
in order to build. Because of this, Silabs boards have the following filters in their definition:zephyr/boards/silabs/dev_kits/xg27_dk2602a/xg27_dk2602a.yaml
Lines 15 to 18 in 2aa31a3
To Reproduce
Expected behavior
The tests can be built.
Actual behavior
Impact
It's not possible to automate blob-dependent builds with twister in a downstream tree.
Possible solutions
Twister currently has a
-K
(or--force-platform
) switch to ignore any platform related filters. However, it doesn't seem to have anything to ignore tag-based filters. Having a way to ignore the tag filtering would be one possible way to alleviate the issue, but it doesn't seem particularly clean or scalable in the long run.A perhaps better solution would be if we could include information in the board metadata (the yaml file) about blob dependencies, e.g. being able to enumerate which tags require blobs. Once this kind of information is available twister could by default filter out any tests that require blobs. There could then be a new command line switch to explicitly disable such filtering and assume that the blob dependencies have been fulfilled before running twister.
Yet another way (just brainstorming here) to indicate blob dependencies could be through Kconfig, i.e. something like:
The text was updated successfully, but these errors were encountered: