Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Proposal for better way to handle native binaries, with proof of concept NuGet packages #974

Closed
@bording

Description

@bording

Looking through the issues list, one of the things I've seen come up a lot is the idea of improving how we're handling the native libgit libraries, in a way that works cross-platform, #837 and #493 for example. There has also been some talk moving the native libraries into a separate NuGet package, including some PRs that have attempted it but seem to have gotten stuck for various reasons( #896, #772).

After the change I made the current props file this weekend to keep it from copying the native binaries folder when not on windows, I started thinking about how I could leverage that into improve the above situation.

I spent some time working a proof of concept set of NuGet packages that seem to do exactly what I wanted them to:

bording/NativeBinaryNugetPackages

If you put them in a folder and set up a local package source, you can try them out. I've added them to projects in Windows, OSX Yosemite with Xamarin Studio, and Ubuntu 14.04, and everything works, with just the needed native libraries being automatically included as needed.

The way this works is that main LibGit2Sharp package just has the managed dll in it now, and nothing else. It has a dependency on what I've called LibGit2Sharp.NativeBinaries. In that package are all of the native binaries and a build\props file that conditionally adds the correct binaries based on what platform you are on.

Assuming everyone likes this approach, I'm proposing making the changes needed to go forward with this new packaging scheme.

One of the benefits I see of this is that it can simplify the main codebase, because we can just have a package dependency on the NativeBinaries package like any other managed project would. Anyone who grabs a copy of the code would just have it work in any environment!

I can also see moving all of the stuff that is currently in the repo for managing the native builds out into a separate LibGit2Sharp.NativeBinaries repo, which is where the libgit2 submodule could live along with the nuspec for building the native package.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions