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: cannot exclude version of module when it is the latest version #27000

Closed
myitcv opened this issue Aug 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@myitcv
Copy link
Member

commented Aug 15, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11rc1 linux/amd64

Does this issue reproduce with the latest release?

Per above

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/tmp.MK5BVQAC8k/hello/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build937954680=/tmp/go-build -gno-record-gcc-switches"

What did you do?

This is based on the vgo tour, using cmd/go instead:

cd $(mktemp -d)
mkdir hello
cd hello
go mod init github.com/myitcv/hello

cat <<EOD > hello.go
package main

import (
        "fmt"
        "rsc.io/quote"
)

func main() {
        fmt.Println(quote.Hello())
}
EOD

go mod tidy
go list -m all

go get -u
go list -m all

Now let's assume we want to exclude rsc.io/sampler@v1.99.99:

go mod edit -exclude rsc.io/sampler@v1.99.99

Now we list the available versions:

$ go list -m -versions rsc.io/sampler
go: github.com/myitcv/hello() depends on excluded rsc.io/sampler(v1.99.99) with no newer version available

Hmm. No luck.

Ok, let's try to upgrade across the board:

$go get -u
go: github.com/myitcv/hello() depends on excluded rsc.io/sampler(v1.99.99) with no newer version available

Again, no luck.

Let's try and explicitly put ourselves onto @latest then rinse and repeat the above steps:

$ go mod edit -require rsc.io/sampler@latest
$ go list -m -versions rsc.io/sampler
go: github.com/myitcv/hello() depends on excluded rsc.io/sampler(v1.99.99) with no newer version available
$ go get -u
go: github.com/myitcv/hello() depends on excluded rsc.io/sampler(v1.99.99) with no newer version available

What did you expect to see?

A working build with rsc.io/sampler@v1.99.99 excluded.

What did you see instead?

Per above; not able to effectively exclude rsc.io/sampler@v1.99.99.

Unless I'm missing something, this feels like a regression?

/cc @rsc @bcmills

@myitcv myitcv added the modules label Aug 15, 2018

@myitcv myitcv added this to the Go1.11 milestone Aug 15, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2018

Duplicate of #26454. Leaving for Go 1.12.

@rsc rsc closed this Aug 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.