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

cmd/go: get is broken, old git cannot accept --no-show-signature parameter #26501

Closed
menems opened this issue Jul 20, 2018 · 15 comments
Closed
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@menems
Copy link

menems commented Jul 20, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11beta2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (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"

What did you do?

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)
}

What did you expect to see?

no error on run

What did you see instead?

$ 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

@pwaller
Copy link
Contributor

pwaller commented Jul 20, 2018

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.

@menems
Copy link
Author

menems commented Jul 20, 2018

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

@ysmolski ysmolski changed the title Error module on beta2 on osx cmd/go: get does not work with old git Jul 20, 2018
@ysmolski ysmolski changed the title cmd/go: get does not work with old git cmd/go: get cannot fetch package with old git Jul 20, 2018
@ysmolski ysmolski added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 20, 2018
@ysmolski ysmolski changed the title cmd/go: get cannot fetch package with old git cmd/go: get is broken due old git does not recognise --no-show-signature Jul 20, 2018
@ysmolski ysmolski added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 20, 2018
@ysmolski ysmolski added this to the Go1.11 milestone Jul 20, 2018
@ysmolski ysmolski changed the title cmd/go: get is broken due old git does not recognise --no-show-signature cmd/go: get is broken, old git cannot accept --no-show-signature parameter Jul 20, 2018
@bcmills
Copy link
Contributor

bcmills commented Jul 20, 2018

This is a side-effect of https://golang.org/cl/123958 (the fix that went in for #26388).

CC @magiconair @rsc @dsymonds @oiooj

@rudis
Copy link

rudis commented Jul 20, 2018

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.

@rudis
Copy link

rudis commented Jul 20, 2018

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

@ysmolski
Copy link
Member

-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.

@oiooj
Copy link
Member

oiooj commented Jul 20, 2018

git -c log.showsignature=false log ?

@gopherbot
Copy link

Change https://golang.org/cl/125315 mentions this issue: cmd/go/internal/modfetch: run git log with "-c log.showsignature=false"

@zegl
Copy link
Contributor

zegl commented Jul 20, 2018

@ysmolsky This would be a parameter to git, not to git-log: https://git-scm.com/docs/git#git--cltnamegtltvaluegt

@ysmolski
Copy link
Member

@zegl, yes, I was wrong! Sorry for brining in the confusion in a rush.

I see that CL was created, so all is good.

@trashhalo
Copy link

@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.

@magiconair
Copy link
Contributor

Oh wow. Sorry for this. Was moving across countries. Would have responded sooner otherwise. :(

@rogpeppe
Copy link
Contributor

rogpeppe commented Jul 24, 2018

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.

@trashhalo
Copy link

trashhalo commented Jul 24, 2018

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. :"(

@rsc
Copy link
Contributor

rsc commented Aug 10, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests