Repository: spack/spack

Issue:
Unable to concretize with Clingo when libyogrt is part of dependency tree
<!-- Explain, in a clear and concise way, the command you ran and the result you were trying to achieve.
Example: "I ran `spack find` to list all the installed packages and ..." -->

### Steps to reproduce the issue
Any of the above result in the same error:
```console
$ spack spec -I libyogrt
$ spack spec -I scr # SCR depends on libyogrt
$ spack spec -I axom # axom depends on SCR
$ spack spec -I macsio # macsio depends on SCR
...
```

### Error Message

<!-- If Spack reported an error, provide the error message. If it did not report an error but the output appears incorrect, provide the incorrect output. If there was no error message and no output but the result is incorrect, describe how it does not match what you expect. -->
```console
Concretized
--------------------------------
==> Error: invalid values for variant "scheduler" in package "libyogrt": ['lsf']
```

I imagine this is because https://github.com/spack/spack/blob/c22141f444861abeaee297a3d92696e9ae94a509/var/spack/repos/builtin/packages/libyogrt/package.py#L39

references an invalid value of the 'scheduler` variant:
https://github.com/spack/spack/blob/c22141f444861abeaee297a3d92696e9ae94a509/var/spack/repos/builtin/packages/libyogrt/package.py#L36

Adding `lsf` to the possible values for `scheduler` fixes the issue, but I am not sure that this fix is correct.

### Information on your system

* **Spack:** 0.16.0
* **Python:** 3.7.2
* **Platform:** linux-rhel7-power9le
* **Concretizer:** clingo


### 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:
This issue is correctly diagnosed in its description. The new concretizer is stricter in certain checks if compared to the original concretizer. Here it fails since the `scheduler=lsf` anonymous spec used in a `conflicts` directive is not an allowed state of `libyogrt`.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/libyogrt/package.py b/var/spack/repos/builtin/packages/libyogrt/package.py
--- a/var/spack/repos/builtin/packages/libyogrt/package.py
+++ b/var/spack/repos/builtin/packages/libyogrt/package.py
@@ -34,13 +34,11 @@ class Libyogrt(AutotoolsPackage):
     variant('scheduler', default='system',
             description="Select scheduler integration",
             values=['system', 'slurm'], multi=False)
-    depends_on('slurm', when='scheduler=slurm')
-
-    conflicts('scheduler=lsf', when='@:1.22')
-
     variant('static', default='False',
             description="build static library")
 
+    depends_on('slurm', when='scheduler=slurm')
+
     def url_for_version(self, version):
         if version < Version(1.21):
             return "https://github.com/LLNL/libyogrt/archive/%s.tar.gz" % version


Test patch: