-
-
Notifications
You must be signed in to change notification settings - Fork 427
Fix Ubuntu build #596
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
Fix Ubuntu build #596
Conversation
94f9130 to
7002686
Compare
7002686 to
b916e25
Compare
94315c7 to
a2b68f5
Compare
| #module nuget:?package=Cake.DotNetTool.Module&version=0.4.0 | ||
|
|
||
| #tool nuget:?package=GitReleaseNotes&version=0.7.1 | ||
| #tool dotnet:?package=GitVersion.Tool&version=5.1.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cake adds warnings to the build output if specific versions are not used. The nice part is that it also speeds up the NuGet querying to compile on each run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnm2 we actually always recommend pinning to specific versions of all tools/addins/modules, we are just becoming a little bit more vocal about it 😄
| else | ||
| exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" | ||
| fi | ||
| mono "$CAKE_EXE" $SCRIPT --bootstrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --bootstrap call is needed if #module is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnm2 in a soon to be released version of Cake, the bootstrapping will happen automatically without the need to have this step in your bootstrapper, but for now, this is the correct approach.
| Write-Host "Running build script..." | ||
| &$CAKE_EXE $cakeArguments | ||
| exit $LASTEXITCODE | ||
| Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ") --bootstrap" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --bootstrap call is needed if #module is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnm2 in a soon to be released version of Cake, the bootstrapping will happen automatically without the need to have this step in your bootstrapper, but for now, this is the correct approach.
1672c84 to
36c4429
Compare
| <LangVersion>latest</LangVersion> | ||
| <Optimize>false</Optimize> | ||
| <DebugType Condition=" '$(OS)' == 'Windows_NT' ">full</DebugType> | ||
| <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">2.0.9</RuntimeFrameworkVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This had to be removed because .NET Core 2.0 was not found on the Ubuntu image. (It is EOL.)
| @@ -1,5 +1,5 @@ | |||
| image: | |||
| - Visual Studio 2017 | |||
| - Visual Studio 2019 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET Core 2.1 doesn't seem to be on the VS2017 image, so this change was necessary after removing the <RuntimeFrameworkVersion> element.
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" /> | ||
| <PackageReference Include="PublicApiGenerator" Version="8.0.1" /> | ||
| <PackageReference Include="TestStack.ConventionTests" Version="3.0.1" /> | ||
| <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the <RuntimeFrameworkVersion> element was removed, dotnet-xunit caused this error on Ubuntu:
Running .NET Core tests for framework netcoreapp2.1...
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/home/appveyor/.nuget/packages/dotnet-xunit/2.3.1/tools/netcoreapp2.0/xunit.console.dll'.
dotnet-xunit was discontinued: https://github.com/xunit/xunit/issues/1835#issuecomment-431199286
Version 2.3.1 has no rollforward policy and can only run on .NET Core 2.0 which is EOL.
| #module nuget:?package=Cake.DotNetTool.Module&version=0.4.0 | ||
|
|
||
| #tool nuget:?package=GitReleaseNotes&version=0.7.1 | ||
| #tool dotnet:?package=GitVersion.Tool&version=5.1.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnm2 we actually always recommend pinning to specific versions of all tools/addins/modules, we are just becoming a little bit more vocal about it 😄
| Write-Host "Running build script..." | ||
| &$CAKE_EXE $cakeArguments | ||
| exit $LASTEXITCODE | ||
| Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ") --bootstrap" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnm2 in a soon to be released version of Cake, the bootstrapping will happen automatically without the need to have this step in your bootstrapper, but for now, this is the correct approach.
| else | ||
| exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" | ||
| fi | ||
| mono "$CAKE_EXE" $SCRIPT --bootstrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnm2 in a soon to be released version of Cake, the bootstrapping will happen automatically without the need to have this step in your bootstrapper, but for now, this is the correct approach.
|
@jnm2 Is this good to merge? |
|
@josephwoodward I think so! @gep13 Thanks for the info! |
|
Thanks so much for this @jnm2 |
|
You're quite welcome! |
|
@josephwoodward Could you retrigger builds on the recent PRs? |
cake-build/cake#2501 clued me in to the fact that GitVersion can be run on Ubuntu so long as you use the .NET Global tool.
One thing required the next, and it became necessary to move some of the tooling cleanup from #581 to this PR. I'll be rebasing to simplify and resolve conflicts in #581 as soon as this PR merges.