From 6085586407c8458ee57c7aa4748c5fc14dc25c33 Mon Sep 17 00:00:00 2001 From: Stephen Nicholas Swatman Date: Tue, 22 Apr 2025 17:47:30 +0200 Subject: [PATCH] oneapi: Move temporary home directory to stage (#50160) When trying to use Spack to build Intel TBB on the EOS network file system we use at CERN, I am facing the following error: ``` Launching the installer... Installation directory is not empty. The product cannot be installed into nonempty directory '/eos/home-s/sswatman/spack/opt/spack/linux-x86_64_v2/... intel-oneapi-tbb-2021.12.0-3jlx6hlr3z6di42f3qy35eizcse7u2tk'. ``` This error appears to happen because Spack tries to set `$HOME` to the prefix of the package, into which the Intel installer is also trying to install it's software. I've found that an easy fix is to set `$HOME` to a directory in the build stage instead, as this can be guaranteed to remain empty. --- lib/spack/spack/build_systems/oneapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py index d107a395e27..b8be05d9795 100644 --- a/lib/spack/spack/build_systems/oneapi.py +++ b/lib/spack/spack/build_systems/oneapi.py @@ -106,8 +106,8 @@ def install_component(self, installer_path): bash = Executable("bash") - # Installer writes files in ~/intel set HOME so it goes to prefix - bash.add_default_env("HOME", self.prefix) + # Installer writes files in ~/intel set HOME so it goes to staging directory + bash.add_default_env("HOME", join_path(self.stage.path, "home")) # Installer checks $XDG_RUNTIME_DIR/.bootstrapper_lock_file as well bash.add_default_env("XDG_RUNTIME_DIR", join_path(self.stage.path, "runtime"))