From f643e97acacfb0c0d77fcbc90e4a54ae183f9d1a Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 9 Aug 2023 16:23:22 -0700 Subject: [PATCH] Jenkins: Work around autotools/CMake adding /usr with prefix=/ This is used by e.g. LLVM jobs to install directly to tarball/ without any additional subdirectories, but the latest refactoring broke this. --- pycheribuild/jenkins.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pycheribuild/jenkins.py b/pycheribuild/jenkins.py index 271ac110e..c9b021cad 100644 --- a/pycheribuild/jenkins.py +++ b/pycheribuild/jenkins.py @@ -271,8 +271,14 @@ def _jenkins_main() -> None: # noinspection PyProtectedMember project = target._get_or_create_project_no_setup(None, cheri_config, caller=None) if isinstance(project, Project): - project._install_prefix = cheri_config.installation_prefix - project.destdir = cheri_config.output_root + # Using "/" as the install prefix results inconsistently prefixing some paths with '/usr/'. + # To avoid this, just use the full install path as the prefix. + if cheri_config.installation_prefix == Path("/"): + project._install_prefix = expected_install_path + project.destdir = None + else: + project._install_prefix = cheri_config.installation_prefix + project.destdir = cheri_config.output_root assert project.real_install_root_dir == expected_install_path for tgt in cheri_config.targets: build_target(cheri_config, target_manager.get_target_raw(tgt))