Repository: spack/spack

Issue:
Installation issue: concretization of stat with binutils plugins variant
This was reported to me via the STAT github repo (https://github.com/LLNL/STAT/issues/27). STAT is failing to install because binutils variants aren't being concretized properly. I can work around this by depending on `^binutils+plugins`, but it seems like the default should work. Is there some other way I need to resolve this in the STAT package or LLVM package?

```
$ ./bin/spack spec stat
Input spec
--------------------------------
stat

Concretized
--------------------------------
==> Error: An unsatisfiable variant constraint has been detected for spec:

    binutils@2.36.1%gcc@8.3.1~gas+gold~headers~interwork~ld~libiberty~lto+nls~plugins arch=linux-rhel8-broadwell
        ^diffutils@3.7%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^libiconv@1.16%gcc@8.3.1 arch=linux-rhel8-broadwell
        ^gettext@0.21%gcc@8.3.1+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-rhel8-broadwell
            ^bzip2@1.0.8%gcc@8.3.1+shared arch=linux-rhel8-broadwell
            ^libxml2@2.9.10%gcc@8.3.1~python arch=linux-rhel8-broadwell
                ^pkgconf@1.7.4%gcc@8.3.1 arch=linux-rhel8-broadwell
                ^xz@5.2.5%gcc@8.3.1~pic arch=linux-rhel8-broadwell
                ^zlib@1.2.11%gcc@8.3.1+optimize+pic+shared arch=linux-rhel8-broadwell
            ^ncurses@6.2%gcc@8.3.1~symlinks+termlib abi=none arch=linux-rhel8-broadwell
            ^tar@1.34%gcc@8.3.1 arch=linux-rhel8-broadwell


while trying to concretize the partial spec:

    llvm@12.0.0%gcc@8.3.1~all_targets+clang~code_signing+compiler-rt~cuda~flang+gold+internal_unwind~ipo+libcxx+lld+lldb~llvm_dylib~mlir~omp_debug~omp_tsan+polly~python~shared_libs~split_dwarf build_type=Release cuda_arch=none arch=linux-rhel8-broadwell
        ^cmake@3.20.1%gcc@8.3.1~doc+ncurses+openssl+ownlibs~qt build_type=Release arch=linux-rhel8-broadwell
            ^ncurses@6.2%gcc@8.3.1~symlinks+termlib abi=none arch=linux-rhel8-broadwell
                ^pkgconf@1.7.4%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^openssl@1.1.1k%gcc@8.3.1~docs+systemcerts arch=linux-rhel8-broadwell
                ^perl@5.32.1%gcc@8.3.1+cpanm+shared+threads arch=linux-rhel8-broadwell
                    ^berkeley-db@18.1.40%gcc@8.3.1+cxx~docs+stl arch=linux-rhel8-broadwell
                    ^gdbm@1.19%gcc@8.3.1 arch=linux-rhel8-broadwell
                        ^readline@8.1%gcc@8.3.1 arch=linux-rhel8-broadwell
                ^zlib@1.2.11%gcc@8.3.1+optimize+pic+shared arch=linux-rhel8-broadwell
        ^hwloc@2.4.1%gcc@8.3.1~cairo~cuda~gl~libudev+libxml2~netloc~nvml+pci+shared arch=linux-rhel8-broadwell
            ^libpciaccess@0.16%gcc@8.3.1 arch=linux-rhel8-broadwell
                ^libtool@2.4.6%gcc@8.3.1 arch=linux-rhel8-broadwell
                    ^m4@1.4.18%gcc@8.3.1+sigsegv arch=linux-rhel8-broadwell
                        ^libsigsegv@2.13%gcc@8.3.1 arch=linux-rhel8-broadwell
                ^util-macros@1.19.1%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^libxml2@2.9.10%gcc@8.3.1~python arch=linux-rhel8-broadwell
                ^libiconv@1.16%gcc@8.3.1 arch=linux-rhel8-broadwell
                ^xz@5.2.5%gcc@8.3.1~pic arch=linux-rhel8-broadwell
        ^libedit@3.1-20210216%gcc@8.3.1 arch=linux-rhel8-broadwell
        ^perl-data-dumper@2.173%gcc@8.3.1 arch=linux-rhel8-broadwell
        ^python@3.8.9%gcc@8.3.1+bz2+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tix~tkinter~ucs4+uuid+zlib arch=linux-rhel8-broadwell
            ^bzip2@1.0.8%gcc@8.3.1+shared arch=linux-rhel8-broadwell
                ^diffutils@3.7%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^expat@2.3.0%gcc@8.3.1+libbsd arch=linux-rhel8-broadwell
                ^libbsd@0.11.3%gcc@8.3.1 arch=linux-rhel8-broadwell
                    ^libmd@1.0.3%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^gettext@0.21%gcc@8.3.1+bzip2+curses+git~libunistring+libxml2+tar+xz arch=linux-rhel8-broadwell
                ^tar@1.34%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^libffi@3.3%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^sqlite@3.35.4%gcc@8.3.1+column_metadata+fts~functions~rtree arch=linux-rhel8-broadwell
            ^util-linux-uuid@2.36.2%gcc@8.3.1 arch=linux-rhel8-broadwell
        ^swig@4.0.2%gcc@8.3.1 arch=linux-rhel8-broadwell
            ^pcre@8.44%gcc@8.3.1~jit+multibyte+utf arch=linux-rhel8-broadwell
        ^z3


llvm requires binutils variant +plugins, but spec asked for ~plugins
```



Discussion:
@lee218llnl What version of spack?  Which concretizer is being used?
This the develop branch. Here is the commit:
```
$ git log | head
commit 45b4dcb9ed6ce8cc5d5ca6275bca4ef07c3e82fc
Author: Drew Whitehouse <Drew.Whitehouse@gmail.com>
Date:   Tue Apr 27 06:04:11 2021 +1000

    add a package libcxxwrap-julia (#23076)
```
@haampie 

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/binutils/package.py b/var/spack/repos/builtin/packages/binutils/package.py
--- a/var/spack/repos/builtin/packages/binutils/package.py
+++ b/var/spack/repos/builtin/packages/binutils/package.py
@@ -30,7 +30,7 @@ class Binutils(AutotoolsPackage, GNUMirrorPackage):
     version('2.23.2', sha256='fe914e56fed7a9ec2eb45274b1f2e14b0d8b4f41906a5194eac6883cfe5c1097')
     version('2.20.1', sha256='71d37c96451333c5c0b84b170169fdcb138bbb27397dc06281905d9717c8ed64')
 
-    variant('plugins', default=False,
+    variant('plugins', default=True,
             description="enable plugins, needed for gold linker")
     variant('gold', default=(sys.platform != 'darwin'),
             description="build the gold linker")


Test patch: