-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Modules: /opt/homebrew should be in list of system paths on macOS - or not? #39046
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Steps to reproduce
On macOS, specifically on the M1 architecture, /opt/homebrew should be in the system paths:
diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py
index da6832e4dd..8d60f108e8 100644
--- a/lib/spack/spack/util/environment.py
+++ b/lib/spack/spack/util/environment.py
@@ -36,7 +36,7 @@
]
SUFFIXES = []
else:
- SYSTEM_PATHS = ["/", "/usr", "/usr/local"]
+ SYSTEM_PATHS = ["/", "/usr", "/usr/local", "/opt/homebrew"]
SUFFIXES = ["bin", "bin64", "include", "lib", "lib64"]
SYSTEM_DIRS = [os.path.join(p, s) for s in SUFFIXES for p in SYSTEM_PATHS] + SYSTEM_PATHS
The reason is that if you have things like git-lfs, mysql installed there (which are a nightmare to build on macOS in spack), then the current spack develop code puts the path /opt/homebrew/bin in front of other paths when the spack-generated modules are loaded. If one has a python3 in /opt/homebrew/bin, then suddenly that python3 gets found again, even though the spack python3 module was loaded (first). The above change fixes that.
Error message
See description above
Information on your system
* **Spack:** 0.21.0.dev0 (98957cf32aa809e831bee4af2bf642e2bd038c04)
* **Python:** 3.8.9
* **Platform:** darwin-monterey-m1
* **Concretizer:** clingo
General information
- I have run
spack debug reportand reported the version of Spack/Python/Platform - I have searched the issues of this repo and believe this is not a duplicate
- I have run the failing commands in debug mode and reported the output
Reactions are currently unavailable