ASP-based solver: account for deprecated versions#23491
ASP-based solver: account for deprecated versions#23491tgamblin merged 1 commit intospack:developfrom
Conversation
|
This is great, this means we have a strong guarantee that no deprecated packages will ever be installed, unless it is unavoidable by the constraints in the packages (e.g. ruby@:2.3) Edit: i think this is even nicer; spack solve ruby@:2.3 toggles ~openssl to avoid installing a deprecated version :D you'd have to specify |
|
@haampie Yeah, the first priority of the solver is to avoid using deprecated versions. It must be obliged to do that to put one into the DAG 😆 |
tgamblin
left a comment
There was a problem hiding this comment.
Looks mostly good to me, but I think we should warn if a deprecated version was the only option. Can you add deprecated/1 to the shown atoms in display.lp and use that to show a warning if the result is deprecated?
|
@tgamblin I added a warning that currently looks like: Let me know if you want it formatted differently |
|
Do you think we should actually error out if only a deprecated version is possible? And have them run with |
|
You could imagine someone using this with a buildcache and —cache-only — it would make you add some config to your env if the only available versions end up being deprecated. |
For security related deprecations like What if we extend packages:
all:
allow_deprecated_versions: Falseand allow people to either override this behavior or selectively opt-out with: packages:
glib:
allow_deprecated_version: True? |
|
Or we could distinguish between 'vulnerable' and 'deprecated'? In case of openssl they deprecated 1.0 after the abi breaking 1.1 release, but only some and not all of 1.0 and 1.1 were known to be vulnerable. |
|
I like @haampie's suggestion but what if we just add a reason for deprecation? version(..., deprecated="vuln")
version(..., deprecated="bug")
version(..., deprecated=True)We could then decide on the solver side how to handle the different categories. |
|
Would this logic (in pseudo-code) be good: if reason is True or reason == 'vuln':
tty.die(msg)
tty.warn(msg)? |
f80e027 to
d96c7db
Compare
|
@tgamblin This is ready for another review Pinging also @adamjstewart and @sethrj since this PR extends what done in #20767 |
lib/spack/docs/packaging_guide.rst
Outdated
| * - 'bug' | ||
| - Serious bugs reported | ||
| * - 'unavailable' | ||
| - No longer available for download |
There was a problem hiding this comment.
Should there be an "unsupported" category indicating that the version series is no longer maintained and may eventually be incompatible with newer OS frameworks (often seen for GUI packages on macOS) or more strict compilers?
There was a problem hiding this comment.
I'm absolutely open to modify this list, either adding new reasons or removing ones that are already there.The current implementation allows the use of any string as a deprecation reason, so adding new reasons in the future should just be matter of documenting them.
Fair point, let me know if you have suggestions. I interpreted |
|
I personally don't love this solution. As mentioned in https://spack.readthedocs.io/en/latest/packaging_guide.html#deprecating-old-versions, there are many different reasons why a version could be deprecated. I don't see any point in enumerating all of those reasons. Instead, I would keep |
|
I tend to agree with @adamjstewart because of the potential granularity issues with descriptions. It might be helpful to look at a couple of example cases and try to classify how/why they'd be "deprecated". For example, OpenSSL regularly fixes bugs in older versions, but the bugs are various levels of severity. Similarly, its "vulnerabilities" are classified into levels of severity as well -- would you mark an older version with a significant bug and a minor vulnerability as A simple boolean avoids having to ask those kind of difficult questions. A version should be non-deprecated if and only if it's the latest patch of a still-supported branch. Examples:
However there might be room for a middle ground:
...but again there we start worrying about granularity in the deprecation scale. Ultimately I think this is like trying to give something a 5-star rating vs thumbs up/down. Fewer options tends toward less subjectivity in how a version will be graded. |
|
Thinking about it a bit more, it seems to me that a concretization error for a deprecated package may be a bit too pedantic. (Maybe someone needs an old version of Ruby for some reason?) As long as it's explicitly confirmed by the user (which is the default already) it should be OK? In automated builds it'll fail unless you add the |
|
Oh I missed that the default is now to raise an error for deprecated versions. It seems to me that the config option should be a 'silent/verbose/error' choice when concretization results in deprecated packages. And that perhaps deprecated versions whose source is completely unavailable (heaven forfend) do need a special treatment that errors out on concretization rather than at fetch time... but then again there are the cases of externally installed packages as well as alternative source caches... so maybe fetch-time is the right way to handle that. |
|
I'm personally fine with any solution be it minimal or with more fine-grained control on what deprecation means. The first commit in this PR is sufficient for
I think the definition of "avoid" enters this PR. Would that mean "avoid if not absolutely necessary" or "error if I need to use a deprecated version"? What I can do as a middle ground is to move to concretization the behavior that is now in the fetcher:
and leave |
|
I think it would be a good idea to split this into two separate PRs, it sounds like the first commit is non-controversial. As for whether it should error or warn, I don't have a strong preference. If the only possible way to install a particular configuration is to use a deprecated version, I think we should allow that. |
d96c7db to
49e7c03
Compare
|
Went back to a minimal version that tries to avoid deprecated versions and warn users if they end up in the spec. |
tgamblin
left a comment
There was a problem hiding this comment.
I think it's probably best to split this into two PRs as @adamjstewart said.
|
@alalazo looks like this is now conflicted. |
fixes spack#22351 The ASP-based solver now accounts for the presence in the DAG of deprecated versions and tries to minimize their number at highest priority.
36b9f25
49e7c03 to
36b9f25
Compare
|
@tgamblin Already split, conflict resolved |
|
Thanks! :) |
fixes spack#22351 The ASP-based solver now accounts for the presence in the DAG of deprecated versions and tries to minimize their number at highest priority.


fixes #22351
The ASP-based solver now accounts for the presence in the DAG of deprecated versions and tries to minimize their number at highest priority.