Skip to content

PSA release script update: add toolchain option #10606

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 1 commit into from
May 21, 2019

Conversation

jeromecoutant
Copy link
Collaborator

Description

2 updates:

  • be able to compile Secure part with a given tool chain
  • avoid to delete full BUILD directory each time
$ python tools/psa/release.py -h
usage: release.py [-h] [-m MCU] [-t TC] [-d] [-q] [-l] [--commit]
                  [--skip-tests] [-x ...]

optional arguments:
  -h, --help           show this help message and exit
  -m MCU, --mcu MCU    build for the given MCU
  -t TC, --tc TC       build for the given tool chain (default is
                       default_toolchain)
  -d, --debug          set build profile to debug
  -q, --quiet          No Build log will be printed
  -l, --list           Print supported PSA secure targets
  --commit             create a git commit for each platform
  --skip-tests         skip the test build phase
  -x ..., --extra ...  additional build parameters

Pull request type

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

Reviewers

@ARMmbed/mbed-os-psa

@ciarmcom ciarmcom requested review from a team May 17, 2019 11:00
@ciarmcom
Copy link
Member

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

Copy link
Contributor

@orenc17 orenc17 left a comment

Choose a reason for hiding this comment

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

Also please add documentation to tools/psa/README.md

@@ -74,7 +74,12 @@ def _get_target_info(target):
if not os.path.exists(delivery_dir):
raise Exception("{} does not have delivery_dir".format(target))

return tuple([TARGET_MAP[target].name,
if toolchain:
Copy link
Contributor

Choose a reason for hiding this comment

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

Add assertion that the target actually supports the toolchain

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -182,6 +192,11 @@ def build_default_image(target, toolchain, profile, args):
logger.info("Building default image for {} using {} with {} profile".format(
target, toolchain, profile))

build_dir = os.path.join(ROOT, 'BUILD', target)
Copy link
Contributor

Choose a reason for hiding this comment

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

use this variable in line 206

@@ -142,6 +147,11 @@ def build_tests(target, toolchain, profile, args):
:param profile: build profile.
:param args: list of extra arguments.
"""
build_dir = os.path.join(ROOT, 'BUILD', 'tests', target)
Copy link
Contributor

Choose a reason for hiding this comment

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

use this variable in line 168


os.makedirs(build_dir)
logger.info("BUILD directory created in {}".format(build_dir))
if not os.path.exists(build_dir):
Copy link
Contributor

Choose a reason for hiding this comment

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

i believe this change is for incremental builds, if that's the case add a -c option to the argument parser for a clean build

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, BUILd part for the specific target is still deleted as the current behavior.
This patch just avoid to delete other targets.

@@ -74,7 +74,14 @@ def _get_target_info(target):
if not os.path.exists(delivery_dir):
raise Exception("{} does not have delivery_dir".format(target))

return tuple([TARGET_MAP[target].name,
if toolchain:
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
if toolchain not in TARGET_MAP[target].supported_toolchains:

Copy link
Contributor

Choose a reason for hiding this comment

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

@jeromecoutant it should be like this
the executeable_check is done in main()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

return tuple([TARGET_MAP[target].name,
if toolchain:
if toolchain not in TARGET_MAP[target].supported_toolchains:
raise Exception("Toolchain {} was not found in PATH".format(toolchain))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise Exception("Toolchain {} was not found in PATH".format(toolchain))
raise Exception("Toolchain {} is not supported by {}".format(toolchain, TARGET_MAP[target].name))

Error message should change as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@0xc0170
Copy link
Contributor

0xc0170 commented May 20, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented May 20, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

@orenc17
Copy link
Contributor

orenc17 commented May 20, 2019

exporter failed because of a license checkout failure...can someone restart?

@0xc0170
Copy link
Contributor

0xc0170 commented May 21, 2019

Restarted

@0xc0170 0xc0170 merged commit 77ca32d into ARMmbed:master May 21, 2019
@jeromecoutant jeromecoutant deleted the PR_PSAscript branch May 21, 2019 15:44
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.

5 participants