Skip to content

Commit 1fc71a3

Browse files
committed
Remove dead code related to the old crypto submodule
Signed-off-by: Bence Szépkúti <[email protected]>
1 parent 499a9be commit 1fc71a3

File tree

1 file changed

+2
-47
lines changed

1 file changed

+2
-47
lines changed

scripts/mbedtls_framework/abi_check.py

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,8 @@ def _get_clean_worktree_for_git_revision(self, version):
193193
return git_worktree_path
194194

195195
def _update_git_submodules(self, git_worktree_path, version):
196-
"""If the crypto submodule is present, initialize it.
197-
if version.crypto_revision exists, update it to that revision,
198-
otherwise update it to the default revision"""
196+
"""Recursively checkout all submodules at the revision recorded in their
197+
parent module"""
199198
submodule_output = subprocess.check_output(
200199
[self.git_command, "submodule", "foreach", "--recursive",
201200
f'git worktree add --detach "{git_worktree_path}/$displaypath" HEAD'],
@@ -209,36 +208,12 @@ def _update_git_submodules(self, git_worktree_path, version):
209208
stderr=subprocess.STDOUT
210209
)
211210
self.log.debug(update_output.decode("utf-8"))
212-
if not (os.path.exists(os.path.join(git_worktree_path, "crypto"))
213-
and version.crypto_revision):
214-
return
215-
216-
if version.crypto_repository:
217-
fetch_output = subprocess.check_output(
218-
[self.git_command, "fetch", version.crypto_repository,
219-
version.crypto_revision],
220-
cwd=os.path.join(git_worktree_path, "crypto"),
221-
stderr=subprocess.STDOUT
222-
)
223-
self.log.debug(fetch_output.decode("utf-8"))
224-
crypto_rev = "FETCH_HEAD"
225-
else:
226-
crypto_rev = version.crypto_revision
227-
228-
checkout_output = subprocess.check_output(
229-
[self.git_command, "checkout", crypto_rev],
230-
cwd=os.path.join(git_worktree_path, "crypto"),
231-
stderr=subprocess.STDOUT
232-
)
233-
self.log.debug(checkout_output.decode("utf-8"))
234211

235212
def _build_shared_libraries(self, git_worktree_path, version):
236213
"""Build the shared libraries in the specified worktree."""
237214
my_environment = os.environ.copy()
238215
my_environment["CFLAGS"] = "-g -Og"
239216
my_environment["SHARED"] = "1"
240-
if os.path.exists(os.path.join(git_worktree_path, "crypto")):
241-
my_environment["USE_CRYPTO_SUBMODULE"] = "1"
242217

243218
if os.path.exists(os.path.join(git_worktree_path, "scripts", "legacy.make")):
244219
command = [self.make_command, "-f", "scripts/legacy.make", "lib"]
@@ -595,29 +570,13 @@ def run_main():
595570
parser.add_argument(
596571
"-or", "--old-repo", type=str, help="repository for old version."
597572
)
598-
parser.add_argument(
599-
"-oc", "--old-crypto-rev", type=str,
600-
help="revision for old crypto submodule."
601-
)
602-
parser.add_argument(
603-
"-ocr", "--old-crypto-repo", type=str,
604-
help="repository for old crypto submodule."
605-
)
606573
parser.add_argument(
607574
"-n", "--new-rev", type=str, help="revision for new version",
608575
required=True,
609576
)
610577
parser.add_argument(
611578
"-nr", "--new-repo", type=str, help="repository for new version."
612579
)
613-
parser.add_argument(
614-
"-nc", "--new-crypto-rev", type=str,
615-
help="revision for new crypto version"
616-
)
617-
parser.add_argument(
618-
"-ncr", "--new-crypto-repo", type=str,
619-
help="repository for new crypto submodule."
620-
)
621580
parser.add_argument(
622581
"-s", "--skip-file", type=str,
623582
help=("path to file containing symbols and types to skip "
@@ -654,8 +613,6 @@ def run_main():
654613
repository=abi_args.old_repo,
655614
revision=abi_args.old_rev,
656615
commit=None,
657-
crypto_repository=abi_args.old_crypto_repo,
658-
crypto_revision=abi_args.old_crypto_rev,
659616
abi_dumps={},
660617
storage_tests={},
661618
modules={}
@@ -665,8 +622,6 @@ def run_main():
665622
repository=abi_args.new_repo,
666623
revision=abi_args.new_rev,
667624
commit=None,
668-
crypto_repository=abi_args.new_crypto_repo,
669-
crypto_revision=abi_args.new_crypto_rev,
670625
abi_dumps={},
671626
storage_tests={},
672627
modules={}

0 commit comments

Comments
 (0)