Repository: spack/spack

Issue:
New concretizer: target ranges treated incorrectly
### Steps to reproduce the issue

```console
$ spack install clingo@master
$ spack load clingo@master
$ spack solve superlu-dist%gcc@10.1.0 cuda_arch=61 ^cuda@10.1.243
...
```

### Error Message

The above concretization should not be possible because gcc@10.1.0 conflicts with cuda 10.1.243 and will generate compiler unsupported compiler errors if used.  The same request with spack spec correctly returns the following error:

```console
$ spack spec superlu-dist%gcc@10.1.0 cuda_arch=61 ^cuda@10.1.243
spack spec superlu-dist cuda_arch=61 \^cuda@10.1.243
Input spec
--------------------------------
superlu-dist cuda_arch=61
    ^cuda@10.1.243

Concretized
--------------------------------
==> Error: Conflicts in concretized spec "superlu-dist@6.4.0%gcc@10.1.0~cuda~int64~ipo~openmp+shared build_type=RelWithDebInfo cuda_arch=61 arch=linux-gentoo2-skylake/yzk5kz6"

List of matching conflicts for spec:

    superlu-dist@6.4.0%gcc@10.1.0~cuda~int64~ipo~openmp+shared build_type=RelWithDebInfo cuda_arch=61 arch=linux-gentoo2-skylake
        ^cmake@3.18.4%gcc@10.1.0~doc+ncurses+openssl+ownlibs~qt patches=bf695e3febb222da2ed94b3beea600650e4318975da90e4a71d6f31a6d5d8c3d arch=linux-gentoo2-skylake
        ^cuda@10.1.243%gcc@10.1.0 arch=linux-gentoo2-skylake
        ^metis@5.1.0%gcc@10.1.0~gdb~int64~real64+shared build_type=Release patches=4991da938c1d3a1d3dea78e49bbebecba00273f98df2a656e38b83d55b281da1,b1225da886605ea558db7ac08dd8054742ea5afe5ed61ad4d0fe7a495b1270d2 arch=linux-gentoo2-skylake
        ^openblas@0.3.12%gcc@10.1.0~consistent_fpcsr~ilp64+pic+shared threads=none arch=linux-gentoo2-skylake
        ^openmpi@3.1.6%gcc@10.1.0~atomics~cuda~cxx~cxx_exceptions+gpfs~java~legacylaunchers~lustre~memchecker~pmi~singularity~sqlite3+static~thread_multiple+vt+wrapper-rpath fabrics=none schedulers=none arch=linux-gentoo2-skylake
            ^hwloc@1.11.11%gcc@10.1.0~cairo~cuda~gl~libudev+libxml2~netloc~nvml+pci+shared arch=linux-gentoo2-skylake
                ^libpciaccess@0.16%gcc@10.1.0 arch=linux-gentoo2-skylake
                    ^libtool@2.4.6%gcc@10.1.0 arch=linux-gentoo2-skylake
                        ^m4@1.4.18%gcc@10.1.0+sigsegv patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 arch=linux-gentoo2-skylake
                            ^libsigsegv@2.12%gcc@10.1.0 arch=linux-gentoo2-skylake
                    ^pkgconf@1.6.3%gcc@10.1.0 arch=linux-gentoo2-skylake
                    ^util-macros@1.19.1%gcc@10.1.0 arch=linux-gentoo2-skylake
                ^libxml2@2.9.10%gcc@10.1.0~python arch=linux-gentoo2-skylake
                    ^libiconv@1.16%gcc@10.1.0 arch=linux-gentoo2-skylake
                    ^xz@5.2.5%gcc@10.1.0~pic arch=linux-gentoo2-skylake
                    ^zlib@1.2.11%gcc@10.1.0+optimize+pic+shared arch=linux-gentoo2-skylake
                ^numactl@2.0.14%gcc@10.1.0 patches=4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94 arch=linux-gentoo2-skylake
                    ^autoconf@2.69%gcc@10.1.0 arch=linux-gentoo2-skylake
                        ^perl@5.30.3%gcc@10.1.0~cpanm+shared+threads arch=linux-gentoo2-skylake
                    ^automake@1.16.2%gcc@10.1.0 arch=linux-gentoo2-skylake
        ^parmetis@4.0.3%gcc@10.1.0~gdb~int64~ipo+shared build_type=RelWithDebInfo patches=4f892531eb0a807eb1b82e683a416d3e35154a455274cf9b162fb02054d11a5b,50ed2081bc939269689789942067c58b3e522c269269a430d5d34c00edbc5870,704b84f7c7444d4372cb59cca6e1209df4ef3b033bc4ee3cf50f369bce972a9d arch=linux-gentoo2-skylak
```

Here is what spack solve returns

<details>
<summary>$ spack --debug solve superlu-dist cuda_arch=60 \^cuda@10.1.243</summary>

```
[runderwood@voyager spack]$ spack --debug solve superlu-dist cuda_arch=60 \^cuda@10.1.243
==> [2020-11-18-13:30:04.201821] Imported solve from built-in commands
==> [2020-11-18-13:30:04.202588] Imported solve from built-in commands
==> [2020-11-18-13:30:04.203373] Reading config file /home/runderwood/git/contrib/spack/etc/spack/defaults/repos.yaml
==> [2020-11-18-13:30:04.205143] Reading config file /home/runderwood/.spack/repos.yaml
==> [2020-11-18-13:30:04.205868] Reading config file /home/runderwood/.spack/linux/repos.yaml
==> [2020-11-18-13:30:04.284343] Reading config file /home/runderwood/git/contrib/spack/etc/spack/defaults/config.yaml
==> [2020-11-18-13:30:05.064162] Reading config file /home/runderwood/.spack/linux/compilers.yaml
==> [2020-11-18-13:30:05.128905] Reading config file /home/runderwood/git/contrib/spack/etc/spack/defaults/packages.yaml
==> [2020-11-18-13:30:05.152657] Reading config file /home/runderwood/.spack/packages.yaml
==> [2020-11-18-13:30:14.556939] version_weight(opengl, -1)
==> [2020-11-18-13:30:14.557057] version_weight(zlib, 0)
==> [2020-11-18-13:30:14.557131] version_weight(util-macros, 0)
==> [2020-11-18-13:30:14.557160] version_weight(texinfo, -1)
==> [2020-11-18-13:30:14.557227] version_weight(superlu-dist, 0)
==> [2020-11-18-13:30:14.557253] version_weight(parmetis, 0)
==> [2020-11-18-13:30:14.557279] version_weight(openblas, 0)
==> [2020-11-18-13:30:14.557304] version_weight(numactl, 0)
==> [2020-11-18-13:30:14.557330] version_weight(mxm, 0)
==> [2020-11-18-13:30:14.557355] version_weight(m4, 0)
==> [2020-11-18-13:30:14.557381] version_weight(libsigsegv, 0)
==> [2020-11-18-13:30:14.557406] version_weight(libpciaccess, 0)
==> [2020-11-18-13:30:14.557432] version_weight(pkgconf, 1)
==> [2020-11-18-13:30:14.557458] version_weight(pkgconf, -1)
==> [2020-11-18-13:30:14.557483] version_weight(perl, 4)
==> [2020-11-18-13:30:14.557509] version_weight(perl, -1)
==> [2020-11-18-13:30:14.557535] version_weight(openmpi, 1)
==> [2020-11-18-13:30:14.557560] version_weight(metis, 0)
==> [2020-11-18-13:30:14.557587] version_weight(libtool, 0)
==> [2020-11-18-13:30:14.557612] version_weight(hwloc, 0)
==> [2020-11-18-13:30:14.557639] version_weight(diffutils, 0)
==> [2020-11-18-13:30:14.557665] version_weight(diffutils, -1)
==> [2020-11-18-13:30:14.557691] version_weight(cuda, 3)
==> [2020-11-18-13:30:14.557716] version_weight(cuda, -1)
==> [2020-11-18-13:30:14.557742] version_weight(cmake, 0)
==> [2020-11-18-13:30:14.557768] version_weight(cmake, -3)
==> [2020-11-18-13:30:14.557794] version_weight(binutils, 2)
==> [2020-11-18-13:30:14.557819] version_weight(automake, 0)
==> [2020-11-18-13:30:14.557845] version_weight(autoconf, 0)
==> [2020-11-18-13:30:14.558043] provider_weight(opengl, 0)
==> [2020-11-18-13:30:14.558077] provider_weight(pkgconf, 0)
==> [2020-11-18-13:30:14.558105] provider_weight(openblas, 10)
==> [2020-11-18-13:30:14.558132] provider_weight(openmpi, 10)
==> [2020-11-18-13:30:14.558159] variant_not_default(perl, cpanm, False, 1)
==> [2020-11-18-13:30:14.558186] variant_not_default(hwloc, gl, True, 1)
==> [2020-11-18-13:30:14.558213] variant_not_default(openmpi, fabrics, mxm, 1)
==> [2020-11-18-13:30:14.558239] variant_not_default(superlu-dist, cuda, True, 1)
==> [2020-11-18-13:30:14.558265] variant_not_default(superlu-dist, cuda_arch, 60, 1)
==> [2020-11-18-13:30:14.558292] variant_not_default(binutils, libiberty, True, 1)
==> [2020-11-18-13:30:14.558318] variant_not_default(binutils, nls, False, 1)
==> [2020-11-18-13:30:14.558344] variant_not_default(hwloc, libxml2, False, 1)
==> [2020-11-18-13:30:14.558370] variant_not_default(binutils, gold, True, 0)
==> [2020-11-18-13:30:14.558396] variant_not_default(binutils, headers, False, 0)
==> [2020-11-18-13:30:14.558422] variant_not_default(binutils, interwork, False, 0)
==> [2020-11-18-13:30:14.558448] variant_not_default(binutils, ld, False, 0)
==> [2020-11-18-13:30:14.558474] variant_not_default(binutils, lto, False, 0)
==> [2020-11-18-13:30:14.558501] variant_not_default(binutils, plugins, False, 0)
==> [2020-11-18-13:30:14.558527] variant_not_default(cmake, doc, False, 0)
==> [2020-11-18-13:30:14.558553] variant_not_default(cmake, ncurses, True, 0)
==> [2020-11-18-13:30:14.558579] variant_not_default(cmake, openssl, True, 0)
==> [2020-11-18-13:30:14.558605] variant_not_default(cmake, ownlibs, True, 0)
==> [2020-11-18-13:30:14.558631] variant_not_default(cmake, qt, False, 0)
==> [2020-11-18-13:30:14.558657] variant_not_default(hwloc, cairo, False, 0)
==> [2020-11-18-13:30:14.558683] variant_not_default(hwloc, cuda, False, 0)
==> [2020-11-18-13:30:14.558709] variant_not_default(hwloc, libudev, False, 0)
==> [2020-11-18-13:30:14.558735] variant_not_default(hwloc, netloc, False, 0)
==> [2020-11-18-13:30:14.558761] variant_not_default(hwloc, nvml, False, 0)
==> [2020-11-18-13:30:14.558787] variant_not_default(hwloc, pci, True, 0)
==> [2020-11-18-13:30:14.558814] variant_not_default(hwloc, shared, True, 0)
==> [2020-11-18-13:30:14.558840] variant_not_default(m4, sigsegv, True, 0)
==> [2020-11-18-13:30:14.558866] variant_not_default(metis, build_type, Release, 0)
==> [2020-11-18-13:30:14.558892] variant_not_default(metis, gdb, False, 0)
==> [2020-11-18-13:30:14.558918] variant_not_default(metis, int64, False, 0)
==> [2020-11-18-13:30:14.558944] variant_not_default(metis, real64, False, 0)
==> [2020-11-18-13:30:14.558970] variant_not_default(metis, shared, True, 0)
==> [2020-11-18-13:30:14.558996] variant_not_default(openblas, consistent_fpcsr, False, 0)
==> [2020-11-18-13:30:14.559030] variant_not_default(openblas, ilp64, False, 0)
==> [2020-11-18-13:30:14.559057] variant_not_default(openblas, pic, True, 0)
==> [2020-11-18-13:30:14.559083] variant_not_default(openblas, shared, True, 0)
==> [2020-11-18-13:30:14.559109] variant_not_default(openblas, threads, none, 0)
==> [2020-11-18-13:30:14.559135] variant_not_default(openmpi, atomics, False, 0)
==> [2020-11-18-13:30:14.559161] variant_not_default(openmpi, cuda, False, 0)
==> [2020-11-18-13:30:14.559187] variant_not_default(openmpi, cxx, False, 0)
==> [2020-11-18-13:30:14.559213] variant_not_default(openmpi, cxx_exceptions, False, 0)
==> [2020-11-18-13:30:14.559240] variant_not_default(openmpi, gpfs, True, 0)
==> [2020-11-18-13:30:14.559266] variant_not_default(openmpi, java, False, 0)
==> [2020-11-18-13:30:14.559292] variant_not_default(openmpi, legacylaunchers, False, 0)
==> [2020-11-18-13:30:14.559318] variant_not_default(openmpi, lustre, False, 0)
==> [2020-11-18-13:30:14.559344] variant_not_default(openmpi, memchecker, False, 0)
==> [2020-11-18-13:30:14.559370] variant_not_default(openmpi, pmi, False, 0)
==> [2020-11-18-13:30:14.559396] variant_not_default(openmpi, schedulers, none, 0)
==> [2020-11-18-13:30:14.559421] variant_not_default(openmpi, singularity, False, 0)
==> [2020-11-18-13:30:14.559447] variant_not_default(openmpi, sqlite3, False, 0)
==> [2020-11-18-13:30:14.559474] variant_not_default(openmpi, static, True, 0)
==> [2020-11-18-13:30:14.559500] variant_not_default(openmpi, thread_multiple, False, 0)
==> [2020-11-18-13:30:14.559526] variant_not_default(openmpi, vt, True, 0)
==> [2020-11-18-13:30:14.559552] variant_not_default(openmpi, wrapper-rpath, True, 0)
==> [2020-11-18-13:30:14.559578] variant_not_default(parmetis, build_type, RelWithDebInfo, 0)
==> [2020-11-18-13:30:14.559604] variant_not_default(parmetis, gdb, False, 0)
==> [2020-11-18-13:30:14.559630] variant_not_default(parmetis, int64, False, 0)
==> [2020-11-18-13:30:14.559656] variant_not_default(parmetis, ipo, False, 0)
==> [2020-11-18-13:30:14.559681] variant_not_default(parmetis, shared, True, 0)
==> [2020-11-18-13:30:14.559707] variant_not_default(perl, shared, True, 0)
==> [2020-11-18-13:30:14.559733] variant_not_default(perl, threads, True, 0)
==> [2020-11-18-13:30:14.559759] variant_not_default(superlu-dist, build_type, RelWithDebInfo, 0)
==> [2020-11-18-13:30:14.559785] variant_not_default(superlu-dist, int64, False, 0)
==> [2020-11-18-13:30:14.559811] variant_not_default(superlu-dist, ipo, False, 0)
==> [2020-11-18-13:30:14.559837] variant_not_default(superlu-dist, openmp, False, 0)
==> [2020-11-18-13:30:14.559863] variant_not_default(superlu-dist, shared, True, 0)
==> [2020-11-18-13:30:14.559889] variant_not_default(zlib, optimize, True, 0)
==> [2020-11-18-13:30:14.559915] variant_not_default(zlib, pic, True, 0)
==> [2020-11-18-13:30:14.559941] variant_not_default(zlib, shared, True, 0)
==> [2020-11-18-13:30:14.559967] variant_not_default(superlu-dist, cuda_arch, 61, 0)
==> [2020-11-18-13:30:14.559993] node_target_weight(openblas, 0)
==> [2020-11-18-13:30:14.560026] node_target_weight(opengl, 0)
==> [2020-11-18-13:30:14.560053] node_target_weight(openmpi, 0)
==> [2020-11-18-13:30:14.560080] node_target_weight(pkgconf, 0)
==> [2020-11-18-13:30:14.560106] node_target_weight(cuda, 0)
==> [2020-11-18-13:30:14.560131] node_target_weight(cmake, 0)
==> [2020-11-18-13:30:14.560157] node_target_weight(diffutils, 0)
==> [2020-11-18-13:30:14.560183] node_target_weight(perl, 0)
==> [2020-11-18-13:30:14.560209] node_target_weight(texinfo, 0)
==> [2020-11-18-13:30:14.560235] node_target_weight(autoconf, 0)
==> [2020-11-18-13:30:14.560261] node_target_weight(automake, 0)
==> [2020-11-18-13:30:14.560287] node_target_weight(libtool, 0)
==> [2020-11-18-13:30:14.560312] node_target_weight(m4, 0)
==> [2020-11-18-13:30:14.560338] node_target_weight(util-macros, 0)
==> [2020-11-18-13:30:14.560364] node_target_weight(binutils, 0)
==> [2020-11-18-13:30:14.560390] node_target_weight(zlib, 0)
==> [2020-11-18-13:30:14.560416] node_target_weight(libsigsegv, 0)
==> [2020-11-18-13:30:14.560442] node_target_weight(numactl, 0)
==> [2020-11-18-13:30:14.560467] node_target_weight(hwloc, 0)
==> [2020-11-18-13:30:14.560493] node_target_weight(libpciaccess, 0)
==> [2020-11-18-13:30:14.560519] node_target_weight(metis, 0)
==> [2020-11-18-13:30:14.560545] node_target_weight(mxm, 0)
==> [2020-11-18-13:30:14.560571] node_target_weight(parmetis, 0)
==> [2020-11-18-13:30:14.560596] node_target_weight(superlu-dist, 0)
==> [2020-11-18-13:30:14.560622] node_target_match(cmake, 1)
==> [2020-11-18-13:30:14.560648] node_target_match(cuda, 1)
==> [2020-11-18-13:30:14.560673] node_target_match(metis, 1)
==> [2020-11-18-13:30:14.560699] node_target_match(parmetis, 1)
==> [2020-11-18-13:30:14.560725] node_target_match(openblas, 1)
==> [2020-11-18-13:30:14.560750] node_target_match(openmpi, 1)
==> [2020-11-18-13:30:14.560776] node_target_match(autoconf, 1)
==> [2020-11-18-13:30:14.560802] node_target_match(automake, 1)
==> [2020-11-18-13:30:14.560827] node_target_match(hwloc, 1)
==> [2020-11-18-13:30:14.560853] node_target_match(libpciaccess, 1)
==> [2020-11-18-13:30:14.560879] node_target_match(libtool, 1)
==> [2020-11-18-13:30:14.560905] node_target_match(m4, 1)
==> [2020-11-18-13:30:14.560930] node_target_match(pkgconf, 1)
==> [2020-11-18-13:30:14.560956] node_target_match(zlib, 1)
==> [2020-11-18-13:30:14.560982] node_target_match(binutils, 1)
==> [2020-11-18-13:30:14.561014] node_target_match(mxm, 1)
==> [2020-11-18-13:30:14.561042] node_target_match(numactl, 1)
==> [2020-11-18-13:30:14.561068] node_target_match(perl, 1)
==> [2020-11-18-13:30:14.561094] node_target_match(opengl, 1)
==> [2020-11-18-13:30:14.561120] node_target_match(diffutils, 1)
==> [2020-11-18-13:30:14.561145] node_target_match(texinfo, 1)
==> [2020-11-18-13:30:14.561171] node_target_match(libsigsegv, 1)
==> [2020-11-18-13:30:14.561197] node_target_match(util-macros, 1)
==> [2020-11-18-13:30:14.561222] compiler_weight(cmake, 0)
==> [2020-11-18-13:30:14.561248] compiler_weight(superlu-dist, 0)
==> [2020-11-18-13:30:14.561273] compiler_weight(openblas, 0)
==> [2020-11-18-13:30:14.561299] compiler_weight(opengl, 0)
==> [2020-11-18-13:30:14.561325] compiler_weight(openmpi, 0)
==> [2020-11-18-13:30:14.561350] compiler_weight(pkgconf, 0)
==> [2020-11-18-13:30:14.561376] compiler_weight(cuda, 0)
==> [2020-11-18-13:30:14.561401] compiler_weight(diffutils, 0)
==> [2020-11-18-13:30:14.561427] compiler_weight(perl, 0)
==> [2020-11-18-13:30:14.561452] compiler_weight(texinfo, 0)
==> [2020-11-18-13:30:14.561478] compiler_weight(autoconf, 0)
==> [2020-11-18-13:30:14.561504] compiler_weight(automake, 0)
==> [2020-11-18-13:30:14.561530] compiler_weight(libtool, 0)
==> [2020-11-18-13:30:14.561555] compiler_weight(m4, 0)
==> [2020-11-18-13:30:14.561581] compiler_weight(util-macros, 0)
==> [2020-11-18-13:30:14.561607] compiler_weight(binutils, 0)
==> [2020-11-18-13:30:14.561632] compiler_weight(zlib, 0)
==> [2020-11-18-13:30:14.561658] compiler_weight(libsigsegv, 0)
==> [2020-11-18-13:30:14.561683] compiler_weight(numactl, 0)
==> [2020-11-18-13:30:14.561709] compiler_weight(hwloc, 0)
==> [2020-11-18-13:30:14.561735] compiler_weight(libpciaccess, 0)
==> [2020-11-18-13:30:14.561761] compiler_weight(metis, 0)
==> [2020-11-18-13:30:14.561787] compiler_weight(mxm, 0)
==> [2020-11-18-13:30:14.561812] compiler_weight(parmetis, 0)
==> [2020-11-18-13:30:14.561838] compiler_version_match(openblas, 1)
==> [2020-11-18-13:30:14.561864] compiler_version_match(openmpi, 1)
==> [2020-11-18-13:30:14.561890] compiler_version_match(cuda, 1)
==> [2020-11-18-13:30:14.561916] compiler_version_match(cmake, 1)
==> [2020-11-18-13:30:14.561941] compiler_version_match(metis, 1)
==> [2020-11-18-13:30:14.561967] compiler_version_match(parmetis, 1)
==> [2020-11-18-13:30:14.561993] compiler_version_match(pkgconf, 1)
==> [2020-11-18-13:30:14.562022] compiler_version_match(perl, 1)
==> [2020-11-18-13:30:14.562048] compiler_version_match(autoconf, 1)
==> [2020-11-18-13:30:14.562073] compiler_version_match(automake, 1)
==> [2020-11-18-13:30:14.562099] compiler_version_match(libtool, 1)
==> [2020-11-18-13:30:14.562125] compiler_version_match(m4, 1)
==> [2020-11-18-13:30:14.562150] compiler_version_match(binutils, 1)
==> [2020-11-18-13:30:14.562176] compiler_version_match(zlib, 1)
==> [2020-11-18-13:30:14.562202] compiler_version_match(numactl, 1)
==> [2020-11-18-13:30:14.562227] compiler_version_match(hwloc, 1)
==> [2020-11-18-13:30:14.562253] compiler_version_match(mxm, 1)
==> [2020-11-18-13:30:14.562278] compiler_version_match(libpciaccess, 1)
==> [2020-11-18-13:30:14.562304] compiler_version_match(texinfo, 1)
==> [2020-11-18-13:30:14.562329] compiler_version_match(util-macros, 1)
==> [2020-11-18-13:30:14.562354] compiler_version_match(diffutils, 1)
==> [2020-11-18-13:30:14.562380] compiler_version_match(opengl, 1)
==> [2020-11-18-13:30:14.562405] compiler_version_match(libsigsegv, 1)
==> [2020-11-18-13:30:14.566470] Ordered hashes [texinfo]: texinfo/52/1732115f651cff98989cb0215d8f64da5e0f7911ebf0c13b064920f088f2ffe1, texinfo/55/12f6edb0c6b270b8c8dba2ce17998c580db01182d871ee32b7b6e4129bd1d23a
==> [2020-11-18-13:30:14.566658] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.566830] Ordered hashes [numactl]: numactl/246/4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94
==> [2020-11-18-13:30:14.567549] Ordered hashes [cmake]: cmake/75/bf695e3febb222da2ed94b3beea600650e4318975da90e4a71d6f31a6d5d8c3d
==> [2020-11-18-13:30:14.568179] Ordered hashes [texinfo]: texinfo/52/1732115f651cff98989cb0215d8f64da5e0f7911ebf0c13b064920f088f2ffe1, texinfo/55/12f6edb0c6b270b8c8dba2ce17998c580db01182d871ee32b7b6e4129bd1d23a
==> [2020-11-18-13:30:14.568917] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.569763] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.570347] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.570802] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.571449] Ordered hashes [texinfo]: texinfo/52/1732115f651cff98989cb0215d8f64da5e0f7911ebf0c13b064920f088f2ffe1, texinfo/55/12f6edb0c6b270b8c8dba2ce17998c580db01182d871ee32b7b6e4129bd1d23a
==> [2020-11-18-13:30:14.572702] Ordered hashes [numactl]: numactl/246/4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94
==> [2020-11-18-13:30:14.572794] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.573730] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.574581] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.575393] Ordered hashes [metis]: metis/345/4991da938c1d3a1d3dea78e49bbebecba00273f98df2a656e38b83d55b281da1, metis/346/b1225da886605ea558db7ac08dd8054742ea5afe5ed61ad4d0fe7a495b1270d2
==> [2020-11-18-13:30:14.575478] Ordered hashes [cmake]: cmake/75/bf695e3febb222da2ed94b3beea600650e4318975da90e4a71d6f31a6d5d8c3d
==> [2020-11-18-13:30:14.579165] Ordered hashes [parmetis]: parmetis/342/50ed2081bc939269689789942067c58b3e522c269269a430d5d34c00edbc5870, parmetis/343/4f892531eb0a807eb1b82e683a416d3e35154a455274cf9b162fb02054d11a5b, parmetis/344/704b84f7c7444d4372cb59cca6e1209df4ef3b033bc4ee3cf50f369bce972a9d
==> [2020-11-18-13:30:14.579258] Ordered hashes [cmake]: cmake/75/bf695e3febb222da2ed94b3beea600650e4318975da90e4a71d6f31a6d5d8c3d
==> [2020-11-18-13:30:14.579318] Ordered hashes [metis]: metis/345/4991da938c1d3a1d3dea78e49bbebecba00273f98df2a656e38b83d55b281da1, metis/346/b1225da886605ea558db7ac08dd8054742ea5afe5ed61ad4d0fe7a495b1270d2
==> [2020-11-18-13:30:14.579404] Ordered hashes [texinfo]: texinfo/52/1732115f651cff98989cb0215d8f64da5e0f7911ebf0c13b064920f088f2ffe1, texinfo/55/12f6edb0c6b270b8c8dba2ce17998c580db01182d871ee32b7b6e4129bd1d23a
==> [2020-11-18-13:30:14.579524] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.579646] Ordered hashes [numactl]: numactl/246/4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94
==> [2020-11-18-13:30:14.584402] Ordered hashes [cmake]: cmake/75/bf695e3febb222da2ed94b3beea600650e4318975da90e4a71d6f31a6d5d8c3d
==> [2020-11-18-13:30:14.584511] Ordered hashes [metis]: metis/345/4991da938c1d3a1d3dea78e49bbebecba00273f98df2a656e38b83d55b281da1, metis/346/b1225da886605ea558db7ac08dd8054742ea5afe5ed61ad4d0fe7a495b1270d2
==> [2020-11-18-13:30:14.584604] Ordered hashes [texinfo]: texinfo/52/1732115f651cff98989cb0215d8f64da5e0f7911ebf0c13b064920f088f2ffe1, texinfo/55/12f6edb0c6b270b8c8dba2ce17998c580db01182d871ee32b7b6e4129bd1d23a
==> [2020-11-18-13:30:14.584691] Ordered hashes [m4]: m4/43/3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00, m4/49/fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8
==> [2020-11-18-13:30:14.584783] Ordered hashes [numactl]: numactl/246/4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94
==> [2020-11-18-13:30:14.584886] Ordered hashes [parmetis]: parmetis/342/50ed2081bc939269689789942067c58b3e522c269269a430d5d34c00edbc5870, parmetis/343/4f892531eb0a807eb1b82e683a416d3e35154a455274cf9b162fb02054d11a5b, parmetis/344/704b84f7c7444d4372cb59cca6e1209df4ef3b033bc4ee3cf50f369bce972a9d
==> [2020-11-18-13:30:14.586094] DATABASE LOCK TIMEOUT: 3s
==> [2020-11-18-13:30:14.586134] PACKAGE LOCK TIMEOUT: No timeout
==> [2020-11-18-13:30:14.924720] Best of 0 answers.
==> [2020-11-18-13:30:14.925960] Optimization: [0, 2, -8, 20, -7, 6, -60, 1, 0, -23, 0]
superlu-dist@6.4.0%gcc@10.1.0+cuda~int64~ipo~openmp+shared build_type=RelWithDebInfo cuda_arch=60,61 arch=linux-gentoo2-skylake
    ^cmake@3.18.4%gcc@10.1.0~doc+ncurses+openssl+ownlibs~qt patches=bf695e3febb222da2ed94b3beea600650e4318975da90e4a71d6f31a6d5d8c3d arch=linux-gentoo2-skylake
    ^cuda@10.1.243%gcc@10.1.0 arch=linux-gentoo2-skylake
    ^metis@5.1.0%gcc@10.1.0~gdb~int64~real64+shared build_type=Release patches=4991da938c1d3a1d3dea78e49bbebecba00273f98df2a656e38b83d55b281da1,b1225da886605ea558db7ac08dd8054742ea5afe5ed61ad4d0fe7a495b1270d2 arch=linux-gentoo2-skylake
    ^openblas@0.3.12%gcc@10.1.0~consistent_fpcsr~ilp64+pic+shared threads=none arch=linux-gentoo2-skylake
    ^openmpi@4.0.5%gcc@10.1.0~atomics~cuda~cxx~cxx_exceptions+gpfs~java~legacylaunchers~lustre~memchecker~pmi~singularity~sqlite3+static~thread_multiple+vt+wrapper-rpath fabrics=mxm schedulers=none arch=linux-gentoo2-skylake
        ^binutils@2.34%gcc@10.1.0+gold~headers~interwork~ld+libiberty~lto~nls~plugins arch=linux-gentoo2-skylake
            ^diffutils@3.7%gcc@10.1.0 arch=linux-gentoo2-skylake
            ^texinfo@6.7%gcc@10.1.0 patches=12f6edb0c6b270b8c8dba2ce17998c580db01182d871ee32b7b6e4129bd1d23a,1732115f651cff98989cb0215d8f64da5e0f7911ebf0c13b064920f088f2ffe1 arch=linux-gentoo2-skylake
            ^zlib@1.2.11%gcc@10.1.0+optimize+pic+shared arch=linux-gentoo2-skylake
        ^hwloc@2.2.0%gcc@10.1.0~cairo~cuda+gl~libudev~libxml2~netloc~nvml+pci+shared arch=linux-gentoo2-skylake
            ^libpciaccess@0.16%gcc@10.1.0 arch=linux-gentoo2-skylake
                ^libtool@2.4.6%gcc@10.1.0 arch=linux-gentoo2-skylake
                    ^m4@1.4.18%gcc@10.1.0+sigsegv patches=3877ab548f88597ab2327a2230ee048d2d07ace1062efe81fc92e91b7f39cd00,fc9b61654a3ba1a8d6cd78ce087e7c96366c290bc8d2c299f09828d793b853c8 arch=linux-gentoo2-skylake
                        ^libsigsegv@2.12%gcc@10.1.0 arch=linux-gentoo2-skylake
                ^pkgconf@1.6.3%gcc@10.1.0 arch=linux-gentoo2-skylake
                ^util-macros@1.19.1%gcc@10.1.0 arch=linux-gentoo2-skylake
            ^opengl@3.0%gcc@10.1.0 arch=linux-gentoo2-skylake
        ^mxm@3.6.3104%gcc@10.1.0 arch=linux-gentoo2-skylake
        ^numactl@2.0.14%gcc@10.1.0 patches=4e1d78cbbb85de625bad28705e748856033eaafab92a66dffd383a3d7e00cc94 arch=linux-gentoo2-skylake
            ^autoconf@2.69%gcc@10.1.0 arch=linux-gentoo2-skylake
                ^perl@5.30.3%gcc@10.1.0~cpanm+shared+threads arch=linux-gentoo2-skylake
            ^automake@1.16.2%gcc@10.1.0 arch=linux-gentoo2-skylake
    ^parmetis@4.0.3%gcc@10.1.0~gdb~int64~ipo+shared build_type=RelWithDebInfo patches=4f892531eb0a807eb1b82e683a416d3e35154a455274cf9b162fb02054d11a5b,50ed2081bc939269689789942067c58b3e522c269269a430d5d34c00edbc5870,704b84f7c7444d4372cb59cca6e1209df4ef3b033bc4ee3cf50f369bce972a9d arch=linux-gentoo2-skylake
```
</details>

### Information on your system

* **Spack:** 0.16.0-5-3069631f3
* **Python:** 3.8.6
* **Platform:** linux-gentoo2-skylake

Relevant section of spack packages.yaml

```yaml
packages:
  all:
    variants:
      - cuda_arch=61
  cuda:
    externals:
    - spec: cuda@10.1.243
      prefix: /opt/cuda
```

### Additional 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 searched the issues of this repo and believe this is not a duplicate
- [x] I have run the failing commands in debug mode and reported the output

<!-- We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively!

If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the `#general` channel on our Slack first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.

Other than that, thanks for taking the time to contribute to Spack! -->



Discussion:
@robertu94 Need to check this one better, but it seems the new concretizer is buggy on target ranges and we didn't have any unit test exposing that. Looking at the logic program that is generated I see:
```
:- node("superlu-dist"),variant_value("superlu-dist","cuda","True"),node_compiler("superlu-dist","gcc"),node_compiler_version_satisfies("superlu-dist","gcc","9:"),node("cuda"),version_satisfies("cuda",":10.2.89"),node_platform("cuda","linux"),node_target("cuda","x86_64:"),not external("superlu-dist").
```
The integrity constraint contains:
```
node_target("cuda","x86_64:")
```
so it apparently forbids `x86_64:` and not the range of targets. I'll follow up here quickly.

Resolving patch:
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -696,6 +696,7 @@ def __init__(self):
         self.possible_virtuals = None
         self.possible_compilers = []
         self.version_constraints = set()
+        self.target_constraints = set()
         self.providers_by_vspec_name = collections.defaultdict(list)
         self.virtual_constraints = set()
         self.compiler_version_constraints = set()
@@ -765,6 +766,16 @@ def spec_versions(self, spec):
         self.version_constraints.add((spec.name, spec.versions))
         return [fn.version_satisfies(spec.name, spec.versions)]
 
+    def target_ranges(self, spec, single_target_fn):
+        target = spec.architecture.target
+
+        # Check if the target is a concrete target
+        if str(target) in archspec.cpu.TARGETS:
+            return [single_target_fn(spec.name, target)]
+
+        self.target_constraints.add((spec.name, target))
+        return [fn.node_target_satisfies(spec.name, target)]
+
     def conflict_rules(self, pkg):
         for trigger, constraints in pkg.conflicts.items():
             for constraint, _ in constraints:
@@ -1167,7 +1178,7 @@ class Body(object):
             if arch.os:
                 clauses.append(f.node_os(spec.name, arch.os))
             if arch.target:
-                clauses.append(f.node_target(spec.name, arch.target))
+                clauses.extend(self.target_ranges(spec, f.node_target))
 
         # variants
         for vname, variant in sorted(spec.variants.items()):
@@ -1437,6 +1448,45 @@ def define_compiler_version_constraints(self):
             )
             self.gen.newline()
 
+    def define_target_constraints(self):
+
+        def _all_targets_satisfiying(single_constraint):
+            allowed_targets = []
+            t_min, _, t_max = single_constraint.partition(':')
+            for test_target in archspec.cpu.TARGETS.values():
+                # Check lower bound
+                if t_min and not t_min <= test_target:
+                    continue
+
+                # Check upper bound
+                if t_max and not t_max >= test_target:
+                    continue
+
+                allowed_targets.append(test_target)
+            return allowed_targets
+
+        cache = {}
+        for spec_name, target_constraint in sorted(self.target_constraints):
+
+            # Construct the list of allowed targets for this constraint
+            allowed_targets = []
+            for single_constraint in str(target_constraint).split(','):
+                if single_constraint not in cache:
+                    cache[single_constraint] = _all_targets_satisfiying(
+                        single_constraint
+                    )
+                allowed_targets.extend(cache[single_constraint])
+
+            allowed_targets = [
+                fn.node_target(spec_name, t) for t in allowed_targets
+            ]
+
+            self.gen.one_of_iff(
+                fn.node_target_satisfies(spec_name, target_constraint),
+                allowed_targets,
+            )
+            self.gen.newline()
+
     def setup(self, driver, specs, tests=False):
         """Generate an ASP program with relevant constraints for specs.
 
@@ -1560,6 +1610,9 @@ def setup(self, driver, specs, tests=False):
         self.gen.h1("Compiler Version Constraints")
         self.define_compiler_version_constraints()
 
+        self.gen.h1("Target Constraints")
+        self.define_target_constraints()
+
     def virtual_spec_clauses(self, dep):
         assert dep.virtual
         self.virtual_constraints.add(str(dep))
diff --git a/var/spack/repos/builtin.mock/packages/impossible-concretization/package.py b/var/spack/repos/builtin.mock/packages/impossible-concretization/package.py
new file mode 100644
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/impossible-concretization/package.py
@@ -0,0 +1,15 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+class ImpossibleConcretization(Package):
+    """Package that should be impossible to concretize due to a conflict
+    with target ranges. See Issue 19981.
+    """
+
+    homepage = "http://www.example.com"
+    url = "http://www.example.com/example-1.0.tar.gz"
+
+    version(1.0, 'foobarbaz')
+
+    conflicts('target=x86_64:')


Test patch:
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py
--- a/lib/spack/spack/test/concretize.py
+++ b/lib/spack/spack/test/concretize.py
@@ -938,3 +938,8 @@ def test_compiler_match_is_preferred_to_newer_version(self):
 
         assert 'openblas@0.2.13' in s
         assert s['openblas'].satisfies('%gcc@4.4.0')
+
+    @pytest.mark.regression('19981')
+    def test_target_ranges_in_conflicts(self):
+        with pytest.raises(spack.error.SpackError):
+            Spec('impossible-concretization').concretized()