Documentation: add a history of the Kconfig language
Subsystems (3)
Julian Braha
reviewerPATCH 1/1 Documentation: add a history of the Kconfig language
An ecosystem around the Kconfig language has been growing for years. There is an alternative implementation [1], 3rd-party parsers [2], a grammar for tree-sitter [3], language servers [4], tools built on SAT-solving [5], an entire research platform [6], and many forks of the in-tree implementation. There are at least 40 other projects besides the Linux kernel using Kconfig [7], many of which copy the implementation out of the Linux source tree. For example, U-Boot uses Kconfig from Linux v6.1 [8], and coreboot uses Kconfig from Linux from release v6.8 [9]. Without a language changelog, it is not clear how the Kconfig used across the kernel history and Kconfig ecosystem differ, and most commits to scripts/kconfig/ do not affect the language itself.
Let's add a history of the Kconfig language to the documentation. Changes are collected by Linux release with tags to classify the change as syntax, semantics, macros, or error handling. The "syntax" classification is used for changes to the grammar of the language (thus requiring an update to any parsers). Changes are generally classified as "semantics" if they affect what is considered a valid or invalid configuration. Error handling is for changes to warnings and errors. Finally, references to the relevant commits are provided with changes for readers that need more detail.
Note that not all commits to scripts/kconfig/ are included in this changelog. In fact, only about 6% of all commits to that directory are referenced in this documentation. Other non-language commits include changes like code refactors, changes to tooling like localmodconfig, mechanical fixes (e.g. preventing UB), or changes to input validation.
--- Documentation/kbuild/index.rst | 1 + Documentation/kbuild/kconfig-history.rst | 615 ++++++++++++++++++++++ Documentation/kbuild/kconfig-language.rst | 3 + 3 files changed, 619 insertions(+) create mode 100644 Documentation/kbuild/kconfig-history.rst
Documentation/kbuild/index.rst +1 -0
@@ -9,6 +9,7 @@ Kernel Build System kconfig-language kconfig-macro-language + kconfig-history kbuild kconfig
Documentation/kbuild/kconfig-history.rst new file +615 -0
615 lines not on this page · raw message
Documentation/kbuild/kconfig-language.rst +3 -0
@@ -2,6 +2,9 @@ Kconfig Language ================ +Historical changelog available here: +:doc:`Documentation/kbuild/kconfig-history.rst <./kconfig-history>` + Introduction ------------
Signature · 1 line
2.56.0
Randy Dunlap
reviewerHi,
Documentation/kbuild/kconfig-history.rst line 60
Quoted 7 lines · Julian Braha
+6.18
+----Documentation/kbuild/kconfig-history.rst new file +5
-0+ +**Syntax and semantics**: + +- add ``transitional`` to specify that an option should no longer be written to + the output ``.config`` file. (f9afce4f32e9 and 0902b3cb23ce)
FWIW, this also replaces using
depends on OPTION1 {<=, >=} OPTION2that has been used/preferred in a few instances.
./fs/cramfs/Kconfig: depends on CRAMFS && CRAMFS <= MTD
./drivers/acpi/apei/Kconfig: depends on CXL_BUS && CXL_BUS <= ACPI_APEI_EINJ./drivers/net/ethernet/sfc/Kconfig: depends on SFC && CXL_MEM >= SFC./drivers/cxl/Kconfig: depends on EDAC >= CXL_BUS
./security/keys/trusted-keys/Kconfig: depends on TCG_TPM >= TRUSTED_KEYS./security/keys/trusted-keys/Kconfig: depends on TEE >= TRUSTED_KEYS./security/keys/trusted-keys/Kconfig: depends on CRYPTO_DEV_FSL_CAAM_JR >= TRUSTED_KEYS./security/keys/trusted-keys/Kconfig: depends on CRYPTO_DEV_MXS_DCP >= TRUSTED_KEYS./security/keys/trusted-keys/Kconfig: depends on PSERIES_PLPKS >= TRUSTED_KEYS
Signature · 1 line
~Randy
Quoted 7 lines · Julian Braha
Signed-off-by Julian Braha <[email protected]>--- Documentation/kbuild/index.rst | 1 + Documentation/kbuild/kconfig-history.rst | 615 ++++++++++++++++++++++ Documentation/kbuild/kconfig-language.rst | 3 + 3 files changed, 619 insertions(+) create mode 100644 Documentation/kbuild/kconfig-history.rst
Thanks.
Signature · 1 line
~Randy
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Low] docs: kbuild: inaccurate description of commit 03d29122738f under 2.6.23 - [Low] docs: kbuild…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Low] docs: kbuild: inaccurate description of commit 03d29122738f under 2.6.23
- [Low] docs: kbuild: inverted choice prompt warnings for 8a36b98fd0d8 under 2.5.71
- [Low] docs: kbuild: misleading config expansion note for 4.18 source and mainmenu --
commit b7aadddaf53dea66112a1e16bcdf2b1fb258d755
Author: Julian Braha <[email protected]>
Documentation: add a history of the Kconfig language
This commit adds Documentation/kbuild/kconfig-history.rst, documenting the history of changes to the Kconfig language across Linux releases, categorized by syntax, semantics, macros, and error handling.
Quoted 6 lines
Documentation/kbuild/kconfig-history.rst new file +0
-0@@ -0,0 +1,615 @@
[ ... ]
Documentation/kbuild/kconfig-history.rst line 248
Quoted 7 lines
+4.18
+----Documentation/kbuild/kconfig-history.rst new file +5
-0+ +**Semantics**: + +- remove support for evaluating config values in ``source`` and ``mainmenu`` + strings that lack parentheses. (bb222ceeb327 and 96d8e48da55a)
[Severity: Low]
Does the qualification "that lack parentheses" here imply that config option values can still be expanded in source and mainmenu strings if parentheses are used?
Commits bb222ceeb327 ("kconfig: remove string expansion in file_lookup()") and 96d8e48da55a ("kconfig: remove string expansion for mainmenu after yyparse()"), followed by commit 5b31a9746756 ("kconfig: remove sym_expand_string_value()"), completely removed sym_expand_string_value(), which was the mechanism that expanded Kconfig config symbol values ($FOO) in source and mainmenu strings.
The parenthesized $(FOO) syntax introduced in 4.18 in scripts/kconfig/preprocess.c only expands preprocessor macro variables, functions, and environment variables in the lexer, not Kconfig config option symbols. Should this say that support for evaluating config values in source and mainmenu strings was removed altogether?
[ ... ]
Documentation/kbuild/kconfig-history.rst line 476
Quoted 6 lines
+2.6.23
+------Documentation/kbuild/kconfig-history.rst new file +4
-0+ +**Semantics**: + +- allow using ``--help--`` with menu. (03d29122738f)
[Severity: Low]
Is this description of commit 03d29122738f ("kconfig: attach help text to menus") accurate?
In Kconfig internals, struct menu represents any menu tree entry (such as a config, menuconfig, or choice definition). Commit 03d29122738f moved the char *help field from struct symbol to struct menu in scripts/kconfig/expr.h and updated the help rule in scripts/kconfig/zconf.y:
- current_entry->sym->help = $2;
+ current_entry->help = $2;
This allowed multiple definitions of the same symbol to have distinct help texts instead of overwriting a single per-symbol help pointer. Kconfig menu blocks (menu ... endmenu) do not accept help attributes in the grammar, and --help-- with two hyphens was not a valid Kconfig keyword.
[ ... ]
Quoted 2 lines
+2.5.71
+------
[ ... ]
Documentation/kbuild/kconfig-history.rst line 555
Quoted 7 lines
Documentation/kbuild/kconfig-history.rst new file +7
-0+**Error handling**: + +- warn when options in a choice have a ``default``. (f3b837df9e2b) + +- warn when a choice doesn't have a prompt. (8a36b98fd0d8) + +- warn when options in a choice have a prompt. (8a36b98fd0d8)
[Severity: Low]
Are these two entries for commit 8a36b98fd0d8 misstating the warnings added in menu_finalize() in scripts/kconfig/menu.c?
In menu_finalize(), "choice value" refers to a member option inside a choice block (SYMBOL_CHOICEVAL), whereas the choice block itself is checked separately (and is already listed below under f9f0d1c0da3a). Commit 8a36b98fd0d8 added:
if (!menu->prompt)
menu_warn(menu, "choice value must have a prompt");and:
for (prop = sym->prop; prop; prop = prop->next) {
...
if (prop->type == P_PROMPT && prop->menu != menu) {
prop_warn(prop, "choice values currently only support a single prompt");
}
}Should the first entry state that Kconfig warns when options in a choice do not have a prompt, and the second entry state that Kconfig warns when options in a choice have multiple prompts (matching the two warnings that were later promoted to errors in 6.10 by commits 700e7a8d05ea and 8a22f867e330)?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1