-
Notifications
You must be signed in to change notification settings - Fork 324
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: implement flexible site-selection system #3054
build: implement flexible site-selection system #3054
Conversation
0fe6fd4
to
92ac0bb
Compare
I like the idea of using a Lua DSL here a lot, but I think it would be nicer if features and packages could be configured in the same file, as they are often related. That would also allow to set related conditional features and packages under a single |
Great idea! I'll see how this can be done. |
20992d1
to
87721cc
Compare
@neocturne I've adressed your request, does this look better? |
Added a first draft of documentation. Example and CI sites still need to be reworked. |
dd90095
to
ee11ddf
Compare
@neocturne Please see the updated PR, is this more to your liking? Also yes, negation is still supported, as this is done in |
ee11ddf
to
a434925
Compare
3b855c8
to
7935eee
Compare
Looking quite nice now! Two remarks (obviously bikeshedding - I'm fine with either solution, just stating my preference):
|
1799467
to
1e16177
Compare
No special reason for keeping the For the capitalization - My intention was to keep modifying functions with a leading Uppercase while function for the logic evaluation have lowercase first letters. |
a5ae531
to
0ca701f
Compare
Using lowercase for everything would be consistent with our target definitions, so if we decide to go with the uppercase names, I would propose to change those as well. Using a consistent function name case still feels more common as a coding style, but I accept that it may make sense to apply different rules to such DSLs. |
@neocturne I'll opt with all lowercase and maybe revising the docs. Anything from the implementation side i should revise? |
One more idea: How about allowing to specify negated features and packages as A very simple implementation might look like this (using the getmetatable('').__unm = function(s)
return '-' .. s
end |
291fc8d
to
06516b0
Compare
Now we use the new Image-customization framework in Gluon, we need to also update the docs so examples and descriptions are acurate again. Signed-off-by: David Bauer <mail@david-bauer.net>
Print a warning in case users attempt to build Gluon using a site.mk which containes deprecated GLUON_FEATURES or GLUON_SITE_PACKAGES. Signed-off-by: David Bauer <mail@david-bauer.net>
If we align the table keys of the selection table to match the return object of get_selections, we can omit creating a new return object. Signed-off-by: David Bauer <mail@david-bauer.net>
875ff0b
to
c3474a8
Compare
Include the file-extension with the image-customization.lua file. This will ease work with editors providing syntax highlighting, as they now properly detect the file-type. Signed-off-by: David Bauer <mail@david-bauer.net>
Signed-off-by: David Bauer <mail@david-bauer.net>
7ceeab7
to
3bf54a7
Compare
Updated the PR. I have not build-tested the current state yet. |
461b822
to
d9bb9bc
Compare
Create an init routine which loads the environment only once instead every evaluation. Signed-off-by: David Bauer <mail@david-bauer.net>
e5e61a4
to
d65573d
Compare
Load the site image-customization.lua file only on init. Previously, the file was loaded on every device invocation. Signed-off-by: David Bauer <mail@david-bauer.net>
d65573d
to
dd5c503
Compare
It would be quite handy to be able to call:
|
@maurerle I would like to hold this back for further improvement. I see this as possible, but we would ahve to build this meta-information from the same source. Possibly the same way as to handling flash-sizes as well as RAM. |
Sure, I am fine with that. I just build and tested Firmware from this PR - looks good. I am happy with merging it the way it is. |
Signed-off-by: David Bauer <mail@david-bauer.net>
This is currently lacking documentation.
Opening as a draft to obtain feedback whether or not this is moving in the right direction.
Implement a flexible system for handling site-defined features as well as packages.
This system is inspired by the existing feature-system and allows for a more flexible approach for selecting specific packages for devices.
Features are now defined in a
features
file in the site-root. The same goes for packages.These files are sequentially evaluated and the device-package list is evaluated for each device independently.