-
Notifications
You must be signed in to change notification settings - Fork 3k
Support default_toolchain override in mbed_app.json #4371
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
@cyliangtw This seems to confuse the issue of being able to override something with having a cumulative override. You do not have to have a cumulative override to override an attribute. |
@theotherjimmy what is the suggested patch? In the online IDE I tried to apply the following to mbed_app.json: {
"target_overrides": {
"*": {
"target.default_toolchain": "uARM",
"platform.stdio-flush-at-exit": false
}
}
} and got
|
diff --git a/tools/config/__init__.py b/tools/config/__init__.py
index 3f265f05a..76b2b92d6 100644
--- a/tools/config/__init__.py
+++ b/tools/config/__init__.py
@@ -642,6 +642,9 @@ class Config(object):
if full_name in params:
params[full_name].set_value(val, unit_name, unit_kind,
label)
+ elif name.startswith("target.") and unit_kind is "application":
+ _, attribute = name.split(".")
+ self.target.setattr(attribute, val)
elif name in self.__unused_overrides:
pass
else: |
That [patch ^] would get you the flexibility to override GCC_ARM's |
@sg- I don't think I was trying to say that it would currently work, just that calling an attribute which does not support adds and removes cumulative is going to be confusing to someone eons (months) from now. |
Thanks of theotherjimmy mentioned patch, it seems not work at
When will you apply this patch into mbed master ? |
@theotherjimmy What needs to happen with this ? |
@cyliangtw Whoops, wrong patch. It should be: diff --git a/tools/config/__init__.py b/tools/config/__init__.py
index 3f265f05a..76b2b92d6 100644
--- a/tools/config/__init__.py
+++ b/tools/config/__init__.py
@@ -642,6 +642,9 @@ class Config(object):
if full_name in params:
params[full_name].set_value(val, unit_name, unit_kind,
label)
+ elif name.startswith("target.") and unit_kind is "application":
+ _, attribute = name.split(".")
+ setattr(self.target, attribute, val)
elif name in self.__unused_overrides:
pass
else: |
@adbridge I would like to see overwriting non-cumulative overrides untangled from the ConfigCumulativeOverride class |
@cyliangtw I think that we could apply that to master soon. There is a big catch though: even though you can override the |
@theotherjimmy Your patch could work well on off-line compiler by CI command. After finish the support code in the online compiler or arrange the plan schedule, please notify me to evaluate. Thanks a lot. |
@sg-
Description
On-line IDE compiler will build the code by the
default_toolchain
intarget.json
.For some purpose, some application will prefer to use another one in
supported_toolchains
.So, to override the default tool chain by
mbed_app.josn
is a better way.Status
READY
Migrations
This PR is to add one more item
default_toolchain
inCUMULATIVE_ATTRIBUTES
.Also to modify config python file for non-list type of overrides.
Steps to test or reproduce