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

Misleading output message when trying to install prerelease package with the in-process nuget installer #2595

Closed
nalla opened this issue Aug 9, 2019 · 6 comments · Fixed by #2924
Milestone

Comments

@nalla
Copy link
Contributor

nalla commented Aug 9, 2019

What You Are Seeing?

When loading a script package via the preprocessor directive, the loading fails because the behavior of the in process nuget installer changed. Before 0.34.1 it allowed to install nuget packages with prelease versions without explicitly adding the &prerelease statement.

The current implementation in 0.34.1 will result in a misleading output message rather stating the fact that it was not possible to find a release version with the given version number.

// works!
#load "nuget:?package=My.Cool.Script.Package&version=12.2.1.171"

// does not work, console just throws No scripts found in NuGet package My.Cool.Script.Package
#load "nuget:?package=My.Cool.Script.Package&version=12.3.1-rc0001.174"

What is Expected?

// works!
#load "nuget:?package=My.Cool.Script.Package&version=12.2.1.171"

// works!
// or
// Unable to find release package in specified version.
#load "nuget:?package=My.Cool.Script.Package&version=12.3.1-rc0001.174"

What version of Cake are you using?

0.34.1

Are you running on a 32 or 64 bit system?

64

What environment are you running on? Windows? Linux? Mac?

Windows

@bjorkstromm
Copy link
Member

@cake-build/cake-team opinion time! Should we

a) go back to initial behavior, and install prerelease package even though prerelease=true is not specified in directive?

Or

b) Throw an exception explaining that users must set prerelease=true in directive in order to install a pre-release package.

IIRC, option a) is in conflict on how nuget.exe works. But e.g. <PackageReference> works as in option a).

@devlead
Copy link
Member

devlead commented Aug 9, 2019

@cake-build/cake-team I vote for a, think there's already an open issue around this.

@gep13
Copy link
Member

gep13 commented Aug 10, 2019

I tend to agree with @devlead here. If the version is explicitly specified the assumption is the user wants that specific version. Obviously, if the version isn’t specified, only the latest non pre-release version should be resolved, unless they add the prerelease flag.

@Jericho
Copy link
Contributor

Jericho commented Sep 9, 2019

I also agree with @devlead and @gep13: If a version was explicitly specified we should honor it.

If we chose option a, wouldn't prerelease become useless?

@bjorkstromm
Copy link
Member

@Jericho

If we chose option a, wouldn't prerelease become useless?

No, this is the exact behaviour prior to 0.34.x, prerelease is only useful if a version is not specified. But if a version is specified, then the prerelease flag is useless.

@cake-build-bot
Copy link

🎉 This issue has been resolved in version v1.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

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

Successfully merging a pull request may close this issue.

6 participants