Skip to content

Environment activation/deactivation can demote the command_line config scope #48254

@psakievich

Description

@psakievich

Steps to reproduce

The intention of --fresh is that the concretizer will not try to reuse other specs it knows about. My testing shows that the current selector for reusable specs is still pulling a list from my binary cache.

@jrood-nrel has mentioned to me that he's seen strange behavior unless reuse was turned off in the config for a while but I was never able to reproduce.

Demonstration

Apply this patch:

$ git -C $SPACK_ROOT diff
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 3fd8b9cc8d..0297eeb660 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -4086,6 +4086,8 @@ def solve(
         specs = [s.lookup_hash() for s in specs]
         reusable_specs = self._check_input_and_extract_concrete_specs(specs)
         reusable_specs.extend(self.selector.reusable_specs(specs))
+        print(reusable_specs)
+        assert not reusable_specs
         setup = SpackSolverSetup(tests=tests)
         output = OutputConfiguration(timers=timers, stats=stats, out=out, setup_only=setup_only)
         result, _, _ = self.driver.solve(

and run a solve with --fresh with the environment active

$ spack solve --fresh
[[email protected]/lk2cy2n, [email protected]/5p3ti27, [email protected]/e4mtgdx, [email protected]/7bqwpmg, [email protected]/6wx5pf4, [email protected]/kzmv2td, [email protected]/v3xvf3w, [email protected]/d2tqiqf, [email protected]/xulwldz, [email protected]/mzzmjlj, [email protected]/hioitma, [email protected]/ms2pr5d, [email protected]/etxluaf, [email protected]/xh7n7j3, [email protected]/chhxxu2, [email protected]/gnxrk4v, [email protected]/d7qeg7y, [email protected]/kfidcc3, [email protected]/zrebf7f, [email protected]/afru445, [email protected]/q44nyat, [email protected]/aa2bzfb ... (many many more)]
==> Error:

Other details that might be relevant:

  • The environment has two includes for expanded configs
  • The binary cache is specified in one of the included directories

Error message

No response

Information on your system

  • Spack: 0.23.0.dev0 (43a9c6c)
  • Python: 3.11.9
  • Platform: linux-rhel8-sapphirerapids

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions