Skip to content

concretize.lp: drop 0 weight of external providers#45025

Merged
alalazo merged 1 commit intodevelopfrom
hs/fix/drop-external-provider-nondeterminism
Jul 11, 2024
Merged

concretize.lp: drop 0 weight of external providers#45025
alalazo merged 1 commit intodevelopfrom
hs/fix/drop-external-provider-nondeterminism

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Jul 3, 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 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:

mpi:
  require: [mpich]

or

mpi:
  buildable: false

which is well-documented.

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.
@spackbot-app spackbot-app bot added core PR affects Spack core functionality stand-alone-tests Stand-alone (or smoke) tests for installed packages tests General test capability(ies) labels Jul 3, 2024
@alalazo alalazo merged commit 5c53973 into develop Jul 11, 2024
@alalazo alalazo deleted the hs/fix/drop-external-provider-nondeterminism branch July 11, 2024 13:29
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality stand-alone-tests Stand-alone (or smoke) tests for installed packages tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants