-
Notifications
You must be signed in to change notification settings - Fork 13
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
doc: add first documentation draft #237
Conversation
Thanks. That already helps a lot. What I found still missing:
|
Sure, this is just a early draft. Most of the required documentation is still missing. We'll certainly expand it in the near future. The question for this PR is mainly if you think the recipe categories make sense from your point of view. I'm really open for suggestions so that we avoid having to rename settled categories later on... |
Before I write this with more words in the documentation: how about the following rules?
Regarding package names:
@sixtyfourktec @mahaase Please chime in if you have any thoughts on this. |
Because we talked about documentation earlier I think being able to really know what a config var is will be helpful. It will make it possible to find those and maybe add some info about it in any automatic created documentation. But than again, maybe bob should have an idea about what config variables there are as a first level build-in. I vision some auto generated website showing all available packages with name, desc, version, ... but also all possible config vars and some description of those. I agree on the package target naming you proposed. |
I looked over my recipes and found I wide range of names. :) Some of them are prefixed with So for me it would be fine to name them
I like the idea, but I'm unsure if it really needs a bob-feature for this. I think a comment-section would be sufficient. Something like: # Config-variables:
# FOO_VERSION : overrides the default package version
# FOO_DEBUG : 1 - debug mode enabled
# : 0 - debug mode disabled (default)
#
metaEnvironment:
PKG_VERSION: "${FOO_VERSION:-1.2.3}
buildVars: [FOO_DEBUG] |
This can be done by a plugin and I went ahead to actually implemented it. See the last two, new commits. The new Config:
FOO_VERSION:
help: overrides the default package version
FOO_DEBUG:
type: bool # This allows only "0" and "1"
help: Enable debugging. Disabled by default. There are also other types: Config:
EDK2_PLATFORM:
type: choice
help: Choose platform for EDK2 build.
choice:
OVMF_I386:
help: >
Platform configuration for a generic i386 target.
This platform will boot from flash address 0x0.
It should therefore be used as the first bootloader.
OVMF_RISCV:
...
REQUIRED_VAR:
type: str # this is the default type anyway
required: True # But variable must be present
FOO_BASE_ADDRESS:
type: hex
required: True
range: [0x00, 0xffffffff] # The range is optional
NUM_USERS:
type: int
range: [1, 10] The benefit of having such a description machine-readable in the recipe is that variables can be checked to some extent. The plugin will already check for required variable, refuse invalid choices, see if numbers are convertible and are in the required range. Later down the road this can certainly be extended. I also changed the gcc recipe to showcase how it can look like. Let me know what you think. |
Nice! |
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.
Can we also have an optional "default" entry?
plugins/config.py
Outdated
def handleStr(var, val): | ||
pass | ||
|
||
def handleHex(var, val): |
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.
Can't we handle that in the int function below. I am not a fan of having dedicated methods for converting those.
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.
Hmm, the error strings are different too. Not sure if we gain too much to deduplicate the remaining 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.
Well, it is not for saving code. It is just more user friendly, because numbers are simply numbers. However, if it is too complicated, then fine.
I knew this was coming and it makes a lot of sense. 😄 Unfortunately, this requires changing Bob. The |
The config plugin defines a new recipe keyword: "Config". It is used to describe variables that configure the behaviour of the recipe. This is obviously optional but should be used in the future to make configuration knobs of recipes discoverable and to provide some basic sort of consistency checking.
Add the definition of the main configuration variables with some small documentation.
No description provided.