Skip to content

Commit 5d1b855

Browse files
committed
Review
1 parent f7775a3 commit 5d1b855

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

src/limitations/prerelease_versions.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ version but not both.
5151

5252
Another issue would be that the proxy and bucket scheme breaks strategies
5353
depending on ordering of versions. Since we have two proxy versions, one
54-
targetting the normal bucket, and one targetting the pre-release bucket, a
54+
targeting the normal bucket, and one targeting the pre-release bucket, a
5555
strategy aiming at the newest versions will lean towards normal or pre-release
5656
depending if the newest proxy version is the one for the normal or pre-release
5757
bucket. Mitigating this issue seems complicated, but hopefully, we are also
5858
exploring alternative API changes that could enable pre-releases.
5959

6060
## Multi-dimensional ranges
6161

62-
Building on top of the `Ranges` API, we could implement a custom `VersionSet` of
62+
Building on top of the `Ranges` API, we can implement a custom `VersionSet` of
6363
multi-dimensional ranges:
6464

6565
```rust
@@ -69,10 +69,9 @@ pub struct DoubleRange<V1: Version, V2: Version> {
6969
}
7070
```
7171

72-
With multi-dimensional ranges we could match the semantics of version
73-
constraints in ways that do not introduce alterations of the core of the
74-
algorithm. For example, the constraint `2.0.0-alpha <= v < 2.0.0` could be
75-
matched to:
72+
With multi-dimensional ranges we can match the semantics of version constraints
73+
in ways that do not introduce alterations of the core of the algorithm. For
74+
example, the constraint `2.0.0-alpha <= v < 2.0.0` can be matched to:
7675

7776
```rust
7877
DoubleRange {
@@ -81,18 +80,13 @@ DoubleRange {
8180
}
8281
```
8382

84-
And the constraint `2.0.0-alpha <= v < 2.1.0` would have the same
85-
`prerelease_range` but would have `2.0.0 <= v < 2.1.0` for the normal range.
86-
Those constraints could also be interpreted differently since not all
87-
pre-release systems work the same. But the important property is that this
88-
enables a separation of the dimensions that do not behave consistently with
89-
regard to the mathematical properties of the sets manipulated.
83+
And the constraint `2.0.0-alpha <= v < 2.1.0` has the same `prerelease_range`
84+
but has `2.0.0 <= v < 2.1.0` for the normal range. Those constraints could also
85+
be interpreted differently since not all pre-release systems work the same. But
86+
the important property is that this enables a separation of the dimensions that
87+
do not behave consistently with regard to the mathematical properties of the
88+
sets manipulated.
9089

91-
All this needs more experimentation, to try reaching a sweet spot API-wise and
92-
performance-wise. If you are eager to experiment with all the extensions and
93-
limitations mentioned in this section of the guide for your dependency provider,
94-
don't hesitate to reach out to us in our [zulip stream][zulip] or in [GitHub
95-
issues][issues] to let us know how it went!
96-
97-
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/260232-t-cargo.2FPubGrub
98-
[issues]: https://github.com/pubgrub-rs/pubgrub/issues
90+
This strategy is successfully used by
91+
[semver-pubgrub](https://github.com/pubgrub-rs/semver-pubgrub) to model rust
92+
dependencies.

src/pubgrub_crate/solution.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ In such cases, the algorithm returns a
77
`PubGrubError::NoSolution(derivation_tree)` where the provided derivation tree
88
is a binary tree containing the chain of reasons why there is no solution.
99

10-
The items in the tree are called incompatibilities and may be either external.
11-
Leaves of the tree are external and custom incompatibilities, and nodes are
12-
derived. External incompatibilities express facts that are independent of the
13-
way this algorithm is implemented such as package "a" at version 1 depends on
14-
package "b" at version 4, or that there is no version of package "a" higher than
15-
version 5. Custom incompatibilities are a user provided generic type parameter
16-
that can express missing versions, such as that dependencies of package "a" are
17-
not in cache, but the user requested an offline resolution.
10+
The items in the tree are called incompatibilities and may be either external,
11+
derived or custom. Leaves of the tree are external and custom incompatibilities,
12+
and nodes are derived. External incompatibilities express facts that are
13+
independent of the way this algorithm is implemented such as package "a" at
14+
version 1 depends on package "b" at version 4, or that there is no version of
15+
package "a" higher than version 5. Custom incompatibilities are a user provided
16+
generic type parameter that can express missing versions, such as that
17+
dependencies of package "a" are not in cache, but the user requested an offline
18+
resolution.
1819

1920
In contrast, derived incompatibilities are obtained during the algorithm
2021
execution by deduction, such as if "a" depends on "b" and "b" depends on "c",

0 commit comments

Comments
 (0)