Skip to content

Commit 4a4ebef

Browse files
committed
cheribsd: Set MAKEOBJDIRPREFIX earlier
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.
1 parent 35243bf commit 4a4ebef

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

pycheribuild/projects/cross/cheribsd.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,16 @@ def check_system_dependencies(self) -> None:
523523
if not OSInfo.IS_FREEBSD:
524524
self.check_required_pkg_config("libarchive", apt="libarchive-dev", zypper="libarchive-devel")
525525

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

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

0 commit comments

Comments
 (0)