-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Bluetooth: Controller: Only show one prompt for experimental configs #42319
Bluetooth: Controller: Only show one prompt for experimental configs #42319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the label "[EXPERIMENTAL]" from the feature name is fine in my opinion. I agree it's better than showing it twice in search results.
Adding label area DX to discuss:
|
subsys/bluetooth/controller/Kconfig
Outdated
@@ -470,20 +470,17 @@ config BT_CTLR_CHAN_SEL_2 | |||
the Controller. | |||
|
|||
config BT_CTLR_ADV_EXT | |||
bool "LE Advertising Extensions" if !BT_LL_SW_SPLIT | |||
bool "LE Advertising Extensions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decoupling out the prompt
solves the duplicate menu item.
bool "LE Advertising Extensions" | |
prompt "LE Advertising Extensions [EXPERIMENTAL]" if BT_LL_SW_SPLIT | |
config BT_CTLR_ADV_EXT | |
prompt "LE Advertising Extensions" if !BT_LL_SW_SPLIT | |
config BT_CTLR_ADV_EXT | |
bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this still result in multiple entries of BT_CTLR_ADV_EXT
when you search for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the search, but it will definitely break menuconfig. The rendering logic that produces the current duplicate entry thing in menuconfig is caused by menuconfig forcing menus with visible children into existence, even if they should be invisible. As the menu parent is always the last node before the if
, the [EXPERIMENTAL]
node is forced into existence, as it holds all the child nodes.
IMO, the right variant of this suggestion would be to keep the two entries, but remove the prompts for both, then create a single prompt entry below them that conditionally adds both prompts:
config BT_CTLR_ADV_EXT
prompt "LE Advertising Extensions [EXPERIMENTAL]" if BT_LL_SW_SPLIT
prompt "LE Advertising Extensions"
This entry will only serve as a toggleable menu heading, really, but it should keep the logic of the other properties as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this still result in multiple entries of
BT_CTLR_ADV_EXT
when you search for it?
There will be multiple entries when searched, but only one is enabled based on the if
condition that is satisfied. This is similar to how all hidden Kconfig get listed when in search.
My suggestions do not have the original problem of duplicate entries when traversing using menuconfig/guiconfig.
the right variant of this suggestion would be to keep the two entries, but remove the prompts for both, then create a single prompt entry below them that conditionally adds both prompts
This (multiple conditional prompt under an entry) is not permitted by Kconfig and fail to build with a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So @cvinayak , @alwa-nordic, and @trond-snekvik . The remaining question is: Are we ok with having two entries? It looks a bit messy IMO. But the proposed solution is better than the existing one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok to have see two prompt messages, and is consistent with the Link Layer selection wherein only one is selectable based on the Link Layer enabled.
@cvinayak You NAK-ed this PR, but it's unclear to both the author and me what your objections are, and so we don't know how to proceed. Could you have a look at this again? |
@alwa-nordic The title of the PR and the description do not describe the entirety of the problem. One, duplicate prompt when traversing through the Kconfig menu items, and second, display of duplicate prompt when searching. My suggestion in this PR addresses the former. The later, to have duplicate prompts when searching is acceptable and is inline with other hidden Kconfig that get listed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having both prompts appearing in the search results is unfortunate, but the side-effects of this proposal are worse, when considering UI interface of items in menuconfig and doc generation.
Unfortunately I don't have a good solution to the search issue.
subsys/bluetooth/controller/Kconfig
Outdated
depends on BT_BROADCASTER && BT_CTLR_ADV_PERIODIC_SUPPORT | ||
select BT_CTLR_CHAN_SEL_2 | ||
default y if BT_PER_ADV | ||
select EXPERIMENTAL if BT_LL_SW_SPLIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are now missing [EXPERIMENTAL]
in the prompt text.
It should be visible to users that uses menuconfig
/ guiconfig
that a particular item is considered experimental.
Also it goes to the docset, where it becomes visible that this symbol is experimental, for example like here:
https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_LL_SW_LLCP.html#config-bt-ll-sw-llcp
Note, this is also the reason why the help text is important, as it provides information to the reader as to why this feature is considered experimental.
With this proposal, it becomes very hidden that this setting under some circumstances are considered experimental, which is worse than both prompts appearing in a search.
One proposed construct that will make it look nicer is the following:
This ensures that the "EXPERIMENTAL" prompt is only visible when
@tejlmand , @cvinayak , @Thalley , @trond-snekvik , @alwa-nordic are you ok with implementing alternative 1? |
Alternative 1, does not solve anything but instead adds duplicates in the menuconfig/guiconfig contrary to the title of this PR. Have you tried my suggestion here: #42319 (comment) |
@cvinayak , thanks, that works out nicely. I must have missed something when I tried it the first time |
3f62ee9
to
851898d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest changes, none of these Kconfigs are selectable in menuconfig with upstream repo. Now the duplicate entry are far down the list in the upstream repo.
@@ -62,6 +62,40 @@ config BT_LLL_VENDOR_OPENISA | |||
help | |||
Use OpenISA Lower Link Layer implementation. | |||
|
|||
# First redefine the experimental symbols. | |||
# We define them here due to avoid declaring them right below the non-experimental |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I initially was in favor of moving those setting re-declarations into Kconfig.ll_sw_split
, then the new behavior in menuconfig is quite confusing.
For example, when BT_CTLR_ADV_EXT
is not enabled, the menu look as:
but then enabling this setting causes the menu to be updated (which is normal behavior), but in contrast to old behavior the new available settings appear above the current setting, at what to some might look at random location (although it's not).
This is a bit confusing, as it is not easy to spot the new settings (unless you know that you should look for the (NEW)
postfix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Should we rather decline this PR and resolve the Kconfig issue then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rather decline this PR and resolve the Kconfig issue then?
at this point, i'm not confident that the is a easy solution to the Kconfiglib issue.
Cause trying to solve that issue might easily break this functionality:
# Show invisible symbols if they have visible children. This
# can happen for an m/y-valued symbol with an optional prompt
# ('prompt "foo" is COND') that is currently disabled. Note
# that it applies to both 'config' and 'menuconfig' symbols.
in which case we might end-up changing one kind of misbehaving with another kind.
However, I also posted a workaround here: ulfalizer/Kconfiglib#117
which you can try out, and see if it creates the desired result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it out, it didn't work (pushed the changes to demonstrate it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because you place the DUMMY
at the wrong location.
It needs to be moved downwards, like this:
--- a/subsys/bluetooth/controller/Kconfig
+++ b/subsys/bluetooth/controller/Kconfig
@@ -529,14 +529,14 @@ config BT_CTLR_ADV_PERIODIC
Enable support for Bluetooth 5.0 LE Periodic Advertising in the
Controller.
-# Workaround for https://github.com/ulfalizer/Kconfiglib/issues/117
-config DUMMY
- bool
-
config BT_CTLR_ADV_PERIODIC
bool "LE Periodic Advertising in Advertising State (Split Link Layer) [EXPERIMENTAL]" if BT_LL_SW_SPLIT
select EXPERIMENTAL if BT_LL_SW_SPLIT
+# Workaround for https://github.com/ulfalizer/Kconfiglib/issues/117
+config DUMMY
+ bool
+
config BT_CTLR_ADV_PERIODIC_ADI_SUPPORT
bool "Periodic Advertising ADI support"
depends on BT_CTLR_ADV_PERIODIC
Note, we probably should name DUMMY
something else, I only used that name here ulfalizer/Kconfiglib#117 for showing the workaround.
Secondly, I think the first DUMMY
should have a help text similar to this.
config PROMPT_ADJUSTMENT_WORKAROUND
bool
help
Unused and hidden Kconfig symbol to allow prompt adjustment.
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117
fbcd008
to
65a659e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please checkup whether the workaround is needed in all cases ?
From what I can tell, only a few places suffers from the problem.
Please read ulfalizer/Kconfiglib#117 carefully to understand under which circumstances this problem manifests itself.
subsys/bluetooth/controller/Kconfig
Outdated
help | ||
Unused and hidden Kconfig symbol to allow prompt adjustment. | ||
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subsys/bluetooth/controller/Kconfig
Outdated
help | ||
Unused and hidden Kconfig symbol to allow prompt adjustment. | ||
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
help | |
Unused and hidden Kconfig symbol to allow prompt adjustment. | |
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 |
subsys/bluetooth/controller/Kconfig
Outdated
config PROMPT_ADJUSTMENT_WORKAROUND | ||
bool | ||
help | ||
Unused and hidden Kconfig symbol to allow prompt adjustment. | ||
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe prompt adjustment is needed here, cause the following setting does not have depends on BT_CTLR_ADV_ISO
or is guarded by if BT_CTLR_ADV_ISO
.
Could you please if prompt adjustment is really needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
subsys/bluetooth/controller/Kconfig
Outdated
config PROMPT_ADJUSTMENT_WORKAROUND | ||
bool | ||
help | ||
Unused and hidden Kconfig symbol to allow prompt adjustment. | ||
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please if prompt adjustment is really needed here.
BT_CTLR_BROADCAST_ISO
is not depending on BT_CTLR_SYNC_ISO
from what I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
subsys/bluetooth/controller/Kconfig
Outdated
config PROMPT_ADJUSTMENT_WORKAROUND | ||
bool | ||
help | ||
Unused and hidden Kconfig symbol to allow prompt adjustment. | ||
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is prompt adjustment really needed here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
subsys/bluetooth/controller/Kconfig
Outdated
config PROMPT_ADJUSTMENT_WORKAROUND | ||
bool | ||
help | ||
Unused and hidden Kconfig symbol to allow prompt adjustment. | ||
Work around for https://github.com/ulfalizer/Kconfiglib/issues/117 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is prompt adjustment really needed here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
subsys/bluetooth/controller/Kconfig
Outdated
@@ -682,15 +712,21 @@ config BT_CTLR_SET_HOST_FEATURE | |||
config BT_CTLR_CENTRAL_ISO | |||
bool "LE Connected Isochronous Stream Central" if !BT_LL_SW_SPLIT | |||
depends on BT_CTLR_CENTRAL_ISO_SUPPORT && BT_CENTRAL | |||
select BT_CTLR_SET_HOST_FEATURE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious. what does this change has to do with ?
Only show one prompt for experimental configs
65a659e
to
e4e8b78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little too much was remove in last push.
Please notice I only asked for removal of the help text those two places:
#42319 (comment)
#42319 (comment)
The
config PROMPT_ADJUSTMENT_WORKAROUND
bool
must still be there.
@@ -525,7 +531,7 @@ config BT_CTLR_ADV_PERIODIC | |||
Controller. | |||
|
|||
config BT_CTLR_ADV_PERIODIC | |||
bool "LE Periodic Advertising in Advertising State [EXPERIMENTAL]" if BT_LL_SW_SPLIT | |||
bool "LE Periodic Advertising in Advertising State (Split Link Layer) [EXPERIMENTAL]" if BT_LL_SW_SPLIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment not directly related to this line, but cannot comment below.
Why was this removed in last update ?
https://github.com/zephyrproject-rtos/zephyr/blob/65a659e7f7e2ad76a2406f8d6db57bca99ee25b3/subsys/bluetooth/controller/Kconfig#L537-L538
Only the help text was supposed to be remove if you read this comment #42319 (comment).
This code part still suffers the double prompt issue, as there are two config BT_CTLR_ADV_PERIODIC
after one another, and then a depends on BT_CTLR_ADV_PERIODIC
here:
https://github.com/zephyrproject-rtos/zephyr/blob/e4e8b78f93a7871c4494bf6b2e5596e97fcf7c12/subsys/bluetooth/controller/Kconfig#L524-L539
Especially pay attention to this line:
https://github.com/zephyrproject-rtos/zephyr/blob/e4e8b78f93a7871c4494bf6b2e5596e97fcf7c12/subsys/bluetooth/controller/Kconfig#L539
So you still need
config PROMPT_ADJUSTMENT_WORKAROUND
bool
just no help text.
@@ -545,7 +551,7 @@ config BT_CTLR_SYNC_PERIODIC | |||
Synchronization state in the Controller. | |||
|
|||
config BT_CTLR_SYNC_PERIODIC | |||
bool "LE Periodic Advertising in Synchronization State [EXPERIMENTAL]" if BT_LL_SW_SPLIT | |||
bool "LE Periodic Advertising in Synchronization State (Split Link Layer) [EXPERIMENTAL]" if BT_LL_SW_SPLIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. not related to this line, but below.
You still need:
https://github.com/zephyrproject-rtos/zephyr/blob/65a659e7f7e2ad76a2406f8d6db57bca99ee25b3/subsys/bluetooth/controller/Kconfig#L563-L564
just without the help text.
Notice the two config BT_CTLR_SYNC_PERIODIC after one another, and then a depends on BT_CTLR_SYNC_PERIODIC here:
https://github.com/zephyrproject-rtos/zephyr/blob/e4e8b78f93a7871c4494bf6b2e5596e97fcf7c12/subsys/bluetooth/controller/Kconfig#L544-L559
Uses the proposed workaround in ulfalizer/Kconfiglib#117 Signed-off-by: Rubin Gerritsen <[email protected]>
This makes the it more intuitive when searching. Signed-off-by: Rubin Gerritsen <[email protected]>
e4e8b78
to
3b5d83c
Compare
@tejlmand , thanks for the thorough review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - Thanks for the effort and patience.
This sure was a tricky issue, but the end-result looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved the prompt text changes. Not reviewed/tested for the prompt workaround.
@kruithofa , @thoh-ot , are you ok with merging this PR as is? |
I believe this PR can be merged now |
@carlescufi , can you merge this PR? |
this is marked as DNM, it will not be merged with this label. |
Removed the DNM I added some time back |
When browsing through the tree, you will now no longer see two entries
for each symbol that is experimental for BT_LL_SW_SPLIT
The prompt message for experimental messages have now been rephrased to
include (Split Link Layer)
See
