From afea91fcaae4417835ed27bd3d5c84baec5c5c3f Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Wed, 15 May 2024 20:55:41 +0100 Subject: [PATCH] {freebsd,cheribsd}-release: Always inherit build-directory Using the default build directory if the dependent project's has been overridden doesn't make sense, since that's the project we want to build release images from. I don't know why cheribsd-mfs-root-kernel only uses the default and has that asserted by a test case, I can't see the logic behind that being the expected behaviour, but at least that one does work either way round, so is left as is. --- pycheribuild/projects/cross/cheribsd.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pycheribuild/projects/cross/cheribsd.py b/pycheribuild/projects/cross/cheribsd.py index 9ae563af8..d25e7caba 100644 --- a/pycheribuild/projects/cross/cheribsd.py +++ b/pycheribuild/projects/cross/cheribsd.py @@ -51,6 +51,7 @@ MakeCommandKind, MakeOptions, Project, + ReuseOtherProjectBuildDir, ReuseOtherProjectRepository, ) from ..simple_project import SimpleProject, TargetAliasWithDependencies, _clear_line_sequence, flush_stdio @@ -72,11 +73,6 @@ def inner(config: CheriConfig, project: Project): return ComputedDefaultValue(function=inner, as_string="$INSTALL_ROOT/" + prefix + "-") -def freebsd_reuse_build_dir(config: CheriConfig, project: "SimpleProject") -> Path: - build_freebsd = BuildFreeBSD.get_instance(project, config) - return build_freebsd.default_build_dir(config, build_freebsd) - - def cheribsd_reuse_build_dir(config: CheriConfig, project: "SimpleProject") -> Path: build_cheribsd = BuildCHERIBSD.get_instance(project, config) return build_cheribsd.default_build_dir(config, build_cheribsd) @@ -2247,9 +2243,7 @@ class BuildFreeBSDRelease(BuildFreeBSDReleaseMixin, BuildFreeBSD): dependencies: "tuple[str, ...]" = ("freebsd",) repository: ReuseOtherProjectRepository = ReuseOtherProjectRepository(source_project=BuildFreeBSD) _always_add_suffixed_targets: bool = True - default_build_dir: ComputedDefaultValue[Path] = ComputedDefaultValue( - function=freebsd_reuse_build_dir, as_string=lambda cls: BuildFreeBSD.project_build_dir_help() - ) + _build_dir: ReuseOtherProjectBuildDir = ReuseOtherProjectBuildDir(build_project=BuildFreeBSD) _default_install_dir_fn: ComputedDefaultValue[Path] = _arch_suffixed_custom_install_dir("freebsd-release") # We want the FreeBSD config options as well so the release installworld, # distributeworld etc. calls match what was built. @@ -2261,9 +2255,7 @@ class BuildCheriBSDRelease(BuildFreeBSDReleaseMixin, BuildCHERIBSD): dependencies: "tuple[str, ...]" = ("cheribsd",) repository: ReuseOtherProjectRepository = ReuseOtherProjectRepository(source_project=BuildCHERIBSD) _always_add_suffixed_targets: bool = True - default_build_dir: ComputedDefaultValue[Path] = ComputedDefaultValue( - function=cheribsd_reuse_build_dir, as_string=lambda cls: BuildCHERIBSD.project_build_dir_help() - ) + _build_dir: ReuseOtherProjectBuildDir = ReuseOtherProjectBuildDir(build_project=BuildCHERIBSD) _default_install_dir_fn: ComputedDefaultValue[Path] = _arch_suffixed_custom_install_dir("cheribsd-release") # We want the CheriBSD config options as well so the release installworld, # distributeworld etc. calls match what was built.