cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.91k stars 730 forks source link

[DUPLICATE] Tools resolution doesn't respect added 'prerelease' filter #1521

Closed matkoch closed 7 years ago

matkoch commented 7 years ago

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)

This hurts probably the most with build servers.

patriksvensson commented 7 years ago

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

matkoch commented 7 years ago

@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 🙂

patriksvensson commented 7 years ago

@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.

boebeng commented 7 years ago

@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?

gep13 commented 7 years ago

Closing as a duplicate of https://github.com/cake-build/cake/issues/753

daveaglick commented 7 years ago

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.

matkoch commented 7 years ago

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