Skip to content

Commit

Permalink
{freebsd,cheribsd}-release: Always inherit build-directory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrtc27 committed May 15, 2024
1 parent 7a08b60 commit afea91f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pycheribuild/projects/cross/cheribsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
MakeCommandKind,
MakeOptions,
Project,
ReuseOtherProjectBuildDir,
ReuseOtherProjectRepository,
)
from ..simple_project import SimpleProject, TargetAliasWithDependencies, _clear_line_sequence, flush_stdio
Expand All @@ -72,11 +73,6 @@ def inner(config: CheriConfig, project: Project):
return ComputedDefaultValue(function=inner, as_string="$INSTALL_ROOT/" + prefix + "-<arch>")


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)
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit afea91f

Please sign in to comment.