concretize.lp: drop 0 weight of external providers#45025
Merged
Conversation
If an external happens to be a provider of anything, the solver would set its weight to 0, meaning that it is most preferred, even if packages.yaml config disagrees. That was done so that `spack external find mpich` would be sufficent to pick it up as mpi provider. That may have made sense for mpi specifically, but doesn't make sense for other virtuals. For example `glibc` provides iconv, and is an external by design, but it's better to use libiconv as a separate package as a provider. What's worse: weight 0 leads to non-deterministic solutions. Therefore, drop this rule, and instead let users add config: ``` mpi: require: [mpich] ``` or ``` mpi: buildable: false ``` which is well-documented.
alalazo
approved these changes
Jul 11, 2024
diehlpk
pushed a commit
to diehlpk/spack
that referenced
this pull request
Aug 14, 2024
If an external happens to be a provider of anything, the solver would set its weight to 0, meaning that it is most preferred, even if packages.yaml config disagrees. That was done so that `spack external find mpich` would be sufficent to pick it up as mpi provider. That may have made sense for mpi specifically, but doesn't make sense for other virtuals. For example `glibc` provides iconv, and is an external by design, but it's better to use libiconv as a separate package as a provider. Therefore, drop this rule, and instead let users add config: ``` mpi: require: [mpich] ``` or ``` mpi: buildable: false ``` which is well-documented.
FrederickDeny
pushed a commit
to FrederickDeny/spack
that referenced
this pull request
Aug 26, 2024
If an external happens to be a provider of anything, the solver would set its weight to 0, meaning that it is most preferred, even if packages.yaml config disagrees. That was done so that `spack external find mpich` would be sufficent to pick it up as mpi provider. That may have made sense for mpi specifically, but doesn't make sense for other virtuals. For example `glibc` provides iconv, and is an external by design, but it's better to use libiconv as a separate package as a provider. Therefore, drop this rule, and instead let users add config: ``` mpi: require: [mpich] ``` or ``` mpi: buildable: false ``` which is well-documented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If an external happens to be a provider of anything, the solver would
set its weight to 0, meaning that it is most preferred, even if
packages.yaml config disagrees.
That was done so that
spack external find mpichwould be sufficent topick it up as mpi provider.
That may have made sense for mpi specifically, but doesn't make sense
for other virtuals. For example
glibcprovidesiconv, and is anexternal by design, but it's better to use libiconv as a provider.
What's worse: weight 0 can lead to non-deterministic solutions, as
multiple providers can have identical weight. There is no tie-break.
Therefore, drop this rule, and instead let users add config:
or
which is well-documented.