8000 Consider keeping go-git as "pure Go" library · Issue #637 · go-git/go-git · GitHub
[go: up one dir, main page]

Skip to content
Consider keeping go-git as "pure Go" library #637
Closed
@radeksimko

Description

@radeksimko

Hi folks,
Firstly - thank you for all the effort that goes into maintaining this library! ❤️

Over in https://github.com/hashicorp/hc-install we noticed that https://github.com/go-git/go-git/releases/tag/v5.5.0 introduced a CGO dependency https://github.com/pjbgf/sha1cd as part of #618 which made our Windows build fail.

hashicorp/hc-install#82

I appreciate that the library does have fallbacks (as introduced in 5.5.1), making it also work in non-CGO build environment. The (perhaps unfortunate?) reality is however, that Go has CGO_ENABLED=1 defaults. This, in combination with us distributing a library (rather than an app) means that our own downstream is very likely to run into compilation issues on some platforms, as cross-compilation is generally difficult with CGO.

We can of course just disable CGO and suggest downstream to do the same, but before taking that potentially painful step, I wanted to ask if you'd consider any resolution that would keep go-git as a pure Go library without any CGO dependency? It would help library consumers who wouldn't have to tweak the default options and wouldn't have to ask all of downstream to do the same.

One of the main reasons we use go-git is to make minimal assumptions about the environment, but this recent change introduces an assumption, making the proposition far less interesting, to the point that I am considering abandoning go-git it for os/exec and calling out to git. It will introduce another type of headaches for end users who may not have git installed, but we trade it for the headache of downstream libraries having to set CGO_ENABLED=0. 🤷🏻

I will understand if the answer is no and respect it, but I wanted to share the context with the hope that you'll consider it.

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

      0