Skip to content

Commit

Permalink
cheribsd: Set MAKEOBJDIRPREFIX earlier
Browse files Browse the repository at this point in the history
This removes the need for the _query_make_var hack added in b773e41
("freebsd: Fix wrong cached objdir for --freebsd/toolchain=bootstrap").

This partially reverts commit b773e41.
  • Loading branch information
jrtc27 committed Jul 18, 2024
1 parent 35243bf commit 4a4ebef
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pycheribuild/projects/cross/cheribsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,16 @@ def check_system_dependencies(self) -> None:
if not OSInfo.IS_FREEBSD:
self.check_required_pkg_config("libarchive", apt="libarchive-dev", zypper="libarchive-devel")

def setup(self) -> None:
super().setup()
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
# Needed pre-setup for _query_make_var() (e.g. via objdir)
self.make_args.set_env(MAKEOBJDIRPREFIX=str(self.build_dir))
# TODO? Avoid lots of nested child directories by using MAKEOBJDIR instead of MAKEOBJDIRPREFIX
# self.make_args.set_env(MAKEOBJDIR=str(self.build_dir))

def setup(self) -> None:
super().setup()

if self.crossbuild:
# Use the script that I added for building on Linux/MacOS:
self.make_args.set_command(
Expand Down Expand Up @@ -1352,11 +1356,6 @@ def _query_make_var(self, args, var) -> Optional[Path]:
return None
query_args = args.copy()
query_args.set_command(bmake_binary)
# --freebsd/toolchain=bootstrap ends up here before its setup has
# initialised the environment, so make sure that's correct when
# querying .OBJDIR lest the wrong value be cached.
if "MAKEOBJDIRPREFIX" not in query_args.env_vars:
query_args.set_env(MAKEOBJDIRPREFIX=str(self.build_dir))
bw_flags = [
*query_args.all_commandline_args(self.config),
"BUILD_WITH_STRICT_TMPPATH=0",
Expand Down

0 comments on commit 4a4ebef

Please sign in to comment.