You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The installation wiki has provides instructions for obtaining the git-lfs source code. These instructions are:
Building requires a standard Unix environment with GNU make and bash. On Windows, > you should install GNU make (e.g., via Chocolatey) and build under Git Bash.
Ensure that you have a reasonably modern version of Go.
If you are using Windows, build goversioninfo (e.g., with go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo) and place the binary in your PATH.
Obtain a copy of the repository, either with git clone (into the appropriate location within your $GOPATH), or with go get, i.e., go get github.com/git-lfs/git-lfs.
In your copy of the source, execute make to ensure that you are able to build a fresh copy of Git LFS. If successful, the binary will appear in bin/git-lfs.
When I use the go get line
go get github.com/git-lfs/git-lfs
It fails with the following message:
-bash-4.2# go get github.com/git-lfs/git-lfs
# cd /tmp/gitlfs/src/github.com/git-lfs/git-lfs; git checkout master
error: pathspec 'master' did not match any file(s) known to git.
package github.com/git-lfs/git-lfs: exit status 1
System environment
Fedora 20
Latest go
-bash-4.2# go version
go version go1.4.2 linux/amd64
invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
which leads us to golang/go#35732, and from there to a few other projects whose solutions to this error message appear to be to add /v[n] to their module path. In this project's case that would mean we need to change the module path in our go.mod file from:
module github.com/git-lfs/git-lfs
to:
module github.com/git-lfs/git-lfs/v2
and then make any other related changes to get everything building again. That would seem to track with the fact that v2.6.0 (the next release tag after v2.5.2) was the first one where go.mod was introduced, back in #3208.
I'm not sure that making the version change is going to help here. For example, using Go 1.15, I don't have a problem running go get github.com/git-lfs/git-lfs. It may be that some versions of Go hard-code master as their branch in the list, which is what @RochaStratovan is seeing here. Fedora 20 is also way past end of life and we know for certain Go 1.4 won't work at all, so I'm not surprised things are totally broken there.
I'm also not excited about changing the import path. We're a binary and not a module, and we don't provide a stable ABI except via the command line, so I don't want to give people the false impression that they can use our code as a semantically versioned stable module, since they can't. It might be better to just update the documentation to use git clone rather than go get so we can avoid the entire problem.
As for the documentation, I'd agree it probably only makes sense to suggest using git clone. (Hence my caveated "partially resolves" comment in #4575.)
Ah, I'm probably seeing the latest version because I have GOPROXY=direct, which makes things work normally for me without using the proxy. So in that case, yes, I think we should probably do both.
I've updated the wiki to only mention the use of git clone.
I think the remaining outstanding item is to add something to our docs, if it's not there already, advising that our ABI is not stable or intended for reuse outside of the project.
Activity
RochaStratovan commentedon Aug 9, 2021
Go version 1.4.2 is the latest that is available via the
yumcommand.I found that I could download a newer go binary from here and follow their install instructions.
After that the
go getcommand still failed.HOWEVER if I did
git clonefollowed bymakethat now worked (previously that failed ongotoo).chrisd8088 commentedon Aug 10, 2021
Hey, thanks for the report. There do seem to be some problems with how Go's proxy.golang.org service is caching this project's releases. For instance, the current output from https://proxy.golang.org/github.com/git-lfs/git-lfs/@v/list stops at v2.5.2 (before our primary branch was renamed to 'main'). Among other consequences, it means the https://pkg.go.dev/github.com/git-lfs/git-lfs page is also very stale.
Specifying the correct latest version and requesting https://sum.golang.org/lookup/github.com/git-lfs/[email protected] we get:
which leads us to golang/go#35732, and from there to a few other projects whose solutions to this error message appear to be to add
/v[n]to their module path. In this project's case that would mean we need to change the module path in ourgo.modfile from:to:
and then make any other related changes to get everything building again. That would seem to track with the fact that v2.6.0 (the next release tag after v2.5.2) was the first one where
go.modwas introduced, back in #3208.bk2204 commentedon Aug 10, 2021
I'm not sure that making the version change is going to help here. For example, using Go 1.15, I don't have a problem running
go get github.com/git-lfs/git-lfs. It may be that some versions of Go hard-codemasteras their branch in the list, which is what @RochaStratovan is seeing here. Fedora 20 is also way past end of life and we know for certain Go 1.4 won't work at all, so I'm not surprised things are totally broken there.I'm also not excited about changing the import path. We're a binary and not a module, and we don't provide a stable ABI except via the command line, so I don't want to give people the false impression that they can use our code as a semantically versioned stable module, since they can't. It might be better to just update the documentation to use
git clonerather thango getso we can avoid the entire problem.chrisd8088 commentedon Aug 11, 2021
As for the documentation, I'd agree it probably only makes sense to suggest using
git clone. (Hence my caveated "partially resolves" comment in #4575.)The Go module version question arose because while I also don't get an error with
go get github.com/git-lfs/git-lfsper se, it clearly isn't retrieving anything like the latest version, and there are some oddities as a consequence like the very old version of the Git LFS project page that's returned by https://pkg.go.dev/github.com/git-lfs/git-lfs.bk2204 commentedon Aug 11, 2021
Ah, I'm probably seeing the latest version because I have
GOPROXY=direct, which makes things work normally for me without using the proxy. So in that case, yes, I think we should probably do both.chrisd8088 commentedon Aug 12, 2021
I've updated the wiki to only mention the use of
git clone.I think the remaining outstanding item is to add something to our docs, if it's not there already, advising that our ABI is not stable or intended for reuse outside of the project.