Skip to content

doc: Add Kconfig section#13040

Merged
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
leandrolanzieri:pr/doc/kconfig_in_riot
Jan 17, 2020
Merged

doc: Add Kconfig section#13040
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
leandrolanzieri:pr/doc/kconfig_in_riot

Conversation

@leandrolanzieri
Copy link
Copy Markdown
Contributor

Contribution description

This adds information regarding the usage of Kconfig from an user perspective and in-depth information on how it is currently integrated into RIOT's build system.

Testing procedure

Run make doc and read 'Kconfig in RIOT' section.

Issues/PRs references

None

@leandrolanzieri leandrolanzieri added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: doc Area: Documentation TF: Config Marks issues and PRs related to the work of the Configuration Task Force labels Jan 7, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.01 milestone Jan 7, 2020
@gschorcht
Copy link
Copy Markdown
Contributor

@leandrolanzieri I have a more general question. A number of configurations are currently being exposed by a number of PRs. All these PRs follow the same scheme, they just replace all occurences of XYZ_DEF with CONFIG_XYZ_DEF in source code, documentation and makefiles.

For example

#ifndef ESP_WIFI_SSID
#define ESP_WIFI_SSID    "RIOT_AP"
#endif

would become

#ifndef CONFIG_ESP_WIFI_SSID
#define CONFIG_ESP_WIFI_SSID    "RIOT_AP"
#endif

My concern is that such a change might also affect the Makefiles in user projects. Since ESP_WIFI_SSID has been documented as a required setting for using the WiFi interface on ESP boards, I have already seen these definitions in a couple of Makefiles of some user projects.

So I wonder if there wouldn't be an acceptable approach to introduce Kconfig variables without changing all source files, the Makefiles and the documentation, e.g.,

#if !defined(ESP_WIFI_SSID) && defined(CONFIG_ESP_WIFI_SSID)
#define ESP_WIFI_SSID    CONFIG_ESP_WIFI_SSID
#elif !defined(ESP_WIFI_SSID)
#define ESP_WIFI_SSID    "RIOT_AP"
#endif

While it would make each definition more complex, it would preserve the compatibility with previous definitions.

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

So I wonder if there wouldn't be an acceptable approach to introduce Kconfig variables without changing all source files, the Makefiles and the documentation, e.g.,

#if !defined(ESP_WIFI_SSID) && defined(CONFIG_ESP_WIFI_SSID)
#define ESP_WIFI_SSID    CONFIG_ESP_WIFI_SSID
#elif !defined(ESP_WIFI_SSID)
#define ESP_WIFI_SSID    "RIOT_AP"
#endif

I think it makes sense to actually do the changes in the code and documentation, and translate the current macros to the new ones:

#ifndef ESP_WIFI_SSID
#define ESP_WIFI_SSID    "RIOT_AP"
#endif

#ifndef CONFIG_ESP_WIFI_SSID
#define CONFIG_ESP_WIFI_SSID   ESP_WIFI_SSID
#endif

This way if the user uses the new names, they take precedence, if not we fall back to the legacy. We should also start a deprecation process of the old macros by announcing this in the documentation.

What do you think @gschorcht?

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

@gschorcht I addressed your comments

@gschorcht
Copy link
Copy Markdown
Contributor

So I wonder if there wouldn't be an acceptable approach to introduce Kconfig variables without changing all source files, the Makefiles and the documentation, e.g.,

#if !defined(ESP_WIFI_SSID) && defined(CONFIG_ESP_WIFI_SSID)
#define ESP_WIFI_SSID    CONFIG_ESP_WIFI_SSID
#elif !defined(ESP_WIFI_SSID)
#define ESP_WIFI_SSID    "RIOT_AP"
#endif

I think it makes sense to actually do the changes in the code and documentation, and translate the current macros to the new ones:

#ifndef ESP_WIFI_SSID
#define ESP_WIFI_SSID    "RIOT_AP"
#endif

#ifndef CONFIG_ESP_WIFI_SSID
#define CONFIG_ESP_WIFI_SSID   ESP_WIFI_SSID
#endif

This way if the user uses the new names, they take precedence, if not we fall back to the legacy. We should also start a deprecation process of the old macros by announcing this in the documentation.

What do you think @gschorcht?

That is, we already make all changes when exposing the configuration, but keep some legacy definitions for compatibilty reasons in the way you suggest and declare them as deprecated in the documentation? I could live with that approach.

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

That is, we already make all changes when exposing the configuration, but keep some legacy definitions for compatibilty reasons in the way you suggest and declare them as deprecated in the documentation?

Exactly

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

@fjmolinas I think it would be good to have this in the release, since we are introducing Kconfig for several modules. Could you take a look as well?

Copy link
Copy Markdown
Member

@PeterKietzmann PeterKietzmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leandrolanzieri thanks for the detailed description. After the first (offline) review round of this document, I left a few minor comments to improve the text but I leave it up to you which to address.

Furthermore, I think that this piece of documentation should be backported to the release brach once merged

@PeterKietzmann
Copy link
Copy Markdown
Member

And I tested make doc. No errors and the site looks good

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

@PeterKietzmann thanks for reviewing, I addressed your comments.

Copy link
Copy Markdown
Member

@PeterKietzmann PeterKietzmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK from my side after the suggested change has been applied. Please squash afterwards.

@fjmolinas
Copy link
Copy Markdown
Contributor

Offline @leandrolanzieri asked if this one could be backported to have the new kconfig doc present in the release branch. AFAIK documentation falls in the category of features that can be backported so go ahead.

This adds information regarding the usage of Kconfig from an user
perspective and in-depth information on how Kconfig is currently
integrated to RIOT's build system.
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

@PeterKietzmann fixed and squashed

@leandrolanzieri leandrolanzieri added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 17, 2020
@PeterKietzmann
Copy link
Copy Markdown
Member

Green lights. ACK & go

@PeterKietzmann PeterKietzmann merged commit cf5356d into RIOT-OS:master Jan 17, 2020
@leandrolanzieri leandrolanzieri deleted the pr/doc/kconfig_in_riot branch January 17, 2020 12:14
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Backport provided in #13153

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 17, 2020

Since it's not a bug, just documentation, it doesn't need to be backported (and the corresponding label was not set).

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Since it's not a bug, just documentation, it doesn't need to be backported (and the corresponding label was not set).

@fjmolinas agreed that documentation improvements can be backported for the release

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 17, 2020

Doesn't make sense (sorry @fjmolinas): the online documentation always points the latest master, so the new section should be online soon. From my experience, documentation PR doesn't fall into the needs backport case, only bug fixes do.

@fjmolinas
Copy link
Copy Markdown
Contributor

Doesn't make sense (sorry @fjmolinas): the online documentation always points the latest master, so the new section should be online soon. From my experience, documentation PR doesn't fall into the needs backport case, only bug fixes do.

The hard-feature free\e email we send out says:

We've created the [YYYY.MM] release branch, so we are now officially in
feature freeze. This means from now only bugfixes will be backported to
the `[YYYY.MM]-branch`. If anyone has any bugfixes or documentation
improvements that they feel should be part of this release please let me know.

Online documentation is not versioned, so if I want to see documentation that matches my version of RIOT I would check the documentation in code. I see no issue with backporting this.

@fjmolinas
Copy link
Copy Markdown
Contributor

The hard-feature free\e email we send out says:

Not saying its a rule, but it seems like the closest thing to it that we have IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR TF: Config Marks issues and PRs related to the work of the Configuration Task Force Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants