Skip to content

eclipse_gcc_arm export improvement #10295

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

Merged
merged 3 commits into from
Apr 4, 2019

Conversation

AndriiLishchynskyi
Copy link
Contributor

Description

Current implementation of cdt exporter requires modification of cdt_definitions.json in order to support launch configuration for new kit (double-core). Usually launch configuration does not change if devices are derived from the same family. This pull request reduces maintenance burden of new kits support by allowing them to be based on extra_labels and not necessarily defined for each kit separately.

Also this pull request fixes:

All internal tests are passed

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[X] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@theotherjimmy

Release Notes

@ciarmcom ciarmcom requested review from theotherjimmy and a team April 2, 2019 17:00
@ciarmcom
Copy link
Member

ciarmcom commented Apr 2, 2019

@AndriiLishchynskyi, thank you for your changes.
@theotherjimmy @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

if configuration in target_specific[tgt.name]:
eclipse_config.update(target_specific[tgt.name][configuration])
aliases = self.toolchain.target.resolution_order_names \
+ self.toolchain.target.extra_labels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this different from self.toolchain.target.labels? Is that something that you could use instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is different a bit, but it is also ok, so I switched to self.toolchain.target.labels

if target_alias:
eclipse_config.update(target_specific[target_alias]['generic'])
if configuration in target_specific[target_alias]:
eclipse_config.update(target_specific[target_alias][configuration])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would write this differently, as I generally avoid using the next function:

for target_alias in aliases:
    if target_alias in target_specific:
        eclipse_config.update(target_specific[target_alias]['generic'])
        if configuration in target_specific[target_alias]:
            eclipse_config.update(target_specific[target_alias][configuration])
        return eclipse_config

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied your fix, thanks.

Copy link
Contributor

@theotherjimmy theotherjimmy Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dropped (or mis-indented) the return, which makes the code apply all possible target specific settings from most specific to least specific, as opposed to what it used to do which is apply the first match or most specific match.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed that. I added a break instead of return, because we still have to return defaults, even if specific settings does not exist.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 4, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 4, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 06b60e3 into ARMmbed:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants