-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
NuGet 4.4.0 Error Code 1 Packages Already Installed #1892
Comments
I did some investigation on this and I came to the same conclusion, it appears that Cake is using NuGet version 4.3 and there have been changes to NuGet 4.4 that directly apply to the latest windows fall creators update and netstandard builds. If I run the command Environment
Errors
Attempted Solution Work Around
I understand this is a hard coded hack but it solves my problem for now and hopefully this is a suitable workaround for others that run into this problem while we wait for an updated version. Powershell Updates
Note the download path for nuget is changed Nuget:
then at the bottom of the Execute
Just to reiterate - my solution is intended to get my projects by until cake supports NuGet 4.4, I understand it is not the most elegant way to solve this problem. If you choose to use the updates provided there may be side effects with your project. |
@thnk2wn @ahoefling since these issues seems to be related to the bootstrapper that is provided with Cake, I am going to close this issue out, and move it to the resources repo, which is where the bootstrapper lives. |
Issue moved to cake-build/resources #41 via ZenHub |
What You Are Seeing?
Having nuget.exe 4.4.0 in Cake/Tools with packages already installed results in error code 1 "all packages are already installed". This causes build.ps1 to fail early restoring tools/addins and stops the build process. Generally this isn't a problem on the build server with fresh downloads and builds but it happens regularly for local builds. Perhaps LASTEXITCODE changes with NuGet 4.4.0. This version of NuGet was needed for some .NET Standard 2.0 issues.
What is Expected?
Expecting Cake's build.ps1 to detect such "error" (warning at best?) and to proceed regardless of whether packages are already installed.
What version of Cake are you using?
0.23.0
Are you running on a 32 or 64 bit system?
64
What environment are you running on? Windows? Linux? Mac?
Windows 10 Fall Creators Update.
Are you running on a CI Server? If so, which one?
Both CI and local. CI is TeamCity 9.x.
How Did You Get This To Happen? (Steps to Reproduce)
Download NuGet 4.4.0 from https://www.nuget.org/downloads (it appears to be preview currently).
Place this download in Cake/tools.
Invoke the build once via build.ps1, all is fine.
Invoke the build a 2nd time with the packages already installed.
Receive "error" 1 that packages are already installed.
Some more context in this post:
https://geoffhudik.com/tech/2017/10/24/build-blues-with-net-standard-2-0/
Output Log
Possible Issues Here
Cake should perhaps treat exit code 1 with "packages already installed" as not an error that stops the script. Perhaps this behavior changed with Nuget 4.4.0.
The error message indicates neither the exit code nor the nuget output so it says nothing useful to help the situation.
The word "occured" is misspelled - should be "occurred".
When an error happens here, Pop-Location isn't executed so it leaves things at a different location than where things were when the script started, leading to possible issues later.
Ideally there'd be a way to specify the NuGet version (like when referencing Nuget package tools/addins) of NuGet.exe itself instead of having to place a version here and commit to source control. I don't think the Cake build script could even download NuGet as it would have to happen before #tool or #addin and I think those have to be first.
Workaround Changes Made (build.ps1)
The text was updated successfully, but these errors were encountered: