-
Notifications
You must be signed in to change notification settings - Fork 3k
[tools] Modified config to aggregate cumulative overrides against targets #2215
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
Conversation
@geky I tested it with uVisor and the label does not appear in the macros list, nor in the My sample config file: {
"target_overrides": {
"K64F": {
"target.features_add": ["UVISOR"],
"target.extra_labels_add": ["UVISOR_SUPPORTED"]
}
}
} |
Oh, looking into this there are complicated dependencies between the config system and the target system. This will require a bit of extra work to sort out the labels correctly. |
In tools/config.py, Config now aggregates all cumulative attributes in target overrides. { "target_overrides": { "K64F": { "target.features_add": ["UVISOR"], "target.extra_labels_add": ["UVISOR_SUPPORTED"], "target.macros_add": ["UVISOR_MACRO"], "target.device_has_add": ["UVISOR_HAS"] } } } Note: no action is performed on overrides yet
Modified '_process_config_and_overrides' to update cumulative attributes based on cumulative overrides found during walking config files. This should remove most of the disparity between the config target cumulative overrides and cumulative attributes set in targets.json. These cumulative overrides are updated after the global target instantiation though, which may cause internal build tool state dependent on cumulative attributes to not correctly reflect all cumulative overrides.
Due to dependencies between the config/target systems, the config has been modified to preparse the mbed_app.json for overrides. This means that attributes with dependencies in the targets are only valid at the application level. A hard error has been added for these attributes if they are supplied at the library level.
This feature was not part of the original config system design and implementation, because those overrides are not actually configuration parameters. There are overrides of JSON attributes of the target object, and these attributes are not part of the configuration mechanism, This makes things confusing and hard to understand, just like it did with
|
Hi @AlessandroA, I have updated this pr with additional handling for the extra_labels which I've tested locally. Let me know if this doesn't work for you. |
Relevant:
#2209 or not, a non-trivial change like this to the config system should be followed by a documentation update. |
408802b
to
41a70d3
Compare
I agree we should add additional documentation for target overrides in the config, but it seems inappropriate to combine a documentation update and a bug fix. I can make a separate pr for adding the target override documentation? |
41a70d3
to
a5ea143
Compare
docs are actually moving out of this repo for now due to the way the website renders things 😕 |
@geky I tested the PR with the uVisor app and the symbols are all correctly defined. Thanks! PS: @sg- If I rebase @geky's branch on top of the latest master the compilation fails because of some UDP/TCPSocket error – Is this a known issue? |
This could be the case due to duplicate network socket declarations in features of os an core. Try to delete one from mbed-os and let me know what happens |
@sg- Yes, that was it. Thanks! |
How is that inappropriate, when the actual fix for the bug introduces new behaviour in the configuration system, and people need to know how to use that? I would say that updating the documentation with the implementation is the most appropriate thing to do. |
I just don't see how coupling this bug fix and adding documentation for a mechanism that has been around since #1906 is beneficial for either issues. Sorry we're not agreeing here and if I'm in the wrong. Has an issue been made on github for the missing documentation on cumulative attributes? I can look into adding what is missing. |
I always thought that updating the documentation together with the code is always a good idea, and I can't recall a single time when this wasn't the case. What tends to happen if you don't do it right after you modify the code (and in the same PR) is that you'll forget about it and go on doing other things. It has happened over and over again, to myself and pretty much all the programmers I know. I don't believe that documentation updates need a separate issue on github, they should be part of the regular workflow. |
Modified '_process_config_and_overrides' to update cumulative attributes based on cumulative overrides found during walking config files.
This should remove most of the disparity between the config target cumulative overrides and cumulative attributes set in targets.json. These cumulative overrides are updated after the global target
instantiation though, which may cause internal build tool state dependent on cumulative attributes to not correctly reflect all cumulative overrides.
Example:
cc @sg-, @screamerbg, @theotherjimmy
related #2209