Cake: [DUPLICATE] Tools resolution doesn't respect added 'prerelease' filter

Created on 6 Mar 2017  路  7Comments  路  Source: cake-build/cake

What You Are Seeing?

Tool "GitVersion" was not updated to v4.0.0-betaxxxx.

What is Expected?

An update.

What version of Cake are you using?

Latest I guess on Win10/x64.

How Did You Get This To Happen? (Steps to Reproduce)

  • Had #tool "nuget:?package=GitVersion.CommandLine"
  • Changed to #tool "nuget:?package=GitVersion.CommandLine&prerelease"
  • Nupkg inside tools folder was still the stable release

This hurts probably the most with build servers.

All 7 comments

@matkoch You will need to clear the folder manually before the new version will be downloaded.

@patriksvensson Shouldn't the #tool directive always pick the highest possible package, if no version was specified? I think that makes sense.

If not, it would violate consistency/determinism. Suppose you have two machines with the same script, but different tool versions. Sounds like a big pitfall to me.

Update

I've just checked, when prerelease was first in place, and an actual prerelease package was installed in tools folder, when I then remove prerelease from the #tool directive, it still uses the prerelease package. Sorry, but this is really strange 馃檪

@matkoch Not strange. You might notice that the tools folders are not versioned. We simply assume that the versions are correct. There is an issue for fixing all this, but nothing that is being actively worked on.

@patriksvensson Is there any progress on this? I recently started with Cake build and it seems quite interesting and we would like to replace psake with Cake build. This issue is somehow blocking me.
Is there a workaround? For example an automatism to delete the tools folder upfront?

For anyone interested in this issue, there's an easy workaround. I just stick this in my PowerShell bootstraper:

# Delete the tools and addins folders
Remove-Item $TOOLS_DIR\* -Force -Recurse -ErrorAction Ignore

You can make it more specific too if you know it's only one tool or addin you want to ensure is always fresh.

@daveaglick thanks, -ErrorAction Stop would be better I think. Otherwise you could have strange side effects again.

Was this page helpful?
0 / 5 - 0 ratings