go version)?$ go version
go version go1.11beta2 darwin/amd64
yes
go env)?$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/blaz/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/blaz/dev/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/blaz/src/go/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2r/wpj58rp17s56swkgt8c2r5nm0000gn/T/go-build234628957=/tmp/go-build -gno-record-gcc-switches -fno-common"
A simple main.go with a dependency to test go mod
package main
import (
"net/http"
"github.com/go-chi/chi"
)
func main() {
r := chi.NewRouter()
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hey"))
})
http.ListenAndServe(":9999", r)
}
no error on run
$ go run -v main.go
go: finding github.com/go-chi/chi v3.3.2+incompatible
Fetching https://github.com?go-get=1
Parsing meta tags from https://github.com?go-get=1 (status code 200)
go: import "github.com/go-chi/chi": cannot find module providing package github.com/go-chi/chi
thanks
I don't have this error on linux box
I'm also experiencing this, on the go1.11beta2 branch:
~$ unset GOPATH
~$ mkdir z && cd z
~/z$ go mod -module foo.to/foobar -init
go: creating new go.mod: module foo.to/foobar
~/z$ go get github.com/aws/aws-sdk-go
go: finding github.com/aws/aws-sdk-go v1.14.30
go get github.com/aws/aws-sdk-go: cannot find module providing package github.com/aws/aws-sdk-go
Can't seem to get much working at all, where it was working in previous versions.
It also seems that the result is dependent on the contents of the mod cache. While bisecting, if I take an old version of cmd/go where it works, and then run a new version where it is broken, the new version succeeds if the cache is populated. I'm also hitting #26432 while trying to clean the mod cache.
Working around that issue by chmodding the $GOPATH/src/mod directory and blatting it after each retry, I was able to bisect to b9a764f (cmd/go: run git log with --no-show-signature) being the first bad commit.
And therein lies the issue:
$ git log --no-show-signature
fatal: unrecognised argument: --no-show-signature
$ git version
git version 2.7.4
For what it's worth, I'm on an Ubuntu 16.04 LTS release.
The problem come from git version i has 2.8.2 and failed, i uprade to 2.18 and it's working.
cause by the git.Stat() that don't find the correct ref/tags/revision, i don't know what the lowest git version we should have
This is a side-effect of https://golang.org/cl/123958 (the fix that went in for #26388).
CC @magiconair @rsc @dsymonds @oiooj
I stumbled over the same issue and I found the fact that go doesn't report anything about a failing command troublesome. I needed to use strace to figure out what's going on because even with -v nothing was printed about the failing command.
If possible please also extend -v's output to include for example failing commands to help debugging such issues.
A possible fix for the original issue could be to use -c log.showsignature=false instead of --no-show-signature which works fine even on older Git versions
-c paramater in "git log" means something different: https://git-scm.com/docs/git-log/2.6.5#git-log--c
--no-show-signature was introduced in git 2.10.0, roughly 2 years ago.
git -c log.showsignature=false log ?
Change https://golang.org/cl/125315 mentions this issue: cmd/go/internal/modfetch: run git log with "-c log.showsignature=false"
@ysmolsky This would be a parameter to git, not to git-log: https://git-scm.com/docs/git#git--cltnamegtltvaluegt
@zegl, yes, I was wrong! Sorry for brining in the confusion in a rush.
I see that CL was created, so all is good.
@ysmolsky
@ysmolsky ysmolsky ... beta2 on osx to cmd/go: get does not work with old git 3 days ago
--no-show-signature was introduced in git 2.10.0, roughly 2 years ago.
Linux distros have long term support but hold back minor releases from users. Example https://packages.ubuntu.com/search?keywords=git on ubuntu unless you are on the latest LTS that was released April 26th, 2018 then you are on this "old" version of git.
Oh wow. Sorry for this. Was moving across countries. Would have responded sooner otherwise. :(
I encountered this issue today (I'm using a stock version of Ubuntu 16.04). It's made harder to diagnose by the fact that this TODO from src/cmd/go/internal/modload.go remains unaddressed:
// TODO(rsc): It would be nice to return a specific error encountered
// during the loop above if possible, but it's not clear how to pick
// out the right one.
This means that we don't get to see the actual error encountered (unknown revision refs/tags/v1.0.1) in my case. Even that error isn't ideal when the actual error printed by git is fatal: unrecognised argument: --no-show-signature. Perhaps that output could be shown when using the -v flag?
My git version is 2.7.4.
Im looking at the CL https://go-review.googlesource.com/c/go/+/125315
It looks like it just changes the param it sends to git without any test or CI changes.
Shouldn't this be paired with a test update so we can avoid shipping a bug that is this breaking in the future?
Example -- pin git in the CI environment to 2.7.4 (current git on ubuntu 16) so if someone introduces a change that depends on a new git feature it bombs before merging.
nvm it was merged. :"(
Sorry, we're simply not set up to test against all specific git versions. We depend on finding a sequence of commands that works with all git versions and sticking with it.
Most helpful comment
I stumbled over the same issue and I found the fact that go doesn't report anything about a failing command troublesome. I needed to use
straceto figure out what's going on because even with-vnothing was printed about the failing command.If possible please also extend
-v's output to include for example failing commands to help debugging such issues.