From 60d104d0e9da387c32735d1643380e33a5911188 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Thu, 22 Oct 2026 20:40:09 +0200 Subject: [PATCH] oneapi: Fix installer deleting files/directories of other packages The installer uses `/tmp/` as a temporary directory and deletes files/directories below it. When doing parallel builds, it sometimes deletes files/directories belonging to other package builds, breaking them in the process. --- repos/spack_repo/builtin/build_systems/oneapi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/repos/spack_repo/builtin/build_systems/oneapi.py b/repos/spack_repo/builtin/build_systems/oneapi.py index f46aed69e50..6aa07162890 100644 --- a/repos/spack_repo/builtin/build_systems/oneapi.py +++ b/repos/spack_repo/builtin/build_systems/oneapi.py @@ -121,6 +121,13 @@ def install_component(self, installer_path): 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")) + # Installer uses /tmp/ as a temporary directory and deletes + # files/directories below it. When doing parallel builds, it sometimes + # deletes files/directories belonging to other package builds, breaking + # them in the process. TMPDIR has to exist if set explicitly. + installer_tmp = join_path(self.stage.path, "tmp") + mkdirp(installer_tmp) + bash.add_default_env("TMPDIR", installer_tmp) bash( installer_path,