cake-contrib / Cake_Git

Cake AddIn that extends Cake with Git features using LibGit2 and LibGit2Sharp
https://cakebuild.net/extensions/cake-git
Other
39 stars 63 forks source link

Update to LibGit2Sharp v0.27.0-preview-0102 #150

Closed augustoproiete closed 3 years ago

augustoproiete commented 3 years ago

Closes https://github.com/cake-contrib/Cake_Git/issues/145

lprichar commented 3 years ago

Hi. I recently upgraded my build server to Ubuntu 20 and am now getting the error "The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception" from Cake.Git. The team over there said the problem is fixed in v0.27.0-preview-0102, and so this PR should fix my problem.

May I kindly ask when this PR is scheduled to merge and publish back out to NuGet?

augustoproiete commented 3 years ago

@lprichar New release should be out in a few days, but in the meantime, as a possible workaround (I haven't tested it), you might be able to force loading LibGit2Sharp v0.27.0-preview-0102 in your Cake script before Cake.Git gets loaded:

#addin "nuget:?package=LibGit2Sharp&version=0.27.0-preview-0102&prerelease&loaddependencies=true"
#addin "nuget:?package=Cake.Git&version=1.0.1"
// ...
lprichar commented 3 years ago

@augustoproiete Great idea for a hack, unfortunately that produces "Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.List'", which is meaningless to me, but undoubtedly is a side-effect of multiple versions of LibGit2Sharp hanging around.

devlead commented 3 years ago

@augustoproiete your changes have been merged, thanks for your contribution 👍

As TravisCI no longer is OSS free, added GitHub actions ubuntu-18.04, ubuntu-latest, and macos-latest to test this PR.

Net4x also needed latest version to work on ubuntu.

augustoproiete commented 3 years ago

Great. Thanks @devlead!

@lprichar Cake.Git v1.1.0 is out on NuGet

lprichar commented 3 years ago

🎉 thank you!