From 93eecae0c338ba923347b647e0b7713081f61b64 Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Thu, 17 Nov 2022 09:17:41 +0100 Subject: Add sgid notice when running on AFS (#30247) --- lib/spack/spack/package_prefs.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3-60-g2f50