-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: replace directives not helping with dependencies #26841
Comments
I'm not sure how you got into this state so I'm not quite sure what the go command should do to help. For the record, I think the go.mod you want is simply:
"go get" has always understood that k8s.io/client-go comes from github, because the <meta> tags on https://k8s.io/client-go?go-get=1 say so. So you don't need to try to explain that fact in the go.mod. |
I got there after many frustrating attempts to correct the solve in dep, which I believed to involve constraints that used a different source repo. These are the important bits of my ~~~
go: import "github.mycompany.com/proj/log" ->
import "github.com/sirupsen/logrus" ->
import "golang.org/x/crypto/ssh/terminal": cannot find module providing package golang.org/x/crypto/ssh/terminal
go: import "github.mycompany.com/proj/log" ->
import "github.com/sirupsen/logrus" ->
import "golang.org/x/sys/unix": cannot find module providing package golang.org/x/sys/unix
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/azure" ->
import "github.com/Azure/azure-sdk-for-go/arm/compute": cannot find module providing package github.com/Azure/azure-sdk-for-go/arm/compute
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/azure" ->
import "github.com/Azure/azure-sdk-for-go/arm/network": cannot find module providing package github.com/Azure/azure-sdk-for-go/arm/network
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/gce" ->
import "golang.org/x/oauth2": cannot find module providing package golang.org/x/oauth2
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/gce" ->
import "golang.org/x/oauth2/google": cannot find module providing package golang.org/x/oauth2/google
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/gce" ->
import "google.golang.org/api/compute/v1": cannot find module providing package google.golang.org/api/compute/v1
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/kubernetes" ->
import "k8s.io/client-go/pkg/api": cannot find module providing package k8s.io/client-go/pkg/api
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/kubernetes" ->
import "k8s.io/client-go/pkg/api/v1": cannot find module providing package k8s.io/client-go/pkg/api/v1
go: import "github.mycompany.com/proj/prometheus/promcfg" ->
import "github.com/prometheus/prometheus/discovery/config" ->
import "github.com/prometheus/prometheus/discovery/kubernetes" ->
import "k8s.io/client-go/pkg/apis/extensions/v1beta1": cannot find module providing package k8s.io/client-go/pkg/apis/extensions/v1beta1 |
All of those failures look like #26602, which is fixed at head. Could you try building the |
modules are amazing. Updated go from master fulfills all of my dependencies correctly and super fast, with no special configuration. Thank you. |
(
go version
)go version go1.11beta3 windows/amd64
(
go env
)set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\jxt82ty\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\jxt82ty\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Users\jxt82ty\sdk\go1.11beta3
set GOTMPDIR=
set GOTOOLDIR=C:\Users\jxt82ty\sdk\go1.11beta3\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\tmp\pcf_config_generator\pcfconfgen\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\jxt82ty\AppData\Local\Temp\1\go-build932205774=/tmp/go-build -gno-record-gcc-switches
What did you do?
I tried to resolve dependencies with
go mod tidy
with a replace statement in the go.mod file.What did you expect to see?
I expected for the replacement to assist in resolving the dependencies.
What did you see instead?
The text was updated successfully, but these errors were encountered: