Repository: spack/spack

Issue:
Installation issue: util-linux-uuid
Hello again!

I'm running into trouble trying to build python on a cluster I use. One of the dependencies `util-linux-uuid` is trying to install in a directory that require root permission. @adamjstewart or other spack devs, are there some flags that I can pass to get it to install somewhere else? (I have also tried this python@3.8.7 and gotten the same error).

Thanks!

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install python@3.9.0%gcc@10.2.0
...
==> Installing util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy
==> No binary for util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy found: installing from source
==> Using cached archive: /mnt/home/jsmith/apps/spack/var/spack/cache/_source-cache/archive/82/82942cd877a989f6d12d4ce2c757fb67ec53d8c5cd9af0537141ec5f84a2eea3.tar.gz
==> util-linux-uuid: Executing phase: 'autoreconf'
==> util-linux-uuid: Executing phase: 'configure'
==> util-linux-uuid: Executing phase: 'build'
==> util-linux-uuid: Executing phase: 'install'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j16' 'install'

5 errors found in build log:
     643     /usr/bin/mkdir -p '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/share/man/man5'
     644     /usr/bin/mkdir -p '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/share/man/man8'
     645     /usr/bin/install -c -m 644 bash-completion/uuidgen '/usr/share/bash-completion/completions'
     646     /usr/bin/mkdir -p '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/lib/pkgconfig'
     647     /usr/bin/mkdir -p '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/include/uuid'
     648     /usr/bin/mkdir -p '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/lib'
  >> 649    /usr/bin/install: cannot remove '/usr/share/bash-completion/completions/uuidgen': Permission denied
  >> 650    make[3]: *** [install-dist_bashcompletionDATA] Error 1
     651    make[3]: *** Waiting for unfinished jobs....
     652     /bin/sh ./libtool   --mode=install /usr/bin/install -c   libuuid.la '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/lib'
     653     /usr/bin/install -c -m 644 libuuid/uuid.pc '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/lib/pkgconfig'
     654     /usr/bin/install -c -m 644 libuuid/src/uuid.h '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/include/uuid'
     655     /usr/bin/install -c -m 644 libuuid/man/uuid.3 libuuid/man/uuid_clear.3 libuuid/man/uuid_compare.3 libuuid/man/uuid_copy.3 libuuid/man/uuid_generate.3 libuuid/man/uuid_is_null.3 libuuid/man/uuid_p
            arse.3 libuuid/man/uuid_time.3 libuuid/man/uuid_unparse.3 libuuid/man/uuid_generate_random.3 libuuid/man/uuid_generate_time.3 libuuid/man/uuid_generate_time_safe.3 '/mnt/home/jsmith/apps/spack/opt
            /spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/share/man/man3'
     656     /usr/bin/install -c -m 644 lib/terminal-colors.d.5 '/mnt/home/jsmith/apps/spack/opt/spack/linux-centos7-zen2/gcc-10.2.0/util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/share/man/man5'

     ...

     678       - have your system administrator add LIBDIR to '/etc/ld.so.conf'
     679
     680    See any operating system documentation about shared libraries for
     681    more information, such as the ld(1) and ld.so(8) manual pages.
     682    ----------------------------------------------------------------------
     683    make[3]: Leaving directory `/tmp/jsmith/spack-stage/spack-stage-util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/spack-src'
  >> 684    make[2]: *** [install-am] Error 2
     685    make[2]: Leaving directory `/tmp/jsmith/spack-stage/spack-stage-util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/spack-src'
  >> 686    make[1]: *** [install-recursive] Error 1
     687    make[1]: Leaving directory `/tmp/jsmith/spack-stage/spack-stage-util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/spack-src'
  >> 688    make: *** [install] Error 2

See build log for details:
  /tmp/jsmith/spack-stage/spack-stage-util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy/spack-build-out.txt

==> Warning: Skipping build of python-3.9.0-vwvts7ettp2mx5s2kpi6ivvikvw2zpi6 since util-linux-uuid-2.36-nnpr5umpmkxnf5trps6vooajkhgbrspy failed
...
```

### Information on your system

```
* **Spack:** 0.16.0-576-03f6717
* **Python:** 3.6.8
* **Platform:** linux-centos7-zen2
* **Concretizer:** original
```

### Additional information
* [spack-build-out.txt](https://github.com/spack/spack/files/5823711/spack-build-out.txt)
* [spack-build-env.txt](https://github.com/spack/spack/files/5823712/spack-build-env.txt)


### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
@michaelkuhn added the `util-linux-uuid` package as a fork of `util-linux` recently.

It looks like we had this same problem for the `util-linux` package. You either need to `--disable-bash-completion` or explicitly pass a `--with-bashcompletiondir` flag. I'm guessing we want the former here since `util-linux-uuid` is supposed to be just the `libuuid` bits.

I'll open an issue with this fix.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/util-linux-uuid/package.py b/var/spack/repos/builtin/packages/util-linux-uuid/package.py
--- a/var/spack/repos/builtin/packages/util-linux-uuid/package.py
+++ b/var/spack/repos/builtin/packages/util-linux-uuid/package.py
@@ -39,6 +39,7 @@ def configure_args(self):
             '--without-systemd',
             '--disable-all-programs',
             '--without-python',
-            '--enable-libuuid'
+            '--enable-libuuid',
+            '--disable-bash-completion',
         ]
         return config_args


Test patch: