-
Notifications
You must be signed in to change notification settings - Fork 3k
build api: fix release version #12982
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
Run the first series of tests |
|
||
if version == `2`: | ||
raise InvalidReleaseTargetException("Mbed 2 not supported anymore with this version of tools") | ||
|
||
mbed_official_release = ( |
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.
I am not sure the syntax is correct here. Can you run the script with your changes?
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.
I was checking what CI expected and seems to be as it is here. will study CI results once we get some, if all is being tested as it should
@evedon |
We had previously similar experience, tools are used in expected way - this release version is due to supporting multiple versions so CI had to check for version + target. |
I fixed travis error |
CI started |
ci restarted |
CI restarted I changed the approach for mbed 2 in that function, can't afford to raise an exception as that is a breaking change there for now. Rather return an empty tuple, as that is what others expect (CI should not break - if we use exception, I would need to refactor CI config and others). |
Test run: FAILEDSummary: 2 of 3 test jobs failed Failed test jobs:
|
Ci restarted, can't find the error only jenkins generic exception |
I found the errors in the log, investigating |
This is non trivial fix as the function is being used outside of this repository. Tools rely on it to return list of targets for 2 or 5. As we removed release_version from many targets, this broke the logic. To keep the logic as it was, without updating all tools out there now, lets just return full set of targets - all are supported. In case for Mbed 2, returning all targets does not make sense, but rather raise an exception here. Not supported. This avoids suprised. If you look at build api functions there are many checks for 2 or 5 so more clean up needed to actually get release_version out of the tools.
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
We cant afford to raise an exception now. As anyone using this out there do not catch it. Rather an empty list, as it can work after this fix - won't do anything.
5a65d26
to
59db9f6
Compare
Rebased on top of master to be sure we got all needed (the latest targets removals) |
CI restarted @MarceloSalazar The failures might be related to the latest removals (mbed 2 only targets?), will need to check. It might be that CI ignored it previously based on release_version. Lets review CI once it completes after my latest rebase |
Test run: FAILEDSummary: 2 of 3 test jobs failed Failed test jobs:
|
@jeromecoutant would you know why some nucleo fail here:
These targets were supported in Mbed OS 5, so should build without errors with this fix we have in here. |
@jeromecoutant we identified a bug, its in the CI tools (+ this fix), its around baremetal, we are working on fixing that. |
After some discussion/investigation, I think we are going to need a way of distinguishing mbed 6 in current targets.json file, So the above context, I'd like to propose the change to this impacted functions to def get_mbed_official_release(version, profile=None):
if version == '2':
return tuple(tuple([]))
if version in ['5', '6']:
mbed_official_release = (
tuple(
tuple(
[
TARGET_MAP[target].name,
tuple(['ARM', 'GCC_ARM'])
]
) for target in TARGET_NAMES \
if not profile or profile in TARGET_MAP[target].supported_application_profiles
)
)
return mbed_official_release if the profile parameter not given, it treated as querying for all profiles. |
mbed_official_release = ( | ||
tuple( | ||
tuple( | ||
[ | ||
TARGET_MAP[target].name, | ||
tuple(transform_release_toolchains( | ||
TARGET_MAP[target], version)) | ||
tuple(['ARM', 'GCC_ARM']) |
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.
just wonder why do we use hard-coded tuple here? instead of calling the function? and IAR been dropped?
We can fix the function if need?
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.
I wanted to avoid refactoring at the moment (so changes just to one function to get the functionality needed). transform_release_toolchains
does not have much meaning anymore as only ARM or GCC ARM is supported, so this can be hardcoded here
To select supported_application_profiles attribute from targets
Every target is assumed to supported Mbed OS. If its not the case, it supports only baremetal. Thus removing rtos, and adding bare-metal to the app profile.
For only baremetal targets, just drop in replace. Don't need to add/remove.
I updated the PR as proposed (adding rtos and baremetal t o the top level Target and overwrite it for some). |
CI started |
@jamesbeyond if CI merges, please merge this to test this with nightly asap. |
Test run: SUCCESSSummary: 6 of 6 test jobs passed |
CI passed, merging PR |
All targets will inherit |
Summary of changes
This is non trivial fix as the function is being used outside of this repository.
Tools rely on it to return list of targets for 2 or 5. As we removed release_version from many targets,
this broke the logic. To keep the logic as it was, without updating all tools out there now,
lets just return full set of targets - all are supported.
In case for Mbed 2, returning all targets does not make sense, but rather raise an exception here. Not supported. This avoids suprised. If you look at build api functions there are many checks for 2 or 5 so more
clean up needed to actually get release_version out of the tools.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers