From 368bf2d69c2fbb1b092ebe48b557027c453db9d2 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 20 Aug 2019 14:52:53 -0700 Subject: stage: avoid using group name in _first_accessible_path() On machines where $TMP is owned by a gid with no name, this avoids the following error when the default spack stage does not exist: (spackbook):spack$ spack clean ==> Removing all temporary build stages ==> Error: 'getgrgid(): gid not found: 57095' Spack needs to deal with gids directly unless users pass them in. --- lib/spack/spack/stage.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 5dc2a8ddfc..3410e8b63e 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import grp import os import stat import sys @@ -56,8 +55,8 @@ def _first_accessible_path(paths): if not os.path.exists(prefix): break parent = os.path.dirname(prefix) - group = grp.getgrgid(os.stat(parent).st_gid)[0] - mkdirp(path, group=group, default_perms='parents') + gid = os.stat(parent).st_gid + mkdirp(path, group=gid, default_perms='parents') if can_access(path): return path -- cgit v1.2.3-60-g2f50