summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@ovgu.de>2022-11-17 09:17:41 +0100
committerGitHub <noreply@github.com>2022-11-17 09:17:41 +0100
commit93eecae0c338ba923347b647e0b7713081f61b64 (patch)
tree3fa2147a0394549460966cf29086d3c6debe8fdd /lib
parent61f5d85525962b551e0a07bdbb79597bdb9db1e6 (diff)
downloadspack-93eecae0c338ba923347b647e0b7713081f61b64.tar.gz
spack-93eecae0c338ba923347b647e0b7713081f61b64.tar.bz2
spack-93eecae0c338ba923347b647e0b7713081f61b64.tar.xz
spack-93eecae0c338ba923347b647e0b7713081f61b64.zip
Add sgid notice when running on AFS (#30247)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package_prefs.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/spack/spack/package_prefs.py b/lib/spack/spack/package_prefs.py
index 79beaba492..c52642516c 100644
--- a/lib/spack/spack/package_prefs.py
+++ b/lib/spack/spack/package_prefs.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import stat
+import warnings
import spack.error
import spack.repo
@@ -221,6 +222,12 @@ def get_package_dir_permissions(spec):
perms = get_package_permissions(spec)
if perms & stat.S_IRWXG and spack.config.get("config:allow_sgid", True):
perms |= stat.S_ISGID
+ if spec.concrete and "/afs/" in spec.prefix:
+ warnings.warn(
+ "Directory {0} seems to be located on AFS. If you"
+ " encounter errors, try disabling the allow_sgid option"
+ " using: spack config add 'config:allow_sgid:false'".format(spec.prefix)
+ )
return perms