Skip to content

Conversation

@jnm2
Copy link
Collaborator

@jnm2 jnm2 commented Dec 1, 2019

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.

@jnm2 jnm2 force-pushed the fix_ubuntu_build branch 7 times, most recently from 94f9130 to 7002686 Compare December 1, 2019 22:22
@jnm2 jnm2 force-pushed the fix_ubuntu_build branch from 7002686 to b916e25 Compare December 2, 2019 04:31
@jnm2 jnm2 force-pushed the fix_ubuntu_build branch from 94315c7 to a2b68f5 Compare December 2, 2019 04:38
Comment on lines +2 to +5
#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
Copy link
Collaborator Author

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.

Copy link

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
Copy link
Collaborator Author

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.

Copy link

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"
Copy link
Collaborator Author

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.

Copy link

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 jnm2 changed the title [WIP] Fix Ubuntu build Fix Ubuntu build Dec 2, 2019
@jnm2 jnm2 force-pushed the fix_ubuntu_build branch from 1672c84 to 36c4429 Compare December 2, 2019 04:47
<LangVersion>latest</LangVersion>
<Optimize>false</Optimize>
<DebugType Condition=" '$(OS)' == 'Windows_NT' ">full</DebugType>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">2.0.9</RuntimeFrameworkVersion>
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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" />
Copy link
Collaborator Author

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.

@jnm2 jnm2 marked this pull request as ready for review December 2, 2019 04:56
@jnm2 jnm2 mentioned this pull request Dec 2, 2019
Comment on lines +2 to +5
#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
Copy link

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"
Copy link

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
Copy link

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.

@josephwoodward
Copy link
Contributor

@jnm2 Is this good to merge?

@jnm2
Copy link
Collaborator Author

jnm2 commented Dec 2, 2019

@josephwoodward I think so!

@gep13 Thanks for the info!

@josephwoodward
Copy link
Contributor

Thanks so much for this @jnm2

@josephwoodward josephwoodward merged commit b981907 into shouldly:master Dec 13, 2019
@jnm2 jnm2 deleted the fix_ubuntu_build branch December 13, 2019 13:06
@jnm2
Copy link
Collaborator Author

jnm2 commented Dec 13, 2019

You're quite welcome!

@jnm2
Copy link
Collaborator Author

jnm2 commented Dec 13, 2019

@josephwoodward Could you retrigger builds on the recent PRs?

@jnm2 jnm2 mentioned this pull request Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants