cake-build / cake-build/cake

Problem with cake script compilation with travis, trusty, mono and dotnet.

Open
#2,118 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
1h 15m
Merged PRs (30d)
19

Description

Creating issue as per: https://stackoverflow.com/questions/49677894/travis-ci-mono-5-4-0-201/49678678?noredirect=1#comment86374258_49678678

### What You Are Seeing?

Two different errors at compile of cake script stage, depending on mono version.

The first is here:

https://stackoverflow.com/questions/49677894/travis-ci-mono-5-4-0-201/49678678?noredirect=1#comment86374258_49678678

Problem as can be seen in log:
> Compiling build script...
Error: Cake.Core.CakeException: Error occurred when compiling build script: (2399,40): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

And here is the travis config for this build:

```
{
"language": "csharp",
"sudo": "required",
"dist": "trusty",
"dotnet": "2.1.103",
"mono": "5.2.0",
"os": "linux",
"before_install": [
"git fetch --unshallow"
],
"script": [
"./build.sh -v Diagnostic"
],
"cache": {
"directories": [
"src/packages",
"tools"
]
},
"global_env": "DOTNET_CLI_TELEMETRY_OPTOUT=1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true",
"group": "stable"
}

```

Full log:
GIST LINK - https://gist.github.com/dazinator/5c080921ec8f5b72d74c076a5deee63b

I then tried suggestion of upping the version of mono (tried both 5.4.0, and 5.4.1) which resulted in a different exception from mono (have linked gist below)

The travis config for this second attempt using mono `5.4.0` is:

```

{
"language": "csharp",
"sudo": "required",
"dist": "trusty",
"dotnet": "2.1.103",
"mono": "5.4.0",
"os": "linux",
"before_install": [
"git fetch --unshallow"
],
"script": [
"./build.sh -v Diagnostic"
],
"cache": {
"directories": [
"src/packages",
"tools"
]
},
"global_env": "DOTNET_CLI_TELEMETRY_OPTOUT=1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true",
"group": "stable"
}

```

And that results in a nasty mono exception.

GIST LINK - https://gist.github.com/dazinator/43419caa4f902d9b071eedd252688586

### What is Expected?

Cake script compiles.

### What version of Cake are you using?

latest stable cake release - `0.26.1`

### Are you running on a 32 or 64 bit system?

See travis build definition.

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

Linux (with mono and dotnet) as per travis build config above.

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

Travis: https://stackoverflow.com/questions/49677894/travis-ci-mono-5-4-0-201/49678678?noredirect=1#comment86374258_49678678

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

Run the travis build.

### Output Log

There are two different errors I am seeing depending on mono version used.

Mono version 5.2.0:
GIST LINK - https://gist.github.com/dazinator/5c080921ec8f5b72d74c076a5deee63b

Mono version 5.4.0 (also similar error on 5.4.1)
GIST LINK - https://gist.github.com/dazinator/43419caa4f902d9b071eedd252688586

Contributor guide

Open the contributing guide

Research direction

Review the Travis configuration, build.sh, and the two linked gist logs, starting by reproducing the Cake 0.26.1 build with the listed Mono and .NET versions. Compare the compilation and Mono failures across versions; done means the Travis build completes and the Cake script compiles without either reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.