Skip to content

Release versions #2260

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 4 commits into from
Jul 27, 2016
Merged

Release versions #2260

merged 4 commits into from
Jul 27, 2016

Conversation

bridadan
Copy link
Contributor

Intro

This introduces the concept of "release versions" to the tools.

Previously, the condition for including a target in a release was decided by a release key being set to true in hal/targets.json. This doesn't have enough granularity when we release multiple versions of mbed.

Todo

Code Changes

This PR changes the release key in hal/targets.json to an array of strings, where each member is a version that the target supports. Currently the valid versions are "2" and "5".

You can now build up lists of these release configurations by calling the new function get_mbed_official_release in build_api.py. This function add checks for invalid target configurations in a release. This is enforced whenever it is called, preventing invalid targets from coming into the release.

It updates the build_release.py script to use get_mbed_official_release for fetching release targets.

It modifies the behavior of mcu_toolchain_matrix in build_api.py. It now prints release version support in the matrix. It also defaults to only showing targets supported by mbed OS 5. You can still show older release versions by modifying the release_version parameter of mcu_toolchain_matrix.

Public facing changes

New format of release key in hal/targets.json

Old

...

"LPC1768": {
        ...  
        "release": true
    },

...

New

...

"LPC1768": {
        ...
        "release": ["2", "5"]
    },

...

Removal of LPC2460 and XBED_LPC1768 from build_release.py

These two platforms do not support the ARM or uARM toolchain, so they are not supported by the version 2 release.

Version 5 supports only ARM, GCC_ARM, and IAR toolchains

Even if a platform supports uARM or GCC_CR, only ARM, GCC_ARM, and IAR will be returned in the release target tuple returned by get_mbed_official_release.

MCU-Toolchain matrix

Old output of python tools\make.py -S:

+-----------------------+-----------+-----------+-----------+-----------+-----------+
| Target                |    ARM    |  GCC_ARM  |    uARM   |   GCC_CR  |    IAR    |
+-----------------------+-----------+-----------+-----------+-----------+-----------+
| ARCH_BLE              | Supported | Supported |     -     |     -     |     -     |
| ARCH_BLE_BOOT         | Supported | Supported |     -     |     -     |     -     |

...

+----------------------+-----------+-----------+-----------+-----------+-----------+
Supported targets: N

New output of python tools\make.py -S:

+----------------------+-----------+-----------+-----------+-----------+-----------+
| Target               | mbed OS 2 | mbed OS 5 |    ARM    |  GCC_ARM  |    IAR    |
+----------------------+-----------+-----------+-----------+-----------+-----------+
| TARGET1              | Supported | Supported | Supported | Supported | Supported |
| TARGET2              | Supported | Supported | Supported | Supported | Supported |

...

+----------------------+-----------+-----------+-----------+-----------+-----------+
Supported targets: N

Enforcement of valid release target configurations

For the following examples, I removed both ARM and uARM from the LPC11U68 supported_toolchains key.

C:\Users\bridan01\Documents\dev\m_mbed\mbed>python tools\build_release.py -L
Traceback (most recent call last):
  File "tools\build_release.py", line 39, in <module>
    OFFICIAL_MBED_LIBRARY_BUILD = get_mbed_official_release('2')
  File "C:\Users\bridan01\Documents\dev\m_mbed\mbed\tools\build_api.py", line 183, in get_mbed_official_release
    raise InvalidReleaseTargetException(reason)
tools.utils.InvalidReleaseTargetException: Target 'LPC11U68' must support one of the folowing toolchains to be included in the mbed 2.0 official release: uARM, ARM
Currently it is only configured to support the following toolchains: GCC_CR, GCC_ARM, IAR



C:\Users\bridan01\Documents\dev\m_mbed\mbed>python tools\build_release.py -L
Traceback (most recent call last):
  File "tools\build_release.py", line 39, in <module>
    OFFICIAL_MBED_LIBRARY_BUILD = get_mbed_official_release('5')
  File "C:\Users\bridan01\Documents\dev\m_mbed\mbed\tools\build_api.py", line 183, in get_mbed_official_release
    raise InvalidReleaseTargetException(reason)
tools.utils.InvalidReleaseTargetException: Target 'LPC11U68' must support ALL of the folowing toolchains to be included in the mbed OS 5.0 official release: ARM, GCC_ARM, IAR
Currently it is only configured to support the following toolchains: GCC_ARM, GCC_CR, IAR

cc @0xc0170 @bogdanm

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 27, 2016

Great to have this distinction for various releases and enforce a check on those.

I am not fond of "release": ["2", "5"]. Numbers do not say much (what's 2 and 5 ? what if I add 6, does it break?), they are not clear for a user. Instead we could be more specific:

release: {
 v2: "true"
}

or

release_version": ["2", "5"]

@bridadan
Copy link
Contributor Author

@0xc0170 Thanks for the response!

release: {
 v2: "true"
}

That one is a bit wierd, because would the value of the key ever be anything besides "true"?

release_version": ["2", "5"]

I think this is fine and more descriptive. I will make this change!

bridadan added 3 commits July 27, 2016 13:36
Previously, the condition for including a target in a release was decided
by a 'release' key being set to 'true' in hal/targets.json. This doesn't
have enough granularity when we release multiple versions of mbed. This PR
changes the 'release' key to an array of strings, where each member is a
version that the target supports. Currently the valid versions are '2' and
'5'.

This PR also adds more robust checking for invalid target configurations
in a release. This is enforced whenever the release list is built from the
data, preventing invalid targets from coming into the release.

Finally, it updates the build_release.py script to use the new api for
fetching release targets.
This modifies the behavior of 'mcu_toolchain_matrix' in build_api.py. It
now prints release version support in the matrix. It also defaults to only
showing targets in mbed OS 5. You can still show older release versions by
modifying the 'release_version' parameter of the function.
The key 'release' in hal/targets.json is ambiguous. This changes the key
to 'release_versions' to emphasize that the entries should be version
numbers/strings and that it should be an array, not a singular value.
@bridadan
Copy link
Contributor Author

@0xc0170 Change made! Let me know if you have any other feedback! I'll go ahead and run tests on this.

/morph test

@bridadan
Copy link
Contributor Author

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=ALL

@mbed-bot
Copy link

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 545

Test failed!

@bridadan
Copy link
Contributor Author

Went ahead and killed the ci/mbedci-test test job since I realized the NRF51 based boards have added IAR support since this PR was made! They need a release version added. Will make this change ASAP.

@bridadan
Copy link
Contributor Author

/morph test

@mbed-bot
Copy link

[Build 728]
FAILURE: Something went wrong when building and testing.

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 546

Test failed!

@sg- sg- merged commit 8b98a2c into ARMmbed:master Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants