1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-06-06 02:40:18 +00:00

arm/trusted-services: update to 2024 April 19

Update TS and dependencies to latest version of the integration branch.
Remove patches merged upstream.

Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Gyorgy Szing
2024-04-29 17:26:51 +02:00
committed by Jon Mason
parent fa05df1611
commit 2d46f21731
5 changed files with 8 additions and 1195 deletions
@@ -38,8 +38,7 @@ class TrustedServicesTest(OERuntimeTestCase):
@OEHasPackage(['ts-psa-ps-api-test'])
@OETestDepends(['ssh.SSHTest.test_ssh'])
def test_05_psa_ps_api_test(self):
# There are a few expected PSA Storage tests failing
self.run_test_tool('psa-ps-api-test', expected_status=46)
self.run_test_tool('psa-ps-api-test')
@OEHasPackage(['ts-psa-iat-api-test'])
@OETestDepends(['ssh.SSHTest.test_ssh'])
@@ -1,179 +0,0 @@
From f3ba58b00ec967970d22dfbd71c406ccb5b2ac78 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Fri, 29 Sep 2023 16:21:26 +0100
Subject: [PATCH 1/1] Upgrade nanopb to v4.7.0
Upgrade the nanopb to 0.4.7 and add the following fixes:
- remove the nanopb patch as it has become obsolete.
- stop using the nanopb protoc wrapper when building the generator as
this seems to cause build issues.
- use the new nanopb_PYTHON_INSTDIR_OVERRIDE variable to set the
install location for the generator. Modify TS cmake script to search
the generator in the install content instead of the nanopb source.
- pass discovered python settings to nanopb build using the initial
cache. This speeds up the build and allows easier control of python
discovery for integration systems.
Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Gyorgy Szing <gyorgy.szing@arm.com>
---
external/nanopb/fix-pyhon-name.patch | 41 ----------------------
external/nanopb/nanopb-init-cache.cmake.in | 9 ++++-
external/nanopb/nanopb.cmake | 34 +++++++++---------
3 files changed, 24 insertions(+), 60 deletions(-)
delete mode 100644 external/nanopb/fix-pyhon-name.patch
diff --git a/external/nanopb/fix-pyhon-name.patch b/external/nanopb/fix-pyhon-name.patch
deleted file mode 100644
index ab0e84c5..00000000
--- a/external/nanopb/fix-pyhon-name.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-This patch fixes two issues:
-
-1. On windows the python3 executable is not allways called "python3". As a result
- "protoc" execution can fail due to the shebang in the file. This patch fixes
- this by running protoc with the intepreter.
-
-2. In addition when not running from a virtualenv, the install path for python file
- is set to the "user site-packages" to avoid needing elevated access rights.
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 31c86e7..e827015 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -54,13 +54,25 @@ if(nanopb_BUILD_GENERATOR)
- string(REGEX REPLACE "([^;]+)" "\\1_pb2.py" generator_proto_py_file "${generator_proto}")
- add_custom_command(
- OUTPUT ${generator_proto_py_file}
-- COMMAND ${nanopb_PROTOC_PATH} --python_out=${PROJECT_BINARY_DIR} -I${PROJECT_SOURCE_DIR}/generator/proto ${generator_proto_file}
-+ COMMAND ${Python_EXECUTABLE} ${nanopb_PROTOC_PATH} --python_out=${PROJECT_BINARY_DIR} -I${PROJECT_SOURCE_DIR}/generator/proto ${generator_proto_file}
- DEPENDS ${generator_proto_file}
- )
- add_custom_target("generate_${generator_proto_py_file}" ALL DEPENDS ${generator_proto_py_file})
-+
-+ if (DEFINED ENV{VIRTUAL_ENV})
-+ set(PYTHON_INSTALL_DIR ${Python_SITELIB} CACHE PATH "Install location for generated python modules.")
-+ else()
-+ execute_process(
-+ COMMAND ${Python_EXECUTABLE} -m site --user-site
-+ OUTPUT_VARIABLE PYTHON_USER_SITE
-+ OUTPUT_STRIP_TRAILING_WHITESPACE
-+ )
-+ set(PYTHON_INSTALL_DIR ${PYTHON_USER_SITE} CACHE PATH "Install location for generated python modules.")
-+ endif()
-+
- install(
- FILES ${PROJECT_BINARY_DIR}/${generator_proto_py_file}
-- DESTINATION ${Python_SITELIB}
-+ DESTINATION ${PYTHON_INSTALL_DIR}
- )
- endforeach()
- endif()
diff --git a/external/nanopb/nanopb-init-cache.cmake.in b/external/nanopb/nanopb-init-cache.cmake.in
index fb8104d6..c53b6e5b 100644
--- a/external/nanopb/nanopb-init-cache.cmake.in
+++ b/external/nanopb/nanopb-init-cache.cmake.in
@@ -12,11 +12,18 @@ set(BUILD_STATIC_LIBS On CACHE BOOL "")
set(nanopb_BUILD_RUNTIME On CACHE BOOL "")
set(nanopb_BUILD_GENERATOR On CACHE BOOL "")
set(nanopb_MSVC_STATIC_RUNTIME Off BOOL "")
-set(nanopb_PROTOC_PATH ${CMAKE_SOURCE_DIR}/generator/protoc CACHE STRING "")
+
+# Specify location of python binary and avoid discovery.
+set(Python_EXECUTABLE "@Python_EXECUTABLE@" CACHE PATH "Location of python3 executable")
string(TOUPPER @CMAKE_CROSSCOMPILING@ CMAKE_CROSSCOMPILING) # CMake expects TRUE
if (CMAKE_CROSSCOMPILING)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY CACHE STRING "")
endif()
+# Override the install directory of the generator. TS will first look at
+# NEWLIB_INSTALL_DIR (aka. BUILD_INSTALL_DIR), then let cmake do system specific
+# search.
+set(nanopb_PYTHON_INSTDIR_OVERRIDE "@BUILD_INSTALL_DIR@/lib/python" CACHE PATH "")
+
@_cmake_fragment@
diff --git a/external/nanopb/nanopb.cmake b/external/nanopb/nanopb.cmake
index 36465f61..fa35d971 100644
--- a/external/nanopb/nanopb.cmake
+++ b/external/nanopb/nanopb.cmake
@@ -10,17 +10,14 @@ NanoPB integration for cmake
----------------------------
This module will:
- - download nanopb if not available locally
- - build the runtime static library and the generator
- - import the static library to the build
- - define a function to provide access to the generator
+ - use LazyFetch to download nanopb and build the static library and the generator.
+ Usual LazyFetch configuration to use prefetched source or prebuilt binaries apply.
+ - run find_module() to import the static library
+ - run find_executable() import the generator to the build (extend PYTHONPATH) and
+ define a cmake function to provide access to the generator to build nanopb files.
-Note: the python module created by the generator build will be installed under
-Python_SITELIB ("Third-party platform independent installation directory.")
-This means the build may alter the state of your system. Please use virtualenv.
-
-Note: see requirements.txt for dependencies which need to be installed before
-running this module.
+Note: see requirements.txt for dependencies which need to be installed in the build
+environment to use this module.
#]===]
@@ -28,7 +25,7 @@ running this module.
set(NANOPB_URL "https://github.com/nanopb/nanopb.git"
CACHE STRING "nanopb repository URL")
-set(NANOPB_REFSPEC "nanopb-0.4.2"
+set(NANOPB_REFSPEC "nanopb-0.4.7"
CACHE STRING "nanopb git refspec")
set(NANOPB_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_deps/nanopb-src"
CACHE PATH "nanopb source-code")
@@ -65,6 +62,11 @@ if(TARGET stdlib::c)
unset_saved_properties(LIBC)
endif()
+# Nanopb build depends on python. Discover python here and pass the result to
+# nanopb build trough the initial cache file.
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+# Use LazyFetch to manage the external dependency.
include(${TS_ROOT}/tools/cmake/common/LazyFetch.cmake REQUIRED)
LazyFetch_MakeAvailable(DEP_NAME nanopb
FETCH_OPTIONS ${GIT_OPTIONS}
@@ -80,12 +82,9 @@ if(TARGET stdlib::c)
endif()
#### Build access to the protobuf compiler
-#TODO: verify protoc dependencies: python3-protobuf
-find_package(Python3 REQUIRED COMPONENTS Interpreter)
-
-find_file(NANOPB_GENERATOR_PATH
+find_program(NANOPB_GENERATOR_PATH
NAMES nanopb_generator.py
- PATHS ${nanopb_SOURCE_DIR}/generator
+ HINTS ${NANOPB_INSTALL_DIR}/bin ${NANOPB_INSTALL_DIR}/sbin
DOC "nanopb protobuf compiler"
NO_DEFAULT_PATH
)
@@ -186,11 +185,10 @@ function(protobuf_generate)
target_include_directories(${PARAMS_TGT} PRIVATE ${_OUT_DIR_BASE})
endif()
- get_filename_component(NANOPB_GENERATOR_DIR "${NANOPB_GENERATOR_PATH}" DIRECTORY CACHE "Location of nanopb generator.")
#Append a protobuf generator command to the nanopb_generate target.
add_custom_command(OUTPUT "${_OUT_C}" "${_OUT_H}"
COMMAND
- ${CMAKE_COMMAND} -E env PYTHONPATH=${NANOPB_GENERATOR_DIR}
+ ${CMAKE_COMMAND} -E env PYTHONPATH=${NANOPB_INSTALL_DIR}/lib/python
${Python3_EXECUTABLE} ${NANOPB_GENERATOR_PATH}
-I ${PARAMS_BASE_DIR}
-D ${_OUT_DIR_BASE}
--
2.34.1
@@ -2,19 +2,17 @@
LICENSE = "Apache-2.0 & BSD-3-Clause & BSD-2-Clause & Zlib"
SRC_URI = "git://git.trustedfirmware.org/TS/trusted-services.git;protocol=https;branch=integration;name=trusted-services;destsuffix=git/trusted-services \
SRC_URI = "git://git.trustedfirmware.org/TS/trusted-services.git;protocol=https;branch=main;name=trusted-services;destsuffix=git/trusted-services \
"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI:append = "\
file://0001-Upgrade-nanopb-to-v0.4.7.patch \
file://0001-Add-boot-order-property-to-SP-manifests.patch \
file://0001-Allow-configuring-flash-image-files-compile-time.patch \
"
# Trusted Services; Tag: v1.0.0
SRCREV_trusted-services = "808904390eb89294d2371959a7d82dde3851ca6c"
# Trusted Services; aka. 2024 April 19
SRCREV_trusted-services = "602be607198ea784bc5ab1c0c9d3ac4e2c67f1d9"
LIC_FILES_CHKSUM = "file://${S}/license.rst;md5=ea160bac7f690a069c608516b17997f4"
S = "${WORKDIR}/git/trusted-services"
@@ -25,10 +23,10 @@ SRC_URI += "git://github.com/dgibson/dtc;name=dtc;protocol=https;branch=main;des
SRCREV_dtc = "b6910bec11614980a21e46fbccc35934b671bd81"
LIC_FILES_CHKSUM += "file://../dtc/README.license;md5=a1eb22e37f09df5b5511b8a278992d0e"
# MbedTLS, tag "mbedtls-3.4.0"
# MbedTLS, tag "v3.5.1"
SRC_URI += "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;branch=master;destsuffix=git/mbedtls"
SRCREV_mbedtls = "1873d3bfc2da771672bd8e7e8f41f57e0af77f33"
LIC_FILES_CHKSUM += "file://../mbedtls/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
SRCREV_mbedtls = "15254759342494c7e969766d5424d78d7deb9bfa"
LIC_FILES_CHKSUM += "file://../mbedtls/LICENSE;md5=379d5819937a6c2f1ef1630d341e026d"
# Nanopb, tag "nanopb-0.4.7" plus some further fixes
SRC_URI += "git://github.com/nanopb/nanopb.git;name=nanopb;protocol=https;branch=master;destsuffix=git/nanopb"
@@ -7,7 +7,7 @@ require trusted-services.inc
SRC_URI += "git://sourceware.org/git/newlib-cygwin.git;name=newlib;protocol=https;branch=master;destsuffix=git/newlib \
"
# tag "newlib-0.4.1"
# tag "newlib-4.1.0"
SRCREV_newlib = "415fdd4279b85eeec9d54775ce13c5c412451e08"
LIC_FILES_CHKSUM += "file://../newlib/COPYING.NEWLIB;md5=b8dda70da54e0efb49b1074f349d7749"