Skip to content

solver: account for language preferences on reused specs #51417

Merged
alalazo merged 1 commit intospack:developfrom
alalazo:bugfix/language-preference-reuse
Oct 13, 2025
Merged

solver: account for language preferences on reused specs #51417
alalazo merged 1 commit intospack:developfrom
alalazo:bugfix/language-preference-reuse

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Oct 8, 2025

depends on #51416

Due to performance and modeling reasons, the specs that are reused in concretization are represented in the ASP problem with their pure build dependencies trimmed. Since languages are virtual build dependencies this means that on develop preferences of the form:

packages:
  c:
    prefer:
    - llvm

are disregarded for reused specs.

This PR improves the semantics of virtual preferences so that they are respected also for reused specs. It does so without representing their compilers as nodes - so the modeling of the DAG is not steered towards different optimal solutions by the missing compilers.

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Oct 8, 2025

The performance plot is very similar to #51416

radiuss.pr.2.csv
radiuss.develop.csv
comparison

@alalazo alalazo added concretization bugfix Something wasn't working, here's a fix labels Oct 8, 2025
Due to performance and modeling reasons, the specs that are
reused in concretization are represented in the ASP problem
with their pure build dependencies trimmed.

On `develop` this means that any preference of the form:
```yaml
packages:
  c:
    prefer:
    - llvm
```
is "disregarded" for purely reused specs, since the solver
is not aware of the compiler nodes used for them.

This PR improves the semantics of virtual preferences so
that they are respected also for reused specs. It does so
without representing their compilers as nodes - so the modeling
of the DAG is not steered towards different optimal solutions
by the missing compilers.

Signed-off-by: Massimiliano Culpo <[email protected]>
@alalazo alalazo merged commit 3b9f9a2 into spack:develop Oct 13, 2025
33 checks passed
@alalazo alalazo deleted the bugfix/language-preference-reuse branch October 13, 2025 11:26
@alalazo alalazo added the v1.0.3 PRs to backport for v1.0.3 label Oct 13, 2025
@becker33 becker33 mentioned this pull request Jan 10, 2026
@becker33
Copy link
Copy Markdown
Member

This PR does not apply cleanly to the 1.0 release branch, so it will be dropped from 1.0.3

@becker33 becker33 removed the v1.0.3 PRs to backport for v1.0.3 label Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something wasn't working, here's a fix concretization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants