Add allow_multiple flag to support multiversion packages#239
Conversation
bcf4955 to
fb74be5
Compare
|
One other example (tbh the only other example I could find) that uses multiversion is A different version of So it's niche but thankfully a simple and unobtrusive feature to implement otherwise. |
| /// see [`Self::forbid_seen`] for why globally-deduplicating is safe. | ||
| /// Also skips registration for packages that allow multiple versions. | ||
| fn register_forbid_target(&mut self, name_id: D::NameId, variable: VariableId) { | ||
| if self.state.allow_multiple_names.contains(name_id) { |
There was a problem hiding this comment.
It likely doesn't matter much but you could probably give the branch predictor a hint here that this path is unlikely to be taken.
fb74be5 to
af6260d
Compare
af6260d to
4f03474
Compare
3db5a60 to
a98bff0
Compare
|
OK, these tests ought to be an improvement. |
| /// | ||
| /// This is actually not ideal, but resolving overlapping ranges to a single common | ||
| /// version would require additional optimization in the solver (e.g. soft forbid clauses | ||
| /// or a post-solve minimization pass). |
There was a problem hiding this comment.
Should I stick to the 70 / 80-width comments? It felt a bit cramped, but that's seemingly the convention in this file.
f58b78b to
97bf78b
Compare
| /// | ||
| /// This is actually NOT ideal - installing only kernel=2 would be optimal - but resolving | ||
| /// overlapping ranges to a single common version would require additional optimization in | ||
| /// the solver (e.g. soft forbid clauses or a post-solve minimization pass). |
There was a problem hiding this comment.
Notable. I'm not particularly fussed about this at the moment but it is probably worth doing eventually.
There was a problem hiding this comment.
Unless you want me to do it now.
97bf78b to
3122b8f
Compare
Add `allow_multiple: bool` to `Candidates`, allowing dependency providers to indicate that multiple versions of a package may coexist in the solution (e.g. kernel packages on RPM systems). When set, the solver skips the at-most-one constraint encoding for that package name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3122b8f to
01e7a1d
Compare
|
@baszalmstra Rebased + rewrote the tests |
Add
allow_multiple: booltoCandidates, allowing dependency providers to indicate that multiple versions of a package may coexist in the solution (e.g. kernel packages on RPM systems). When set, the solver skips the at-most-one constraint encoding for that package name.(multiple co-existing kernels on a system is a common configuration because GRUB can be configured to present previous versions of the kernel as emergency backup boot options)