Add a deprecation warning when using the old concretizer (#25966)

This commit is contained in:
Massimiliano Culpo 2021-09-16 13:25:24 +02:00 committed by GitHub
parent b09ad2cc8c
commit fa6366a7df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,6 +82,7 @@
import os
import re
import sys
import warnings
import ruamel.yaml as yaml
import six
@ -2399,6 +2400,13 @@ def _old_concretize(self, tests=False):
"""
import spack.concretize
# Add a warning message to inform users that the original concretizer
# will be removed in v0.18.0
msg = ('the original concretizer is currently being used.\n\tUpgrade to '
'"clingo" at your earliest convenience. The original concretizer '
'will be removed from Spack starting at v0.18.0')
warnings.warn(msg)
if not self.name:
raise spack.error.SpecError(
"Attempting to concretize anonymous spec")