Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cake fails to build on travis-ci with latest mono (6.8) #2695
What You Are Seeing?
Cake fails to compile and run build script. The error message is.
The problem appears to be related to Mono 6.8 - a temporary workaround that has fixed the issue for me was to add the line
What is Expected?
Cake compiles and runs build script.
What version of Cake are you using?
The below log was generated using Cake 0.32.1, but as part of diagnosing the issue, I updated to 0.36.0 and it didn't make a difference.
Are you running on a 32 or 64 bit system?
What environment are you running on? Windows? Linux? Mac?
travis, linux, csharp environment as below.
Are you running on a CI Server? If so, which one?
How Did You Get This To Happen? (Steps to Reproduce)
A hello world cake script in conjunction with the above travis.yml should be enough to repro this issue.
``` 9.77s$ ./build.sh -t Build Downloading NuGet... https://api.nuget.org/v3/index.json Restoring NuGet package Cake.0.32.1. GET https://api.nuget.org/v3-flatcontainer/cake/0.32.1/cake.0.32.1.nupkg OK https://api.nuget.org/v3-flatcontainer/cake/0.32.1/cake.0.32.1.nupkg 18ms Installing Cake 0.32.1. Adding package 'Cake.0.32.1' to folder '/home/travis/build/linn/mylinn/tools' Added package 'Cake.0.32.1' to folder '/home/travis/build/linn/mylinn/tools' Analyzing build script... Processing build script... Installing addins... Compiling build script... Error: The assembly name is invalid. The command "./build.sh -t Build" failed and exited with 1 during . ```
I think the exception is thrown here:
I think mono/mono#16446 broke this five months ago. It added a check that rejects
And adding some more info to that exception reveals
This seems to be a bug in the Mono runtime, see issue mono/mono#18508
If you have .NET Core installed on the machine you could try executing you script using Cake.Tool.
Quick way to bootstrap it would be to use local tools and bootsrap on ci somehing like
Good examples in these blog posts:
The Mono commit that changed this fixed our parsing to be in line with .NET Core, which in turn triggered a Roslyn bug that was relying on our old, broken behavior in some Mono-specific code (see dotnet/roslyn#39369 (comment)).
The Roslyn fix is in the 3.5.0-beta1 nuget, so if reasonable cake should try updating to that and things should work smoothly with Mono 6.8.
Is there a timeline for updating cake to use a newer Microsoft.CodeAnalysis.CSharp.Scripting dependency with the roslyn preview that fixes this issue?
A version with this fixed is now up on our pre-release NuGet feed