Skip to content

(GH-628) Copy system libgit2 files to cake.git and gitversion directories#643

Merged
gep13 merged 2 commits intocake-contrib:developfrom
AdmiringWorm:feature/gh-628
Sep 2, 2020
Merged

(GH-628) Copy system libgit2 files to cake.git and gitversion directories#643
gep13 merged 2 commits intocake-contrib:developfrom
AdmiringWorm:feature/gh-628

Conversation

@AdmiringWorm
Copy link
Member

@AdmiringWorm AdmiringWorm commented Sep 2, 2020

On some linux distros it is not possible to use the embedded libgit2 binaries for these two softwares, and as such they need to either be linked or be copied to the necessary directories. As we are moving toward better support regarding .NET Core cake, we can no longer fully provide the support of patch DLLMaps as these do not work using .NET Core. As such this commit makes the necessary changes to copy the system libgit2 library to the existing libgit2*.so locactions underneeth the tools directory.

fixes #628

@AdmiringWorm AdmiringWorm requested a review from gep13 September 2, 2020 10:43
…sion directories

On some linux distros it is not possible to use
the embedded libgit2 binaries for these two
softwares, and as such they need to either be linked
or be copied to the necessary directories.
As we are moving toward better support regarding
.NET Core cake, we can no longer fully provide
the support of patch DLLMaps as these do not
work using .NET Core. As such this commit makes the
necessary changes to copy the system libgit2 library to the existing
libgit2*.so locactions underneeth the tools directory.
This includes the ability to report which Build Platform
is used (Ubuntu, Arch Linux, Windows 10, etc).
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit 9e49d63 into cake-contrib:develop Sep 2, 2020
@gep13
Copy link
Member

gep13 commented Sep 2, 2020

@AdmiringWorm going to be honest and say that I have no real clue about what is going on here, but if you are happy with it, I am over the moon :-)

@AdmiringWorm AdmiringWorm deleted the feature/gh-628 branch September 2, 2020 19:28
@AdmiringWorm
Copy link
Member Author

Hehe, well.
Technically it is quite simple what is going on in the code submitted.

  1. A separate class have been created (or two) for storing information about the Build Platform/Environment (ie, Windows, Linux Distro, OSX).
  2. The LinuxBuildPlatform class checks two different configuration files (sometimes one is available, other times the other is available) to find out what the Linux Distro Name and version is (ie Ubuntu 18.04, Fedora x.x, Arch Linux rolling and so on).
  3. A method was added to the class to allow copying system libraries to specific paths (by allowing globbing), and since not all addin/tool libraries can be replaced (like the ones for ubuntu 18.04) additional logic was needed for this.
  4. Another method was added to provide the patching of dll maps, but this had the same problem as the copying of system libraries.
  5. Because I was lazy, I didn't bother going through all of the Cake.Recipe files to change the call of detecting the Build Agent Operating System, and basically made it a shortcut property instead 😄

I think that is about it.

Oh, and I figured why not report the build platform as well:

Linux Ubuntu 16.04
image

OSX (Lacking information, mainly because I do not have any way to find out what is available to be read from).
image

Windows (appveyor VS2015 image) (Should honestly report Windows Server 2012 R2)
image

Windows (appveyor VS2017 image) (Should honestly report Windows Server 2016)
image

Windows (appveyor VS2019 image) (and this one should report Windows Server 2019)
image

There are a few discrepancies, especially with the reported OSX and Windows platforms.
The windows platforms are probably close enough though.

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.

Builds fail on Linux systems requiring a different version of LibGit2 when running under .NET Core cake

2 participants