From 92dbb55703c697866ccbea6ccadf6e1d8ae40152 Mon Sep 17 00:00:00 2001 From: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:58:18 -0600 Subject: [PATCH] Mkae Autotools build_system point at correct build_directory (#48072) --- lib/spack/spack/build_systems/autotools.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 0fe8e34089f..433acebae01 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -182,10 +182,7 @@ def patch_config_files(self) -> bool: @property def _removed_la_files_log(self) -> str: """File containing the list of removed libtool archives""" - build_dir = self.build_directory - if not os.path.isabs(self.build_directory): - build_dir = os.path.join(self.pkg.stage.path, build_dir) - return os.path.join(build_dir, "removed_la_files.txt") + return os.path.join(self.build_directory, "removed_la_files.txt") @property def archive_files(self) -> List[str]: @@ -523,7 +520,12 @@ def configure_abs_path(self) -> str: @property def build_directory(self) -> str: """Override to provide another place to build the package""" - return self.configure_directory + # Handle the case where the configure directory is set to a non-absolute path + # Non-absolute paths are always relative to the staging source path + build_dir = self.configure_directory + if not os.path.isabs(build_dir): + build_dir = os.path.join(self.pkg.stage.source_path, build_dir) + return build_dir @spack.phase_callbacks.run_before("autoreconf") def delete_configure_to_force_update(self) -> None: