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

v0.34.0 fails on scripts using the dynamic keyword #2575

Closed
dieterv opened this issue Jul 17, 2019 · 7 comments

Comments

@dieterv
Copy link

commented Jul 17, 2019

What You Are Seeing?

Preparing to run build script...
Running build script...
Module directory does not exist.
NuGet Config not specified. Will use NuGet default mechanism for resolving it.
Analyzing build script...
Analyzing C:/GitLab-Runner/builds/redacted/build.cake...
Processing build script...
Installing tools...
Installing addins...
The addin Cake.Figlet will reference Cake.Figlet.dll.
The addin Cake.FileHelpers will reference Cake.FileHelpers.dll.
The addin Cake.Incubator will reference Cake.Incubator.dll.
The addin Cake.ProGet will reference Cake.ProGet.dll.
Verifying assembly 'Cake.Figlet, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.FileHelpers, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.Incubator, Version=5.0.1.0, Culture=neutral, PublicKeyToken=null'.
Verifying assembly 'Cake.ProGet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
The assembly 'Cake.ProGet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
is referencing an older version of Cake.Core (0.28.1).
For best compatibility it should target Cake.Core version 0.33.0.
Adding assembly reference to mscorlib.dll...
Adding assembly reference to System.Core.dll...
Adding assembly reference to Cake.Core.dll...
Adding assembly reference to Cake.Common.dll...
Adding assembly reference to Cake.exe...
Adding assembly reference to System.dll...
Adding assembly reference to System.Xml.dll...
Adding assembly reference to System.Xml.Linq.dll...
Adding assembly reference to System.Data.dll...
Adding assembly reference to System.Runtime.dll...
Adding assembly reference to System.Collections.dll...
Adding assembly reference to System.Net.Http.dll...
Adding assembly reference to netstandard.dll...
Adding assembly reference to Cake.Figlet.dll...
Adding assembly reference to Cake.FileHelpers.dll...
Adding assembly reference to Cake.Incubator.dll...
Adding assembly reference to Cake.ProGet.dll...
Importing namespace Cake.Common...
Importing namespace Cake.Common.Build...
Importing namespace Cake.Common.Build.AppVeyor...
Importing namespace Cake.Common.Build.AppVeyor.Data...
Importing namespace Cake.Common.Build.Bamboo...
Importing namespace Cake.Common.Build.Bamboo.Data...
Importing namespace Cake.Common.Build.BitbucketPipelines...
Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
Importing namespace Cake.Common.Build.Bitrise...
Importing namespace Cake.Common.Build.Bitrise.Data...
Importing namespace Cake.Common.Build.ContinuaCI...
Importing namespace Cake.Common.Build.ContinuaCI.Data...
Importing namespace Cake.Common.Build.GitLabCI...
Importing namespace Cake.Common.Build.GitLabCI.Data...
Importing namespace Cake.Common.Build.GoCD...
Importing namespace Cake.Common.Build.GoCD.Data...
Importing namespace Cake.Common.Build.Jenkins...
Importing namespace Cake.Common.Build.Jenkins.Data...
Importing namespace Cake.Common.Build.MyGet...
Importing namespace Cake.Common.Build.TeamCity...
Importing namespace Cake.Common.Build.TFBuild...
Importing namespace Cake.Common.Build.TFBuild.Data...
Importing namespace Cake.Common.Build.TravisCI...
Importing namespace Cake.Common.Build.TravisCI.Data...
Importing namespace Cake.Common.Diagnostics...
Importing namespace Cake.Common.IO...
Importing namespace Cake.Common.IO.Paths...
Importing namespace Cake.Common.Net...
Importing namespace Cake.Common.Security...
Importing namespace Cake.Common.Solution...
Importing namespace Cake.Common.Solution.Project...
Importing namespace Cake.Common.Solution.Project.Properties...
Importing namespace Cake.Common.Solution.Project.XmlDoc...
Importing namespace Cake.Common.Text...
Importing namespace Cake.Common.Tools...
Importing namespace Cake.Common.Tools.Cake...
Importing namespace Cake.Common.Tools.Chocolatey...
Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
Importing namespace Cake.Common.Tools.Chocolatey.Config...
Importing namespace Cake.Common.Tools.Chocolatey.Download...
Importing namespace Cake.Common.Tools.Chocolatey.Features...
Importing namespace Cake.Common.Tools.Chocolatey.Install...
Importing namespace Cake.Common.Tools.Chocolatey.New...
Importing namespace Cake.Common.Tools.Chocolatey.Pack...
Importing namespace Cake.Common.Tools.Chocolatey.Pin...
Importing namespace Cake.Common.Tools.Chocolatey.Push...
Importing namespace Cake.Common.Tools.Chocolatey.Sources...
Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
Importing namespace Cake.Common.Tools.DotCover...
Importing namespace Cake.Common.Tools.DotCover.Analyse...
Importing namespace Cake.Common.Tools.DotCover.Cover...
Importing namespace Cake.Common.Tools.DotCover.Merge...
Importing namespace Cake.Common.Tools.DotCover.Report...
Importing namespace Cake.Common.Tools.DotNetCore...
Importing namespace Cake.Common.Tools.DotNetCore.Build...
Importing namespace Cake.Common.Tools.DotNetCore.BuildServer...
Importing namespace Cake.Common.Tools.DotNetCore.Clean...
Importing namespace Cake.Common.Tools.DotNetCore.Execute...
Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
Importing namespace Cake.Common.Tools.DotNetCore.Pack...
Importing namespace Cake.Common.Tools.DotNetCore.Publish...
Importing namespace Cake.Common.Tools.DotNetCore.Restore...
Importing namespace Cake.Common.Tools.DotNetCore.Run...
Importing namespace Cake.Common.Tools.DotNetCore.Test...
Importing namespace Cake.Common.Tools.DotNetCore.Tool...
Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
Importing namespace Cake.Common.Tools.DupFinder...
Importing namespace Cake.Common.Tools.Fixie...
Importing namespace Cake.Common.Tools.GitLink...
Importing namespace Cake.Common.Tools.GitReleaseManager...
Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
Importing namespace Cake.Common.Tools.GitReleaseManager.Label...
Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
Importing namespace Cake.Common.Tools.GitReleaseNotes...
Importing namespace Cake.Common.Tools.GitVersion...
Importing namespace Cake.Common.Tools.ILMerge...
Importing namespace Cake.Common.Tools.ILRepack...
Importing namespace Cake.Common.Tools.InnoSetup...
Importing namespace Cake.Common.Tools.InspectCode...
Importing namespace Cake.Common.Tools.MSBuild...
Importing namespace Cake.Common.Tools.MSpec...
Importing namespace Cake.Common.Tools.MSTest...
Importing namespace Cake.Common.Tools.NSIS...
Importing namespace Cake.Common.Tools.NuGet...
Importing namespace Cake.Common.Tools.NuGet.Add...
Importing namespace Cake.Common.Tools.NuGet.Init...
Importing namespace Cake.Common.Tools.NuGet.Install...
Importing namespace Cake.Common.Tools.NuGet.List...
Importing namespace Cake.Common.Tools.NuGet.Pack...
Importing namespace Cake.Common.Tools.NuGet.Push...
Importing namespace Cake.Common.Tools.NuGet.Restore...
Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
Importing namespace Cake.Common.Tools.NuGet.SetProxy...
Importing namespace Cake.Common.Tools.NuGet.Sources...
Importing namespace Cake.Common.Tools.NuGet.Update...
Importing namespace Cake.Common.Tools.NUnit...
Importing namespace Cake.Common.Tools.OctopusDeploy...
Importing namespace Cake.Common.Tools.OpenCover...
Importing namespace Cake.Common.Tools.ReportGenerator...
Importing namespace Cake.Common.Tools.ReportUnit...
Importing namespace Cake.Common.Tools.Roundhouse...
Importing namespace Cake.Common.Tools.SignTool...
Importing namespace Cake.Common.Tools.SpecFlow...
Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...
Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...
Importing namespace Cake.Common.Tools.TextTransform...
Importing namespace Cake.Common.Tools.VSTest...
Importing namespace Cake.Common.Tools.VSWhere...
Importing namespace Cake.Common.Tools.VSWhere.All...
Importing namespace Cake.Common.Tools.VSWhere.Latest...
Importing namespace Cake.Common.Tools.VSWhere.Legacy...
Importing namespace Cake.Common.Tools.VSWhere.Product...
Importing namespace Cake.Common.Tools.WiX...
Importing namespace Cake.Common.Tools.WiX.Heat...
Importing namespace Cake.Common.Tools.XBuild...
Importing namespace Cake.Common.Tools.XUnit...
Importing namespace Cake.Common.Xml...
Importing namespace Cake.Core...
Importing namespace Cake.Core.Diagnostics...
Importing namespace Cake.Core.IO...
Importing namespace Cake.Core.Scripting...
Importing namespace Cake.Figlet...
Importing namespace Cake.FileHelpers...
Importing namespace Cake.Incubator.AssertExtensions...
Importing namespace Cake.Incubator.DotNetBuildExtensions...
Importing namespace Cake.Incubator.DotNetCoreTestExtensions...
Importing namespace Cake.Incubator.EnumerableExtensions...
Importing namespace Cake.Incubator.FileExtensions...
Importing namespace Cake.Incubator.FilePathExtensions...
Importing namespace Cake.Incubator.FileSystemExtensions...
Importing namespace Cake.Incubator.GlobbingExtensions...
Importing namespace Cake.Incubator.LoggingExtensions...
Importing namespace Cake.Incubator.Project...
Importing namespace Cake.Incubator.ProjectPathExtensions...
Importing namespace Cake.Incubator.SolutionParserExtensions...
Importing namespace Cake.Incubator.StringExtensions...
Importing namespace Cake.ProGet.Asset...
Importing namespace Cake.ProGet.Universal...
Importing namespace Cake.ProGet.Universal.Install...
Importing namespace Cake.ProGet.Universal.Pack...
Importing namespace Cake.ProGet.Universal.Push...
Importing namespace Cake.ProGet.Universal.Unpack...
Importing namespace System...
Importing namespace System.Collections.Generic...
Importing namespace System.Dynamic...
Importing namespace System.IO...
Importing namespace System.Linq...
Importing namespace System.Text...
Importing namespace System.Threading.Tasks...
Compiling build script...
Error: Microsoft.CodeAnalysis.Scripting.CompilationErrorException: C:/GitLab-Runner/builds/redacted/build.cake(20,1): error CS0656: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
   at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.ThrowIfAnyCompilationErrors(DiagnosticBag diagnostics, DiagnosticFormatter formatter)
   at Microsoft.CodeAnalysis.Scripting.ScriptBuilder.CreateExecutor[T](ScriptCompiler compiler, Compilation compilation, Boolean emitDebugInformation, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.Script`1.GetExecutor(CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Scripting.Script`1.RunAsync(Object globals, Func`2 catchException, CancellationToken cancellationToken)
   at Cake.Scripting.Roslyn.RoslynScriptSession.Execute(Script script)
   at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
   at Cake.Commands.BuildCommand.Execute(CakeOptions options)
   at Cake.CakeApplication.Run(CakeOptions options)
   at Cake.Program.Main()

What is Expected?

Preparing to run build script...
<snip>
Time Elapsed 00:05:51.72
Finished executing task: Build

What You Are Seeing?

Cake v0.34.0 fails on scripts that use the dynamic keyword

What version of Cake are you using?

v0.34.0

Are you running on a 32 or 64 bit system?

64 bit

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

Windows

Are you running on a CI Server? If so, which one?

I'm seeing the same error when the build runs from our private gitlab runner and on my local machine.

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

All builds using cake v0.34.0 suddenly started to fail.
Worked around the issue by pinning cake to v0.33.0.

@devlead devlead added the Bug label Jul 17, 2019

@devlead

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

Been able to repro this, investigating and will add an integration test for this.

@devlead

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

Confirmed this to be a .NETStandard 2.0 issue.
Roslyn has gone from .NETStandard 1.3 to .NETStandard 2.0, this seems to cause issues on .NET Core.

@devlead devlead added this to the v0.34.1 milestone Jul 17, 2019

@devlead devlead self-assigned this Jul 17, 2019

@devlead

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

@dieterv think I've identified the problem and will send a PR shortly,

@dieterv

This comment has been minimized.

Copy link
Author

commented Jul 17, 2019

@devlead thank you for the amazingly quick response !

devlead added a commit to devlead/cake that referenced this issue Jul 17, 2019

(cake-buildGH-2575) Fix dynamic C# issues
* fixes use of dynamic with newer versions of Microsoft.CodeAnalysis.CSharp.Scripting
* updates Microsoft.CodeAnalysis.CSharp.Scripting  to 3.1.0
* fixes cake-build#2575

devlead added a commit to devlead/cake that referenced this issue Jul 17, 2019

(cake-buildGH-2575) Fix dynamic C# issues
* fixes use of dynamic with newer versions of Microsoft.CodeAnalysis.CSharp.Scripting
* updates Microsoft.CodeAnalysis.CSharp.Scripting  to 3.1.0
* fixes cake-build#2575

devlead added a commit to devlead/cake that referenced this issue Jul 17, 2019

(cake-buildGH-2575) Fix dynamic C# issues
* fixes use of dynamic with newer versions of Microsoft.CodeAnalysis.CSharp.Scripting
* updates Microsoft.CodeAnalysis.CSharp.Scripting  to 3.1.0
* fixes cake-build#2575

patriksvensson added a commit that referenced this issue Jul 17, 2019

Merge pull request #2577 from devlead/feature/gh-2575
GH2575: Fix dynamic C# issues

devlead added a commit that referenced this issue Jul 17, 2019

Merge branch 'release/0.34.1' into main
* release/0.34.1:
  (build) Updated version and release notes.
  (GH-2575) Fix dynamic C# issues * fixes use of dynamic with newer versions of Microsoft.CodeAnalysis.CSharp.Scripting * updates Microsoft.CodeAnalysis.CSharp.Scripting  to 3.1.0 * fixes #2575
  (build) Updated Cake tool to version 0.34.0
@devlead

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

@dieterv FYI Cake v0.34.1 released, please try it out and see if it sorts your issue.

@dieterv

This comment has been minimized.

Copy link
Author

commented Jul 17, 2019

@devlead Tested with v0.34.1 and I can confirm this issue has been fixed. Thanks!

@devlead

This comment has been minimized.

Copy link
Member

commented Jul 17, 2019

Excellent 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.