From 6fa7d8b6a69a1763001b52a430e843328c3eec90 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Thu, 18 Jan 2024 18:33:14 -0500 Subject: [PATCH] Skip sbang hook on Windows (#42156) Sbangs don't exist on Native Windows, and the hook is causing errors due to the file comparison + behavior of os.rename on Windows. Skip the hook on Windows. --- lib/spack/spack/hooks/sbang.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/spack/spack/hooks/sbang.py b/lib/spack/spack/hooks/sbang.py index fa100dc6afe..83968603d59 100644 --- a/lib/spack/spack/hooks/sbang.py +++ b/lib/spack/spack/hooks/sbang.py @@ -229,6 +229,8 @@ def post_install(spec, explicit=None): $spack_prefix/bin/sbang instead of something longer than the shebang limit. """ + if sys.platform == "win32": + return if spec.external: tty.debug("SKIP: shebang filtering [external package]") return