From 675a182f14edc943da747026212c0f7a7c523f4f Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Mon, 24 Mar 2025 18:07:59 -0700 Subject: [PATCH] Ignore provider weights for runtimes Runtimes are inherently tied to the associated compilers, and choices among runtimes should be delegated to the compiler prioritization criteria not the provider weights. This fixes a bug causing concretization to mix compilers more than necessary to avoid using the runtime associated with the compiler specified for the root. E.g. `foo%oneapi` building dependencies with `%gcc` to minimize edges on which `intel-oneapi-runtime` provides `fortran-rt`. Signed-off-by: Gregory Becker --- lib/spack/spack/solver/concretize.lp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 5e3f3b82ed5..ec26ea60648 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -1682,10 +1682,11 @@ opt_criterion(45, "preferred providers (non-roots)"). #minimize{ 0@245: #true }. #minimize{ 0@45: #true }. #minimize{ - Weight@45+Priority,ProviderNode,Virtual - : provider_weight(ProviderNode, Virtual, Weight), - not attr("root", ProviderNode), - build_priority(ProviderNode, Priority) + Weight@45+Priority,X,Provider,Virtual + : provider_weight(node(X, Provider), Virtual, Weight), + not attr("root", node(X, Provider)), + build_priority(node(X, Provider), Priority), + not runtime(Provider) }. % Try to minimize the number of compiler mismatches in the DAG.