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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolution by file order instead of alphabetical order #2898

Closed
troykershaw opened this issue Nov 14, 2017 · 7 comments
Closed

Resolution by file order instead of alphabetical order #2898

troykershaw opened this issue Nov 14, 2017 · 7 comments

Comments

@troykershaw
Copy link

Description

When Paket has no way to determine package weight, it defaults to alphabetical order. I would like it to resolve by the order the packages are written in the paket.dependencies file.

Is there a way to do this?

If not, would you welcome a PR that implements it (using a paket.dependencies flag)?

Repro steps

I have a paket.dependencies file that requires two packages Xylophone (not real) and Kafunk (real). The file does not lock a version on either.

nuget Xylophone
nuget Kafunk

The Kafunk library has versions 0.1.8 and 0.1.9.

The Xylophone library has two release (1.0 and 2.0) that depend on Kafunk like so:
v2 : nuget Kafunk =0.1.8
v1 : nuget Kafunk >=0.0.1

Expected behavior

What I would like is to resolve by file order. Xylophone is first in the file, so resolve to 2.0, then resolve Kafunk, which would give 0.1.8

Actual behavior

Paket will try to resolve dependencies in alphabetical order. It starts with Kafunk, gets the latest (0.1.9), then looks for the version of Xylophone that supports 0.1.9. This resolves to Xylophone version 1.0. Like so:

Kafunk (0.1.9)
Xylophone (1.0)

Known workarounds

Lock the version of Kafunk to the version used in the preferred Xylophone.

nuget Xylophone
nuget Kafunk =0.1.8

The problem with this as a solution is that users of Xylophone and Kafunk need to know that not only is there a resolution issue, but they need to manually update the Kafunk version to match the latest Xylophone version.

@forki
Copy link
Member

forki commented Nov 15, 2017 via email

@troykershaw
Copy link
Author

Thanks Steffen, I'll get a PR together and we can discuss from there.

@forki
Copy link
Member

forki commented Nov 15, 2017 via email

@troykershaw
Copy link
Author

Thanks, that's a great help. Would you like this to replace the comparison by name, or should I feature flag it?

@forki
Copy link
Member

forki commented Nov 15, 2017 via email

@forki
Copy link
Member

forki commented Dec 5, 2017

I built that as part of conflict resolution fixes. Release under way

@forki forki closed this as completed in 32baf72 Dec 5, 2017
@troykershaw
Copy link
Author

Thanks Steffen, your change was much cleaner than mine was turning out to be :)
I enjoyed going through the code and seeing how it all works under the hood.

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

No branches or pull requests

2 participants