Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Kconfig Module #5031
Kconfig Module #5031
Changes from all commits
66db1af
647bd28
49076d7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 have not used kconfig all that much, but shouldn't we load the output file? Specifically something that will get generated in the build dir rather than reading stuff from the source dir? Loading stuff from source dir means that you can have only one configuration per source dir, not one per build dir as is the Meson standard.
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.
Indeed, since Meson only supports out-of-tree build, it is somewhat unfortunate that the default for
kconfig
output is.config
in the toplevel source directory. However, the output file can be overridden using an environment variable, usually specified likeI expect that users of this module will make the location of the configuration file a Meson option too, so that the same file can be specified both as
KCONFIG_CONFIG
and when invoking Meson. I will add a note to the documentation.Of course, having to specify the directory twice is ugly; unfortunately on one hand the build directory is not known when you invoke the kconfig frontend, and on the other hand the kconfig frontend must be invoked before Meson. One possible fix is to provide some kind of script that wraps
meson setup
and invokes kconfig before Meson (removing the need to ship aMakefile
), not unlike those Meson users that are providing a simple-mindedconfigure
script. That script can then pass a file in the build directory and pass it to both kconfig and Meson.That said, the placement of the configuration also depends on the usecase. For example, QEMU only uses kconfig as a common format to store pre-defined
configuration_data
for each binary; it does not employ any front-end, instead all processing of the configuration happens inmeson.build
. In that case, the configuration files are fixed and committed, and they definitely come from the source directory.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.
Since the module is unstable, we can change it later. We can merge this and change the behaviour as people test it on real world code.
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.
Maybe something like:
That runs the given command if the output
.config
file does not exist in the build dir and otherwise just loads 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.
It seems sensible but I would first try and see how people use this. The config frontends usually have their own make-based build system, and invoking make from Meson would be a bit weird...
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.
If you were referring to:
genkconfig .config -> config.h
, then yes, I wrote acustom_target
that does just that.If you were referring to generating the default
.config
automatically witholddefconfig
then no, it's very easy but apparently considered bad practice in the (interactive) Kconfig world to automagically build the default configuration. This must be an explicit choice from the user as seen in the Linux kernel example.