SharpeRAD / Cake.Powershell

Powershell addin for Cake
http://cakebuild.net
MIT License
83 stars 36 forks source link

Cake Core 0.27 introduced a bug with Cake.Powershell #55

Closed eddie3716 closed 6 years ago

eddie3716 commented 6 years ago

FYI, how your add-in resolves its dependencies is broken with new version Cake core 0.27. When I switch back to 0.26.1, I no longer receive this error

`======================================== PackagePowershell

Executing task: PackagePowershell Executing: Write-Host "Testing..." Resolving assembly System.Management.Automation.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35 Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Resolving assembly System.Management.Automation.resources Cake.exe : At line:1 char:1

Resolving assembly System.Management.Automation.resources Process is terminated due to StackOverflowException.`

SharpeRAD commented 6 years ago

Thanks for reporting this.

@patriksvensson any idea whats causing this as the dependencies haven't changed?

patriksvensson commented 6 years ago

@SharpeRAD No idea. Probably a question for @mholo65

patriksvensson commented 6 years ago

Perhaps @daveaglick knows something as well.

bjorkstromm commented 6 years ago

Oh, seems like infinite recursion was introduced when switching to NuGet 4.6.0 libs... Need to look into this.

daveaglick commented 6 years ago

That’s very strange - the “Resolving assembly” bit is from the new handler I added, but I’ve never seen that event recurse like this. It’s only called when default resolution fails, so it’s a last-ditch effort (shouldn’t be making anything worse).

What’s interesting is that we should see a message about resolution failing or succeeding right afterwards...oh, I think I see the problem. The handler calls Assembly.Load() - which if the assembly truly isn’t available could trigger...the handler.

I’ll submit a fix today. Solution is probably to cache the failed resolution names and skip our last-ditch resolution if we’ve seen it before.

gep13 commented 6 years ago

@eddie3716 @SharpeRAD we have just released 0.27.1 of Cake which we believe will correct that issue that you are seeing here. Can you please take it for a spin, and let us know if you continue to have problems?

SharpeRAD commented 6 years ago

Should be resolved with Cake v0.27.1, please re-open this issue if you are still experiencing problems.

ghost commented 6 years ago

I think it may be related to the .net core problem (at least it looks similar) - https://github.com/dotnet/coreclr/issues/14033 The solution was adding this to the .csproj:

<RuntimeFrameworkVersion>2.0.5</RuntimeFrameworkVersion>
mdenny-visaglobal commented 6 years ago

I'm seeing the same issue and am running in v0.27.1

Johnwrnd commented 6 years ago

How do you switch back to 0.26.1?

eddie3716 commented 6 years ago

@Johnwrnd i keep cake's package.config in my source control.

`<?xml version="1.0" encoding="utf-8"?>

`
Johnwrnd commented 6 years ago

Thanks for the reply! i just had the same idea and already fixed my issue that way.

eddie3716 commented 6 years ago

This was fixed a while back