Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better prerelease docs #5808

Merged
merged 3 commits into from
May 16, 2024
Merged

Better prerelease docs #5808

merged 3 commits into from
May 16, 2024

Conversation

jonasfj
Copy link
Member

@jonasfj jonasfj commented May 13, 2024

I couldn't understand what the thing it said before meant.

Then I saw that I wrote it 5 years ago 馃檲 馃檲 馃檲
Then I saw that the PR was edited twice #1785 馃ぃ 馃ぃ 馃ぃ

So what was:

In certain scenarios with nested dependencies the dependency resolution
algorithm in pub, may pick a pre-release over a stable release.

Became:

Sometimes pub might choose a pre-release instead of a stable release;
this can occur when dependencies are nested.

and eventually what landed was:

If a stable package in the dependency graph depends on a pre-release,
then pub chooses that pre-release instead of a stable release.

There is some discussion of the issue here: #1785 (comment)

I suppose we could also say:

If a stable package in the dependency graph depends on a pre-release,
then pub may choose a pre-release even if a stable release is possible.

Which is closer to what it already said, but I'm not sure we want to assuming anyone knows what a "stable package" is, I certainly don't. It's probably a package that has a stable release, but it feels a bit wild just introduce new terms like that with a formal definition.

Also it's nice to have:

  • The reasoning: "the version solver does not attempt all solutions"
  • The intuition "pub prefers stable releases the same way it prefers newer versions"
  • The practical effect: "this rarely happens in practice"

Feel free to use other words, this is really a corner case.

@dart-github-bot
Copy link
Collaborator

dart-github-bot commented May 13, 2024

Visit the preview URL for this PR (updated for commit 2748f6d):

https://dart-dev--pr5808-jonasfj-patch-4-qxo7z590.web.app

Comment on lines 292 to 294
While `pub` prefers stable releases the same way it prefers newer versions,
the version solver does not attempt all solutions and may pick a prerelease,
even when a resolution that doesn't use prelreases exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could expand to something like:

Suggested change
While `pub` prefers stable releases the same way it prefers newer versions,
the version solver does not attempt all solutions and may pick a prerelease,
even when a resolution that doesn't use prelreases exists.
While `pub` prefers stable releases the same way it prefers newer versions,
the version solver is applying its heuristics greedily, and stops at the first solution it finds. Thus it might end up stuck at a local maximum, with a solution including prereleases even though a solution without those exists.

Copy link
Member Author

@jonasfj jonasfj May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do that, I wouldn't mind -- but it does get rather technical.

Personally, I prefer the shorter less technical thing I wrote. But I don't really care, I just want the nonsense that was there before to go away, and replace it with something that is at-least somewhat sensible.

Even if it's not perfect, it's better than what didn't make sense :D

@atsansone atsansone added the review.await-update Awaiting Updates after Edits label May 13, 2024
jonasfj and others added 2 commits May 16, 2024 13:22
@jonasfj jonasfj requested a review from sigurdm May 16, 2024 11:23
@atsansone atsansone added st.RFM Ready to merge or land and removed review.await-update Awaiting Updates after Edits labels May 16, 2024
@atsansone atsansone merged commit db2367d into main May 16, 2024
10 checks passed
@parlough parlough deleted the jonasfj-patch-4 branch May 24, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
st.RFM Ready to merge or land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants