summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/spack/defaults/config.yaml4
-rw-r--r--lib/spack/spack/package_prefs.py2
-rw-r--r--lib/spack/spack/schema/config.py1
3 files changed, 6 insertions, 1 deletions
diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml
index cc51060eae..4e4b48296c 100644
--- a/etc/spack/defaults/config.yaml
+++ b/etc/spack/defaults/config.yaml
@@ -157,3 +157,7 @@ config:
# Has no effect on macOS. DO NOT MIX these within the same install tree.
# See the Spack documentation for details.
shared_linking: 'rpath'
+
+ # Set to 'false' to allow installation on filesystems that doesn't allow setgid bit
+ # manipulation by unprivileged user (e.g. AFS)
+ config:allow_sgid: true
diff --git a/lib/spack/spack/package_prefs.py b/lib/spack/spack/package_prefs.py
index 0158c7063a..aa904a0792 100644
--- a/lib/spack/spack/package_prefs.py
+++ b/lib/spack/spack/package_prefs.py
@@ -204,7 +204,7 @@ def get_package_dir_permissions(spec):
attribute sticky for the directory. Package-specific settings take
precedent over settings for ``all``"""
perms = get_package_permissions(spec)
- if perms & stat.S_IRWXG:
+ if perms & stat.S_IRWXG and spack.config.get('config:allow_sgid', True):
perms |= stat.S_ISGID
return perms
diff --git a/lib/spack/spack/schema/config.py b/lib/spack/spack/schema/config.py
index a05af2f438..d56321d09c 100644
--- a/lib/spack/spack/schema/config.py
+++ b/lib/spack/spack/schema/config.py
@@ -73,6 +73,7 @@ properties = {
{'type': 'null'}
],
},
+ 'allow_sgid': {'type': 'boolean'},
},
},
}