diff --git a/pycheribuild/config/jenkinsconfig.py b/pycheribuild/config/jenkinsconfig.py index 692d6f372..228fca28a 100644 --- a/pycheribuild/config/jenkinsconfig.py +++ b/pycheribuild/config/jenkinsconfig.py @@ -133,6 +133,10 @@ def __init__(self, loader: ConfigLoaderBase, available_targets: "list[str]") -> ), help="The path where to extract the sysroot (default=", ) + self.sysroot_extra_archive_names = loader.add_commandline_only_list_option( + "sysroot-extra-archives", + help="Addition archives to extract within the sysroot", + ) self.keep_install_dir = loader.add_commandline_only_bool_option( "keep-install-dir", help="Don't delete the install dir prior to build" ) diff --git a/pycheribuild/jenkins.py b/pycheribuild/jenkins.py index 31809916b..9a1364b57 100644 --- a/pycheribuild/jenkins.py +++ b/pycheribuild/jenkins.py @@ -168,6 +168,17 @@ def get_sdk_archives(cheri_config, needs_cheribsd_sysroot: bool) -> "list[SdkArc if contents.stdout.startswith(b"./"): warning_message("Old sysroot archive detected, stripping one more path component") sysroot_archive.extra_args = ["--strip-components", "2"] + for extra_name in cheri_config.sysroot_extra_archive_names: + extra_path = Path(extra_name) + extra_archive = SdkArchive( + cheri_config, + extra_path, + output_dir=cheri_config.sysroot_archive_output_path, + ) + if not extra_archive.archive.exists(): + fatal_error("Extra archive", extra_archive.archive, "does not exist", pretend=cheri_config.pretend) + else: + all_archives.append(extra_archive) return all_archives