From 72b980062daae64bcb0ad43c2c02a0f048c7a5db Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Thu, 25 Apr 2024 11:56:25 +0200 Subject: [PATCH 1/5] Update framework submodule Signed-off-by: Ronald Cron --- framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework b/framework index 750634d3a5..a627342536 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 750634d3a51eb9d61b59fd5d801546927c946588 +Subproject commit a627342536a9a9b7da1ff651821be264d86fff51 From 1e05debd607124c301f78fe772c6da78fc837f25 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Thu, 25 Apr 2024 12:24:00 +0200 Subject: [PATCH 2/5] Extend basic checks of files to framework files Signed-off-by: Ronald Cron --- tests/scripts/check_files.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/scripts/check_files.py b/tests/scripts/check_files.py index d5a4b921e4..ea86439fbf 100755 --- a/tests/scripts/check_files.py +++ b/tests/scripts/check_files.py @@ -373,7 +373,7 @@ class LicenseIssueTracker(LineIssueTracker): r'3rdparty/(?!(p256-m)/.*)', # Documentation explaining the license may have accidental # false positives. - r'(ChangeLog|LICENSE|[-0-9A-Z_a-z]+\.md)\Z', + r'(ChangeLog|LICENSE|framework\/LICENSE|[-0-9A-Z_a-z]+\.md)\Z', # Files imported from TF-M, and not used except in test builds, # may be under a different license. r'configs/ext/crypto_config_profile_medium\.h\Z', @@ -381,6 +381,7 @@ class LicenseIssueTracker(LineIssueTracker): r'configs/ext/README\.md\Z', # Third-party file. r'dco\.txt\Z', + r'framework\/dco\.txt\Z', ] path_exemptions = re.compile('|'.join(BINARY_FILE_PATH_RE_LIST + LICENSE_EXEMPTION_RE_LIST)) @@ -486,7 +487,8 @@ class IntegrityChecker: These are the regular files commited into Git. """ - bytes_output = subprocess.check_output(['git', 'ls-files', '-z']) + bytes_output = subprocess.check_output(['git', 'ls-files', + '--recurse-submodules', '-z']) bytes_filepaths = bytes_output.split(b'\0')[:-1] ascii_filepaths = map(lambda fp: fp.decode('ascii'), bytes_filepaths) # Filter out directories. Normally Git doesn't list directories From 62a908d8694cc438606f0bf59c14c6fd43b226aa Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Thu, 25 Apr 2024 15:46:01 +0200 Subject: [PATCH 3/5] Extend C code style check to framework files Signed-off-by: Ronald Cron --- scripts/code_style.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/scripts/code_style.py b/scripts/code_style.py index 07952b6cb5..9e3c75142a 100755 --- a/scripts/code_style.py +++ b/scripts/code_style.py @@ -75,16 +75,37 @@ def get_src_files(since: Optional[str]) -> List[str]: output = subprocess.check_output(["git", "ls-files"] + file_patterns, universal_newlines=True) src_files = output.split() + output = subprocess.check_output(["git", "-C", "framework", "ls-files"] + + file_patterns, universal_newlines=True) + framework_src_files = output.split() + if since: - # get all files changed in commits since the starting point - cmd = ["git", "log", since + "..HEAD", "--name-only", "--pretty=", "--"] + src_files + # get all files changed in commits since the starting point in ... + # ... the main repository + cmd = ["git", "log", since + "..HEAD", "--ignore-submodules", + "--name-only", "--pretty=", "--"] + src_files output = subprocess.check_output(cmd, universal_newlines=True) committed_changed_files = output.split() - # and also get all files with uncommitted changes + # ... the framework submodule + cmd = ["git", "-C", "framework", "log", since + "..HEAD", + "--name-only", "--pretty=", "--"] + framework_src_files + output = subprocess.check_output(cmd, universal_newlines=True) + committed_changed_files += ["framework/" + s for s in output.split()] + + # and also get all files with uncommitted changes in ... + # ... the main repository cmd = ["git", "diff", "--name-only", "--"] + src_files output = subprocess.check_output(cmd, universal_newlines=True) uncommitted_changed_files = output.split() - src_files = list(set(committed_changed_files + uncommitted_changed_files)) + # ... the framework submodule + cmd = ["git", "-C", "framework", "diff", "--name-only", "--"] + \ + framework_src_files + output = subprocess.check_output(cmd, universal_newlines=True) + uncommitted_changed_files += ["framework/" + s for s in output.split()] + + src_files = committed_changed_files + uncommitted_changed_files + else: + src_files += ["framework/" + s for s in framework_src_files] generated_files = list_generated_files() # Don't correct style for third-party files (and, for simplicity, From 7661aa0e204eed21e6408bd1a6acdd9a1c571535 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 3 May 2024 10:12:01 +0200 Subject: [PATCH 4/5] Do not use --recurse-submodules On the CI, the git version when running on Ubuntu 16.04 is 2.7 and it does not support the "--recurse-submodules" option of "git ls-files" thus do not use it. Another argument to not use it is that when TF-PSA-Crypto will be a submodule of mbedtls we will not want check_files.py to check the TF-PSA-Crypto files as well. Signed-off-by: Ronald Cron --- tests/scripts/check_files.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/scripts/check_files.py b/tests/scripts/check_files.py index ea86439fbf..cbef4e9ed8 100755 --- a/tests/scripts/check_files.py +++ b/tests/scripts/check_files.py @@ -487,10 +487,17 @@ class IntegrityChecker: These are the regular files commited into Git. """ - bytes_output = subprocess.check_output(['git', 'ls-files', - '--recurse-submodules', '-z']) - bytes_filepaths = bytes_output.split(b'\0')[:-1] + bytes_output = subprocess.check_output(['git', '-C', 'framework', + 'ls-files', '-z']) + bytes_framework_filepaths = bytes_output.split(b'\0')[:-1] + bytes_framework_filepaths = ["framework/".encode() + filepath + for filepath in bytes_framework_filepaths] + + bytes_output = subprocess.check_output(['git', 'ls-files', '-z']) + bytes_filepaths = bytes_output.split(b'\0')[:-1] + \ + bytes_framework_filepaths ascii_filepaths = map(lambda fp: fp.decode('ascii'), bytes_filepaths) + # Filter out directories. Normally Git doesn't list directories # (it only knows about the files inside them), but there is # at least one case where 'git ls-files' includes a directory: From 680bee45ca18a8607f7ca8dd8d7a523c64479261 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 28 May 2024 18:33:42 +0200 Subject: [PATCH 5/5] Update framework submodule to the merge of PR #15 Signed-off-by: Ronald Cron --- framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework b/framework index a627342536..e156a8eb8e 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit a627342536a9a9b7da1ff651821be264d86fff51 +Subproject commit e156a8eb8e6db88cdf0a3041fc7f645131eab16d