Closed
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.10 windows/amd64 go:2018-02-20.1
(Downloaded today)
Does this issue reproduce with the latest release?
Yes
What did you do?
vgo mod -sync
after initializing the go.mod
With a simple HelloWorld program:
package main
import (
"fmt"
"github.com/graph-gophers/graphql-go/gqltesting"
)
func main() {
fmt.Println("hello world")
}
What did you expect to see?
Successfully downloading dependencies
What did you see instead?
go: finding github.com/graph-gophers/graphql-go/gqltesting latest
go: finding github.com/graph-gophers/graphql-go latest
go: extracting github.com/graph-gophers/graphql-go v0.0.0-20180609140535-bb9738501bd4
-> unzip C:\Users\Sneko\go\src\mod\cache\download\github.com\graph-gophers\graphql-go\@v\v0.0.0-20180609140535-bb9738501bd4.zip: invalid file name github.com/graph-gophers/graphql-go@v0.0.0-20180609140535-bb9738501bd4/.gitignore
go: import "a/b/c" ->
import "github.com/graph-gophers/graphql-go/gqltesting": cannot find module providing package github.com/graph-gophers/graphql-go/gqltesting
Moreover I simplified the issue with a HelloWorld program with just 1 import, but that's the same in my real project with more dependencies (the ones not described below are working well):
go: import "github.com/graph-gophers/graphql-go": cannot find module providing package github.com/graph-gophers/graphql-go ge github.com/dgrijalva/jwt-go
go: import "golang.org/x/net/context": cannot find module providing package golang.org/x/net/context
go: import "XXXXX/YYYYYYYY/api/context" ->
import "github.com/spf13/viper": cannot find module providing package github.com/spf13/viper
go: import "XXXXX/YYYYYYYY/api/handler" -> import "github.com/dgrijalva/jwt-go": cannot find module providing package github.com/dgrijalva/jwt-go
go: import "XXXXX/YYYYYYYY/api/handler" ->
import "github.com/op/go-logging": cannot find module providing package github.com/op/go-logging
go: import "XXXXX/YYYYYYYY/api/loader" ->
import "gopkg.in/nicksrandall/dataloader.v5": cannot find module providing package gopkg.in/nicksrandall/dataloader.v5
go: import "XXXXX/YYYYYYYY/api/service" -> import "github.com/jmoiron/sqlx": cannot find module providing package github.com/jmoiron/sqlx
go: import "XXXXX/YYYYYYYY/api/service" ->
import "github.com/rs/xid": cannot find module providing package github.com/rs/xid
go: import "XXXXX/YYYYYYYY/api/handler" ->
import "XXXXX/YYYYYYYY/api/model" ->
import "golang.org/x/crypto/bcrypt": cannot find module providing package golang.org/x/crypto/bcrypt
Thank you 😃
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
[-]x/vgo: cannot find module providing package[/-][+]cmd/go: cannot find module providing package[/+]tobiaskohlbau commentedon Jul 13, 2018
I tracked down the issue with for e.g.
invalid file name
. It's related to windows and zip file handling.https://github.com/golang/vgo/blob/cc75ec08d5ecfc4072bcefc2c696d1c30af692b9/vendor/cmd/go/internal/modfetch/unzip.go#L57-L66
On systems with
PathSeperator
equals to/
everything works. But on windows the callfilepath.Clean
replaces slashes with backslashes. This results infilepath.Clean(zf.Name) != zf.Name
as the zip package returns the path with forward slashes.I've build a quick workaround, but I'm not sure if this is a good solution. Maybe @rsc who introduced this lines within a4111b184cac70ec5478914d3b98168dd34bcf4a could tell us more.
rsc commentedon Jul 17, 2018
Fixed in golang.org/cl/123580, sorry about the trouble.
(Note that this has not come back into the vgo repo yet but it will around the time we issue beta2.)
sneko commentedon Jul 18, 2018
@rsc just to be curious, any approximate release date for this beta2?
Thanks for your work 😃
lancerushing commentedon Jul 26, 2018
I'm still seeing this in go1.11beta2.
Steps to reproduce (using docker container to isolate..)
docker run --rm -it ubuntu:16.04 bash
Then inside the container:
Output:
Thanks,
Lance
agnivade commentedon Jul 26, 2018
I am guessing due to git version 2.7 which is there in 16.04. The fix for that is in latest master. Either try with master or wait for an RC to get out.
lancerushing commentedon Jul 26, 2018
Didn't get a chance to try master, but I was able to fix it by upgrading git from 2.7.4 to 2.18.0
On the same container:
Thank you again.
Lance
alwindoss commentedon Nov 22, 2018
is the fix available in 1.11.2? if not in which release would this be available?
Until it is released, what is the workaround for this issue?
agnivade commentedon Nov 22, 2018
Yes.
7 remaining items