Skip to content
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

[RFC][DNM] kconfig: Search replace source "*" with gsource "*" #6569

Conversation

SebastianBoe
Copy link
Collaborator

This is an RFC for changing the Kconfig dialect that Zephyr is using.

Zephyr has copied and modified the Linux kernel's configuration
language into it's own tree. One modification that Zephyr has done is
changed the semantics of the 'source' keyword. Instead of the 'source'
argument being treated as a path it is treated as a glob pattern[0].

This is a backwards-incompatible change with the kernel's
configuration language, not just an extention of what 'source'
accepts. Meaning, running our Kconfig processor on the Linux kernel's
sources can produce different results.

Specifically, if there is a typo in the 'source' path the linux kernel
will trigger an error, but in Zephyr this is silently treated as a
pattern that had no matches.

Also, when glob special characters are used the two languages will
match on different source files.

The Linux kernel's literal 'source' keyword is not present in Zephyr,
but it is useful, and often desired behaviour. E.g. the intended and
expected behaviour of:

source "Kconfig.zophyr"

would be to trigger an error due to a typo in the file name. But in
the Zephyr dialect this is treated as a valid glob pattern that
happened to not have any matches.

Another issue with changing the semantics of 'source' is that Kconfig
code and Kconfig infrastructure can no longer be re-used between the
Linux kernel and Zephyr as they are working with different languages.

To resolve these issues this RFC proposes to revert 'source' back to
the original Linux kernel semantics and introduce the 'gsource'
keyword to cover the use-case of wildcard matches.

In this solution the linux kernel's language will be a subset of the
Zephyr language and if a user wanted to he could write portable
Kconfig if he limited himself to this subset.

Script to reword wildcard matches to 'gsource':
https://gist.github.com/SebastianBoe/8d36b5b1af0491e5abc8fd598ded976c

RFC to introduce 'gsource':
ulfalizer/Kconfiglib#40

[0] https://en.wikipedia.org/wiki/Glob_(programming)

Signed-off-by: Sebastian Bøe sebastian.boe@nordicsemi.no

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This is an RFC for changing the Kconfig dialect that Zephyr is using.

Zephyr has copied and modified the Linux kernel's configuration
language into it's own tree. One modification that Zephyr has done is
changed the semantics of the 'source' keyword. Instead of the 'source'
argument being treated as a path it is treated as a glob pattern[0].

This is a backwards-incompatible change with the kernel's
configuration language, not just an extention of what 'source'
accepts. Meaning, running our Kconfig processor on the Linux kernel's
sources can produce different results.

Specifically, if there is a typo in the 'source' path the linux kernel
will trigger an error, but in Zephyr this is silently treated as a
pattern that had no matches.

Also, when glob special characters are used the two languages will
match on different source files.

The Linux kernel's literal 'source' keyword is not present in Zephyr,
but it is useful, and often desired behaviour. E.g. the intended and
expected behaviour of:

source "Kconfig.zophyr"

would be to trigger an error due to a typo in the file name. But in
the Zephyr dialect this is treated as a valid glob pattern that
happened to not have any matches.

Another issue with changing the semantics of 'source' is that Kconfig
code and Kconfig infrastructure can no longer be re-used between the
Linux kernel and Zephyr as they are working with different languages.

To resolve these issues this RFC proposes to revert 'source' back to
the original Linux kernel semantics and introduce the 'gsource'
keyword to cover the use-case of wildcard matches.

In this solution the linux kernel's language will be a subset of the
Zephyr language and if a user wanted to he could write portable
Kconfig if he limited himself to this subset.

Script to reword wildcard matches to 'gsource':
https://gist.github.com/SebastianBoe/8d36b5b1af0491e5abc8fd598ded976c

RFC to introduce 'gsource':
ulfalizer/Kconfiglib#40

[0] https://en.wikipedia.org/wiki/Glob_(programming)

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
@nashif nashif added the DNM This PR should not be merged (Do Not Merge) label Mar 28, 2018
@jli157
Copy link
Contributor

jli157 commented Apr 13, 2018

@SebastianBoe Is it possible to resolve the conflicts and fasten the review process so that the PR can be merged soon?

@SebastianBoe
Copy link
Collaborator Author

@jli157 : The blocker that takes time here is that using gsource/rsource will break the existing GUI tools that do not know what these keywords are.

@ulfalizer Is working on a GUI-replacement, and when accepted, we will drop support for the old GUI Kconfig frontends and start using gsource/rsource.

@ulfalizer will update this RFC when it is safe to start using Kconfig extentions and/or any other updates.

@SebastianBoe
Copy link
Collaborator Author

This RFC is now implemented in #7402

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

Successfully merging this pull request may close these issues.

None yet

4 participants