Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.4.8 - issue with go.mod [gopkg.in no longer supported] #328

Closed
matzhouse opened this issue Mar 11, 2020 · 9 comments · Fixed by tilt-dev/fsnotify#7
Closed

v1.4.8 - issue with go.mod [gopkg.in no longer supported] #328

matzhouse opened this issue Mar 11, 2020 · 9 comments · Fixed by tilt-dev/fsnotify#7

Comments

@matzhouse
Copy link

Which operating system (GOOS) and version are you using?

Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:        19.10
Codename:       eoan

Please describe the issue that occurred.

Hi, I'm not entirely sure this is your problem but I thought I would bring it up here anyway.
It seems that as you guys have moved away from pkg.in, when you bumped the version to 1.4.8 it also made pkg.in bump it's version to that.

As you have referenced your github url in the go.mod file, anything that is referencing pkg.in/fsnotify.v1 in an import is now broken.

Here is an example

go get: upgrading gopkg.in/fsnotify.v1@v1.4.7: gopkg.in/fsnotify.v1@v1.4.8: invalid version: go.mod has non-....v1 module path "github.com/fsnotify/fsnotify" at revision v1.4.8
ERROR: Service 'ginkgo-base' failed to build: The command '/bin/sh -c go get -u github.com/onsi/ginkgo/ginkgo && go get -u github.com/onsi/gomega/... && export PATH=$PATH:$HOME/gopath/bin' returned a non-zero code: 1

As I said at the top, I'm not really sure this is your problem but I suspect others will come looking for answers, so here it is.

The only thing you might have done would be to bump the version to 2 so the v1 would have stayed on 1.4.7 and not broken things in the wild.

If I've got anything wrong about the above please accept my apologies :)

@matzhouse matzhouse changed the title v1.4.8 v1.4.8 - issue with go.mod Mar 11, 2020
@cpuguy83
Copy link
Contributor

Indeed gomods does some weird things here... I'm not sure what's actually being used:

package main

import (
	"fmt"

	"gopkg.in/fsnotify.v1"
)

func main() {
	fmt.Println(fsnotify.Event{})
}
module foo

go 1.13

require (
	github.com/fsnotify/fsnotify v1.4.8 // indirect
	golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect
	gopkg.in/fsnotify.v1 v1.4.7
)

Possibly because example_test.go imports from the github URL.
But I definitely don't get an error except for the fact it's using v1.4.7 instead of v1.4.8.

@nathany
Copy link
Contributor

nathany commented Mar 11, 2020

Please see the readme at https://github.com/go-fsnotify/fsnotify for the reason why gopkg.in is no longer supported.

Maybe there is a gomod replace rule that would resolve this temporarily but the real fix is to patch ginkgo (or other libraries) to use the correct import path.

@nathany nathany changed the title v1.4.8 - issue with go.mod v1.4.8 - issue with go.mod [gopkg.in no longer supported] Mar 11, 2020
@nathany nathany pinned this issue Mar 11, 2020
@nathany
Copy link
Contributor

nathany commented Mar 11, 2020

Does a replace rule in go.mod solve it? Something like this:

replace gopkg.in/fsnotify.v1 => github.com/fsnotify/fsnotify

nathany added a commit that referenced this issue Mar 11, 2020
@nathany nathany unpinned this issue Mar 11, 2020
@cpuguy83
Copy link
Contributor

1.4.9 allows the replace statement to work:

replace gopkg.in/fsnotify.v1 => github.com/fsnotify/fsnotify v1.4.9

venkytv added a commit to mobiledgex/edge-cloud that referenced this issue Mar 11, 2020
Root cause of the build issue:
 - fsnotify/fsnotify#328
venkytv added a commit to mobiledgex/edge-cloud that referenced this issue Mar 12, 2020
@kolaente
Copy link

kolaente commented Apr 11, 2020

With the replace statement, I get this error:

go: github.com/fsnotify/fsnotify@v1.4.9 used for two different module paths (github.com/fsnotify/fsnotify and gopkg.in/fsnotify.v1)

Which seems to be a golang issue: golang/go#26904

I guess there is another dependency somewhere which hasn't updated the path and some which are using the right one.

@kolaente
Copy link

kolaente commented Apr 11, 2020

I then tried to fork fsnotify and use the fork as a replacement for the package from gopkg.in but got a different error:

go: github.com/kolaente/fsnotify@v1.4.9: parsing go.mod: unexpected module path "github.com/fsnotify/fsnotify"
go: error loading module requirements

Edit: I guess that makes sense because I forked from github. I'll try to change the name.

@kolaente
Copy link

Changed the name in the fork and "fixed" it that way:

replace gopkg.in/fsnotify.v1 => github.com/kolaente/fsnotify v1.4.10-0.20200411160148-1bc3c8ff4048

@cpuguy83
Copy link
Contributor

Why not update your import statements to use the module path instead of gopkg.in?

@kolaente
Copy link

@cpuguy83 Because fsnotify is used by a dependency of a dependency of a dependency in my project where I have absolutely no way of changing that.

gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 26, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 26, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 28, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 28, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 28, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 28, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 28, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
gainsley pushed a commit to mobiledgex/edge-cloud that referenced this issue Apr 29, 2022
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 a pull request may close this issue.

4 participants