From 151c55178151865530c5624386fbd926f4eee0f4 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sun, 13 Aug 2023 20:47:47 -0500 Subject: Python: fix Apple Clang +optimizations build (#39412) --- var/spack/repos/builtin/packages/python/package.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index ab8e6f310f..73ed03e282 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -308,7 +308,7 @@ class Python(Package): conflicts("%nvhpc") # https://bugs.python.org/issue45405 - conflicts("@:3.7.2,3.8.0:3.8.12,3.9.0:3.9.10,3.10.0:3.10.2", when="%apple-clang@13:") + conflicts("@:3.7.12,3.8.0:3.8.12,3.9.0:3.9.7,3.10.0", when="%apple-clang@13:") # See https://github.com/python/cpython/issues/106424 # datetime.now(timezone.utc) segfaults @@ -435,6 +435,11 @@ class Python(Package): if spec.satisfies("%gcc") or spec.satisfies("%fj"): env.unset("LC_ALL") + # https://github.com/python/cpython/issues/87275 + if spec.satisfies("@:3.9.5 +optimizations %apple-clang"): + xcrun = Executable("/usr/bin/xcrun") + env.set("LLVM_AR", xcrun("-find", "ar", output=str).strip()) + def flag_handler(self, name, flags): # python 3.8 requires -fwrapv when compiled with intel if self.spec.satisfies("@3.8: %intel"): -- cgit v1.2.3-60-g2f50