Skip to content

[WIP] Ignoring pre-release status when checking against resolved packages - #2474

Merged
forki merged 4 commits into
fsprojects:masterfrom
stendavid:dsm-prerelease-check
Jun 30, 2017
Merged

forki merged 4 commits into
fsprojects:masterfrom
stendavid:dsm-prerelease-check

Conversation

@stendavid

Copy link
Copy Markdown

Ignoring pre-release status of a new requirement when checking it against packages that have already been resolved. #2471

The thinking is that if something dragged in a pre-relase version (e.g. the dependencies file) then we actually want pre-release of that package.

In my testing this seems to work. Even if the pre-release status is ignored in IsInRange(), the actual pre-release versions are still compared, so a requirement ">=2.0" will fail if a resolved package has version "2.0-pre". Could use some checking from someone who knows the code better though.

…solved versions.

The thinking is that if something dragged in a pre-relase version (e.g. the dependencies file) then we actually want it. Add tests to verify the behaviour of IsInRange(). #2471
@matthid matthid changed the title Ignoring pre-release status when checking against resolved packages [WIP] Ignoring pre-release status when checking against resolved packages Jun 30, 2017
@matthid

matthid commented Jun 30, 2017 •

Copy link
Copy Markdown
Member

I want to add some test-cases to this before we merge it :)

We can add these to the resolver unit tests...

See #2558

@forki

forki commented Jun 30, 2017

Copy link
Copy Markdown
Member

@zzDavid I think it's not 100% correct. I pushed to your fork (github allows that) to extend your PR. see 08dec38

@forki

forki commented Jun 30, 2017

Copy link
Copy Markdown
Member

pushed @Stift's tests

@stendavid

Copy link
Copy Markdown
Author

@forki if I read the change correctly, you only allow pre-release on packages in the dependencies file? Might that not be too limiting? I was actually happy to allow pre-release unconditionally here since it has already been resolved. We're only checking if the new requirement is ok here, so the proper thing to do is to trust that the resolution is correct and check the version as it is.

Just want to raise the question. If you say this is the way it should be, I'll take your word for it :)

@forki

forki commented Jun 30, 2017 •

Copy link
Copy Markdown
Member

@zzDavid yes it's actually needed to restrict it. Otherwise you will end up with following situation:

depsfile:

nuget A

resolution goes:

A 1.1 (deps: B >= 0 prerelease)

A 1.1 
B 1.1-alpha (deps: C >= 0 prerelese)

A 1.1 
B 1.1-alpha 
C 1.2 (deps: B >= 0)

^^ this would be valid with your change, but I think it should not

@forki
forki merged commit 1276e44 into fsprojects:master Jun 30, 2017
@stendavid

Copy link
Copy Markdown
Author

@forki It looks like a bug in package A (without prerelease) if it depends on a prerelase of B. With package A in pre-relase it makes sense.

nuget A alpha

with the resolution

A 1.1-alpha (deps: B >= 0 prerelease)
B 1.1-alpha
C 1.2 (deps: B >= 0)

The resolution looks correct to me, at least if A and B are developed together, and worked in 4.8.8 but will fail now.

@forki

forki commented Jun 30, 2017

Copy link
Copy Markdown
Member

Ok let's say D introduces the B >= 0 restriction. Doesn't matter - point is something later can still need it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants