From 1ddad522a4b1527d337bfface0a62b26b8520347 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 23 Feb 2022 10:46:52 +0100 Subject: Move early exit for setup only argument (#29041) See https://github.com/spack/spack/pull/28468/files#r809156986 If we exit before generating the: error("Dependencies must have compatible OS's with their dependents"). ... facts we'll output a problem that is effectively different by the one solved by clingo. --- lib/spack/spack/solver/asp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index bc26619d6c..4650255271 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -566,10 +566,6 @@ class PyclingoDriver(object): setup.setup(self, specs) timer.phase("setup") - # If we're only doing setup, just return an empty solve result - if setup_only: - return Result(specs) - # read in the main ASP program and display logic -- these are # handwritten, not generated, so we load them as resources parent_dir = os.path.dirname(__file__) @@ -588,6 +584,10 @@ class PyclingoDriver(object): path = os.path.join(parent_dir, 'concretize.lp') parse_files([path], visit) + # If we're only doing setup, just return an empty solve result + if setup_only: + return Result(specs) + # Load the file itself self.control.load(os.path.join(parent_dir, 'concretize.lp')) self.control.load(os.path.join(parent_dir, "display.lp")) -- cgit v1.2.3-60-g2f50