Description
When the ubuntu-latest VM image switched to 20.04 we started getting the following error from GitVersion:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'git2-572e4d8' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-572e4d8: cannot open shared object file: No such file or directory
There was another error logged in the preceding step to install the .NET Core SDK:
get-os-distro: Error: Distribution specific OS name and version could not be detected: UName = Linux
This error didn't fail the install of .NET Core, but it seemed to make it so it didn't recognize what version of Linux it was running on. In the step's log it listed this as the version:
Primary:linux-x64
Legacy:-x64
Where in the previous build it listed this:
Primary:linux-x64
Legacy:ubuntu.18.04-x64
We are unsure if the two are connected, but changing the VM over to windows-latest fixed both issues.
Area for Triage:
Unknown
Question, Bug, or Feature?:
"Bug"
Virtual environments affected
Expected behavior
GitVersion runs successfully
Actual behavior
Bug displayed above
Repro steps
Failed build - Only preserved for a week.
jobs:
- job: Semver
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk (for GitVersion)'
inputs:
packageType: sdk
version: 2.1.x
- task: GitVersion@5
displayName: 'GitVersion'
inputs:
configFilePath: '$(Build.SourcesDirectory)/GitVersion.yml'
the same here!
Hello everyone, I think this issue related to GitVersion. It was fixed in new release (5.6.0) for ubuntu 20.04. You can try to use this snippet:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk (for GitVersion)'
inputs:
packageType: sdk
version: 5.x
- task: gitversion/setup@0
inputs:
versionSpec: '5.6.0'
- task: gitversion/execute@0
inputs:
useConfigFile: true
configFilePath: '$(Build.SourcesDirectory)/GitVersion.yml'
Another way change ubuntu image to 18.04, because previously builds were run on ubuntu 18.04 and it worked.
Hello everyone. We're going to deploy new image with GitVersion (5.6.0) on January.
Hello everyone, I think this issue related to GitVersion. It was fixed in new release (5.6.0) for ubuntu 20.04. You can try to use this snippet:
- task: UseDotNet@2 displayName: 'Use .NET Core sdk (for GitVersion)' inputs: packageType: sdk version: 5.x - task: gitversion/setup@0 inputs: versionSpec: '5.6.0' - task: gitversion/execute@0 inputs: useConfigFile: true configFilePath: '$(Build.SourcesDirectory)/GitVersion.yml'Another way change ubuntu image to 18.04, because previously builds were run on ubuntu 18.04 and it worked.
Hello Dmitry, Thanks a lot, I put the tasks as you suggested and It worked to me in Ubuntu 20.04
I only didnt put the task "task: UseDotNet@2" because I use de SonarQube and It isnt compatible with this DotNet version.
Most helpful comment
Hello everyone, I think this issue related to GitVersion. It was fixed in new release (5.6.0) for ubuntu 20.04. You can try to use this snippet:
Another way change ubuntu image to 18.04, because previously builds were run on ubuntu 18.04 and it worked.