Skip to content

Update go.mod module path with explicit v2 - #4575

Merged
chrisd8088 merged 1 commit into
git-lfs:mainfrom
chrisd8088:update-go-mod-version
Aug 12, 2021
Merged

chrisd8088 merged 1 commit into
git-lfs:mainfrom
chrisd8088:update-go-mod-version

Conversation

@chrisd8088

@chrisd8088 chrisd8088 commented Aug 10, 2021 •

Copy link
Copy Markdown
Member

When our go.mod file was introduced in commit 114e85c in PR #3208, the module path chosen did not include a trailing /v2 component. However, the Go modules specification now advises that module paths must have a "major version suffix" which matches the release version.

We therefore add a /v2 suffix to our module path and all its instances in import paths. We'll need to bump this again before we release v3.0.0, obviously (along with things like version number in config/version.go and the JSON in versioninfo.json).

See also the Go module system's major version suffix rule.

As noted in #4574 (comment), the current output from Go's proxy service only lists Git LFS version tags up to v2.5.2, and it marks all the v2 ones with +incompatible.

Click for current version listing (sorted):
v0.1.0
v0.2.0
v0.2.1
v0.2.1-p1
v0.2.2
v0.2.3
v0.3.0
v0.3.1
v0.3.2
v0.3.3
v0.3.4
v0.3.5
v0.3.6
v0.4.0
v0.4.1
v0.4.2
v0.5.0
v0.5.1
v0.5.1-tracing
v0.5.2
v0.5.3
v0.5.4
v0.5.4-homebrew
v0.6.0
v1.0.0
v1.0.1
v1.0.2
v1.1.0
v1.1.1
v1.1.1-pre-push-tracing
v1.1.2
v1.2.0
v1.2.1
v1.3.0
v1.3.1
v1.4.0
v1.4.1
v1.4.2
v1.4.3
v1.4.4
v1.5.0
v1.5.1
v1.5.2
v1.5.2-go1.8beta1
v1.5.3
v1.5.4
v1.5.5
v1.5.6
v2.0.0+incompatible
v2.0.1+incompatible
v2.0.2+incompatible
v2.0.2-rc1+incompatible
v2.1.0+incompatible
v2.1.1+incompatible
v2.2.0+incompatible
v2.2.1+incompatible
v2.2.2-example+incompatible
v2.3.0+incompatible
v2.3.1+incompatible
v2.3.2+incompatible
v2.3.3+incompatible
v2.3.4+incompatible
v2.4.0+incompatible
v2.4.1+incompatible
v2.4.2+incompatible
v2.5.0+incompatible
v2.5.1+incompatible
v2.5.2+incompatible

Making an explicit request for the latest v2.13.3 version from the checksum service currently returns:

invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

This presumably also explains why the Git LFS entry in the pkg.go.dev search index returns a stale page:

Screen Shot 2021-08-09 at 11 52 19 PM

Partially resolves #4574.
/cc @RochaStratovan as reporter.

When our go.mod file was introduced in commit
114e85c in PR git-lfs#3208, the module
path chosen did not include a trailing /v2 component.  However,
the Go modules specification now advises that module paths must
have a "major version suffix" which matches the release version.

We therefore add a /v2 suffix to our module path and all its
instances in import paths.

See also https://golang.org/ref/mod#major-version-suffixes for
details regarding the Go module system's major version suffix rule.
@chrisd8088
chrisd8088 requested a review from a team August 10, 2021 06:53

@bk2204 bk2204 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not intrinsically opposed to this, but as I mentioned in #4574 (comment), it might give folks the impression that our internals are semantically versioned when they are not: only the behavior of the external binary is semantically versioned.

So I'm approving this in case you want to go ahead anyway, even though I feel (not strongly) that a documentation fix might be appropriate instead.

@chrisd8088

Copy link
Copy Markdown
Member Author

Thanks -- and just to be clear, a documentation update is absolutely required too. This was just something I stumbled on while trying understand what was going on.

From what I can tell, there's no way to use Go modules and specify that your package is, itself, not a module for re-use, but I would be very pleased to hear otherwise. Some other major projects like InfluxDB and Consul have a top-level go.mod even though they provide binary executables, and the former, at least, has added /v2 for their next major release.

Assuming we continue to follow that same model, I would be inclined to think that we should stick to the Go modules' rules, but also put prominent notices in our docs that we don't provide a stable ABI, rather than trying to hint that that's the case by relying on an artifact of the way we number releases as compared to our go.mod module path.

However, I also don't feel strongly about this; it was just the outcome of some investigation into what was going on with proxy.golang.org.

@chrisd8088
chrisd8088 merged commit 7266ee0 into git-lfs:main Aug 12, 2021
@chrisd8088
chrisd8088 deleted the update-go-mod-version branch August 12, 2021 01:00
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.

"go get" command fails to checkout master

2 participants