Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

filesystem.NewStorage and filesystem.NewStorageWithOptions broke compatibility #1262

Open
johanbrandhorst opened this issue Dec 17, 2019 · 1 comment

Comments

@johanbrandhorst
Copy link

Specifically, this change 8f6b312#diff-8dd110426eb72706e38f9798b9a95230R37, which removed the error return from these functions, merged with #949.

This is a real problem, https://github.com/mitchellh/golicense depends on https://gopkg.in/src-d/go-license-detector.v2 which uses gopkg.in/src-d/go-git.v4 v4.1.0, which is before this breaking change was made. So a user cannot simultaneously use github.com/mitchellh/golicense and gopkg.in/src-d/go-git.v4 latest even though SemVer (and by extension, go modules) promises compatibility.

My recommendation would be to revert the signature to include the error, even though it will always be nil. That way we'll be able to tell users to update to latest and it will remain compatible with previous releases, except for 4.7.1-4.13.1.

@johanbrandhorst
Copy link
Author

For others experiencing this issue, for now it's possible to use

replace gopkg.in/src-d/go-git.v4 => gopkg.in/src-d/go-git.v4 v4.7.0

In your go.mod to work around this issue.

johanbrandhorst added a commit to johanbrandhorst/golicense that referenced this issue Dec 17, 2019
go-license-detector v2 was depending on an old version of
gopkg.in/src-d/go-git, and unfortunately the latest version
broke compatibility unexpectedly. This made golicense
unnecessarily difficult to build in repositories which otherwise
used gopkg.in/src-d/go-git. Upgrading to v3 removes these problems.
See src-d/go-git#1262 for full context.

It also allows us to remove a whole lot of packages from go.mod
in general.
johanbrandhorst added a commit to johanbrandhorst/golicense that referenced this issue Dec 19, 2019
go-license-detector v2 was depending on an old version of
gopkg.in/src-d/go-git, and unfortunately the latest version
broke compatibility unexpectedly. This made golicense
unnecessarily difficult to build in repositories which otherwise
used gopkg.in/src-d/go-git. Upgrading to v3 removes these problems.
See src-d/go-git#1262 for full context.

It also allows us to remove a whole lot of packages from go.mod
in general.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant