-
Notifications
You must be signed in to change notification settings - Fork 2k
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
build system: add list of features for documentation and sanity checking #20366
Conversation
This also needs some documentation. The quick guide is:
|
8c06116
to
c5567a2
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.
CI comments
Would it make sense to have |
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.
Great work, that's a big step towards better documentation!
Did you write all the descriptions anew or did you take them from Kconfig files? If the latter is the case, we have to be careful of having several sources of truth in the tree and should converge to one eventually. Probably worth discussing at the VMA next week (and maybe wait with this PR until then?).
Some nit's below.
1d04e07
to
e894951
Compare
I added the missing documentation now |
A bit of both. The KConfig files did not have the grouping and since we disabled the feature check in the CI has started to bit-rot.
We did so last VMA: https://forum.riot-os.org/t/virtual-maintainer-assembly-vma-2023-11/4058/6 There was a bit of misunderstanding whether we drop all of KConfig or just the dependency (e.g. features and modules modeling). But in either case, the KConfig features are just a legacy as of now and this tries to salvage what I can and wire this back up into the CI. |
I've added calling the script to generate the markdown file to Note: The target |
May I squash? |
Okay, if we all agree that features are really part of the to-be-removed information of KConfig (I myself haven't worked enough with KConfig to judge this), then I would opt for removing the information that has been extracted into
Sounds sensible to me, but I'm far from an expert on our CI to be able to tell if that's a decent workaround.
Yes, from my side. |
1403063
to
849c40c
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.
Do you mind waiting until tomorrow so I can take a quick look? If it is urgent then you may dismiss.
I looked at it... Thanks for waiting.
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.
As requested in #20393, it would be practical to link from the feature to supported boards. #20395 has the infrastructure for obtaining that information (which is currently also generated in the generate-features
target). To be useful, such lists should make use of board metadata (so that an output can be "all STM32 boards" where applicable), and possibly be collapsed (like, listing 3 and an HTML summary that tells how many there are and expands to the full litany). Given the interdependencies, I suggest not doing this here, but getting this merged and then building on it.
This looks good to me from a high-level perspective (haven't gone through every detail yet, trusting one of those two who have will given a more well-founded ACK that I could give). @mguetschow, have your concerns been addressed?
Two small suggestions for the structuring:
(But that's just for if you choose to apply Kevin's suggestion, which I'm +0 about -- for if you do apply it, you could apply this before that to apply me the manual conflict resolution). |
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 we agreed on going forward with this approach for feature documentation at today's VMA, I give an ACK on the implementation as is. As for the specific format, maybe you want to consider @MrKevinWeiss proposal to have fixed keys (moving the title to the sub-structure)?
I do think that the now duplicated information in the Kconfig should be removed in a timely fashion, if not in this PR, then in a follow-up. In the latter case, let's open an issue for it to keep it on the list (maybe you can directly give some pointers as to where you've extracted the information from).
I'd vote for that, too. My main reason would be that it's easier to represent in Rust :). ... laze uses that scheme, too. |
I'd even go further:
This maps cleanly to sth like: struct FeatureYaml {
groups: Vec<Group>,
}
struct Group {
name: String,
help: String,
groups: Vec<Group>,
features: Vec<Feature>,
}
struct Feature {
name: String,
help: String,
} While not using the yaml map key as name and yaml map value as text gives up the free uniqueness checks, in practice that's trivial to add. And having explicit fields for e.g., "name" and "help" (instead of directly using key&value) allows adding fields. |
btw, there's a serde yaml schema generator that makes generating a yaml (and json) schema from those structs trivial. |
There is no corresponding driver (yet), so this feature is just confusing.
047bd53
to
5550a73
Compare
Rebased on top of #20408 to pass the CI, and squashed. |
Add a python script that allows having a single YAML file as source of truth for what features are available, and also add documentation such as help texts and grouping to them. This utility converts such a YAML file to a Makefile with the contents ``` FEATURES_EXISTING := \ feature_a \ feature_b \ ... \ features_z \ # ``` This allows the Makefile based build system to easily check if all provided features and all requested features do actually exist. In addition, this also converts the YAML file to a markdown file that documents the features. This file is then intended to be used by Doxygen to document the provided features. Co-authored-by: mguetschow <[email protected]> Co-authored-by: chrysn <[email protected]>
This lists and documents features in a machine readable form. It is intended to be used for documentation and the build system. Co-authored-by: mguetschow <[email protected]> Co-authored-by: chrysn <[email protected]>
5550a73
to
aa356d8
Compare
Now with the unused |
All green, should be get this in? |
There's an implementation detail that could yet be improved but could also turn out to be a very deep time sink hole: Instead of (ab)using make with non-file-name targets to regenerate files, we could embrace make and use it to ensure that whenever the generated features_existing.inc.mk is out of date, it gets rebuilt. The reason I think this may be a huge time sink is that that could interact badly with having the file checked in, and the alternative to not having the file checked in is having a post-checkout step that generates it before forking off into thousands of build tasks, which is yet again complicated. So let's not slow things down here with that. Given there is an ACK and that everything looks discussed and ready, pushing the button. |
Yeah! Thx :) |
- name: periph_flashpage_pagewise | ||
help: The Flashpage peripheral supports pagewise writing. | ||
- name: periph_flashpage_rwee | ||
help: The Flashpage peripheral is of the Read While Write. |
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 still don't know what that means 😄
These docs are not new in this PR -- could you open an issue for clarification and assign recent contributors (and PR reviewers) of that feature?
|
Contribution description
This PR adds a
features.yaml
file as machine readable but easy to edit format that lists, groups, and documents all features ("feature" as in the the build system entity) in RIOT. A small python script generates a Makefile for and markdown file from that.The Makefile is used to check if all features provided and requested are actually valid names or typos.
The Markdown file is used by Doxygen to generation a documentation page containing all features.
Testing procedure
make generate-features
to be run after touchingfeatures.yaml
, as the generated Makefile is tracked as source. This avoids running a python script before each and every of the current 141584 build targets (which would result in 4h of additional CPU time per CI build, if each build would add 0.1s of CPU time.)make doc
, so this would work right awaymake static-tests
catches when the list of features inmakefiles/features_existing.inc.mk
is stale (e.g. you updatedfeatures.yaml
but haven't runmake generate-features
yet).Issues/PRs references