Skip to content
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

PSA release script update: add toolchain option #10606

Merged
merged 1 commit into from May 21, 2019

Conversation

Projects
None yet
5 participants
@jeromecoutant
Copy link
Contributor

commented May 17, 2019

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 ARMmbed/mbed-os-maintainers May 17, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented May 17, 2019

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

@orenc17
Copy link
Contributor

left a comment

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:

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

Contributor

Add assertion that the target actually supports the toolchain

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant May 17, 2019

Author Contributor

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)

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

Contributor

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)

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

Contributor

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):

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

Contributor

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

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant May 17, 2019

Author Contributor

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

@jeromecoutant jeromecoutant force-pushed the jeromecoutant:PR_PSAscript branch from 5fe65e9 to 4f02e0b May 17, 2019

@@ -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():

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

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

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

Contributor

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

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant May 17, 2019

Author Contributor

done

@jeromecoutant jeromecoutant force-pushed the jeromecoutant:PR_PSAscript branch from 4f02e0b to 392cc7d May 17, 2019

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))

This comment has been minimized.

Copy link
@orenc17

orenc17 May 17, 2019

Contributor
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

This comment has been minimized.

Copy link
@jeromecoutant

jeromecoutant May 17, 2019

Author Contributor

done

@jeromecoutant jeromecoutant force-pushed the jeromecoutant:PR_PSAscript branch from 392cc7d to 79ea266 May 17, 2019

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 20, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented May 20, 2019

CI started

@mbed-ci

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented May 20, 2019

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

@0xc0170

This comment has been minimized.

Copy link
Member

commented May 21, 2019

Restarted

@0xc0170 0xc0170 merged commit 77ca32d into ARMmbed:master May 21, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage Success
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8555 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details

@jeromecoutant jeromecoutant deleted the jeromecoutant:PR_PSAscript branch May 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.