summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-11-06 15:35:04 +0100
committerGitHub <noreply@github.com>2024-11-06 14:35:04 +0000
commitd09b185522d663d24273d2e34b8d7cb0d877eb76 (patch)
treed1f8ff9f9cc63431841be6fc19074e4b902fe2c1
parenta31c525778773b8c6a6fc35617454d954a05d74d (diff)
downloadspack-d09b185522d663d24273d2e34b8d7cb0d877eb76.tar.gz
spack-d09b185522d663d24273d2e34b8d7cb0d877eb76.tar.bz2
spack-d09b185522d663d24273d2e34b8d7cb0d877eb76.tar.xz
spack-d09b185522d663d24273d2e34b8d7cb0d877eb76.zip
Fix various bootstrap/concretizer import issues (#47467)
-rw-r--r--lib/spack/spack/cmd/__init__.py1
-rw-r--r--lib/spack/spack/concretize.py13
-rw-r--r--lib/spack/spack/environment/environment.py2
-rw-r--r--lib/spack/spack/solver/asp.py3
4 files changed, 10 insertions, 9 deletions
diff --git a/lib/spack/spack/cmd/__init__.py b/lib/spack/spack/cmd/__init__.py
index 7cf032c907..e9df5fc189 100644
--- a/lib/spack/spack/cmd/__init__.py
+++ b/lib/spack/spack/cmd/__init__.py
@@ -17,6 +17,7 @@ from llnl.util.lang import attr_setdefault, index_by
from llnl.util.tty.colify import colify
from llnl.util.tty.color import colorize
+import spack.concretize
import spack.config # breaks a cycle.
import spack.environment as ev
import spack.error
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 122e6c59c0..cccfc02bd0 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -10,8 +10,11 @@ from typing import Iterable, Optional, Sequence, Tuple, Union
import llnl.util.tty as tty
+import spack.compilers
import spack.config
import spack.error
+import spack.repo
+import spack.util.parallel
from spack.spec import ArchSpec, CompilerSpec, Spec
CHECK_COMPILER_EXISTENCE = True
@@ -87,6 +90,8 @@ def concretize_together_when_possible(
tests: list of package names for which to consider tests dependencies. If True, all nodes
will have test dependencies. If False, test dependencies will be disregarded.
"""
+ import spack.solver.asp
+
to_concretize = [concrete if concrete else abstract for abstract, concrete in spec_list]
old_concrete_to_abstract = {
concrete: abstract for (abstract, concrete) in spec_list if concrete
@@ -119,6 +124,8 @@ def concretize_separately(
tests: list of package names for which to consider tests dependencies. If True, all nodes
will have test dependencies. If False, test dependencies will be disregarded.
"""
+ import spack.bootstrap
+
to_concretize = [abstract for abstract, concrete in spec_list if not concrete]
args = [
(i, str(abstract), tests)
@@ -155,11 +162,7 @@ def concretize_separately(
for j, (i, concrete, duration) in enumerate(
spack.util.parallel.imap_unordered(
- spack.concretize._concretize_task,
- args,
- processes=num_procs,
- debug=tty.is_debug(),
- maxtaskperchild=1,
+ _concretize_task, args, processes=num_procs, debug=tty.is_debug(), maxtaskperchild=1
)
):
ret.append((i, concrete))
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
index 7cf1057fa5..de4bc85100 100644
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -24,7 +24,6 @@ from llnl.util.symlink import readlink, symlink
import spack
import spack.caches
-import spack.compilers
import spack.concretize
import spack.config
import spack.deptypes as dt
@@ -43,7 +42,6 @@ import spack.user_environment as uenv
import spack.util.environment
import spack.util.hash
import spack.util.lock as lk
-import spack.util.parallel
import spack.util.path
import spack.util.spack_json as sjson
import spack.util.spack_yaml as syaml
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 56014717dd..b723b6bbb2 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -27,7 +27,6 @@ from llnl.util.lang import elide_list
import spack
import spack.binary_distribution
-import spack.bootstrap.core
import spack.compilers
import spack.concretize
import spack.config
@@ -816,7 +815,7 @@ class PyclingoDriver:
solve, and the internal statistics from clingo.
"""
# avoid circular import
- import spack.bootstrap
+ import spack.bootstrap.core
output = output or DEFAULT_OUTPUT_CONFIGURATION
timer = spack.util.timer.Timer()