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: allow 'go mod tidy' to proceed despite errors #26603

Open
bcmills opened this Issue Jul 25, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@bcmills
Member

bcmills commented Jul 25, 2018

When adding module definitions to existing repositories, we may (often?) find that one or more existing packages do not actually build, or that some import cannot be resolved due to a bug (e.g., #26602).

Failure to build is especially likely for files with rarely-used build constraints, but rarely-used constraints are exactly the space that go mod -sync scans.

If the user needs to intervene to fix something, it would be nice if they could generate the rest of the module definition before they start trying to troubleshoot one or two packages that still won't build. For example, here is the output of go mod -sync for golang.org/x/build: it's a huge dependency graph, and seems to be held back by one missing import.

~/src/golang.org/x/build$ go mod -sync
go: finding golang.org/x/oauth2 latest
go: finding golang.org/x/time/rate latest
go: finding google.golang.org/api/googleapi latest
go: finding golang.org/x/time latest
go: finding google.golang.org/api latest
go: finding golang.org/x/sync/errgroup latest
go: finding google.golang.org/api/oauth2/v2 latest
go: finding golang.org/x/sync latest
go: finding google.golang.org/api/oauth2 latest
go: finding github.com/golang/protobuf/ptypes/timestamp latest
go: finding github.com/golang/protobuf/ptypes latest
go: finding google.golang.org/api/option latest
go: finding google.golang.org/genproto/googleapis/api/label latest
go: finding google.golang.org/genproto/googleapis/api latest
go: finding google.golang.org/genproto/googleapis latest
go: finding google.golang.org/genproto latest
go: finding grpc.go4.org latest
go: finding google.golang.org/appengine/urlfetch latest
go: finding google.golang.org/appengine/datastore latest
go: finding go4.org/types latest
go: finding go4.org/strutil latest
go: finding google.golang.org/api/deploymentmanager/v2 latest
go: finding go4.org latest
go: finding google.golang.org/api/deploymentmanager latest
go: finding github.com/google/go-github/github latest
go: finding google.golang.org/appengine/memcache latest
go: finding golang.org/x/perf/storage latest
go: finding github.com/gregjones/httpcache latest
go: finding golang.org/x/perf latest
go: finding google.golang.org/genproto/googleapis/monitoring/v3 latest
go: finding google.golang.org/appengine/delay latest
go: finding google.golang.org/genproto/googleapis/monitoring latest
go: finding golang.org/x/crypto/ssh latest
go: finding golang.org/x/crypto latest
go: finding golang.org/x/crypto/acme/autocert latest
go: finding golang.org/x/net/http2 latest
go: finding golang.org/x/crypto/acme latest
go: finding golang.org/x/net latest
go: finding github.com/davecgh/go-spew/spew latest
go: finding github.com/tarm/serial latest
go: finding google.golang.org/appengine/log latest
go: finding github.com/shurcooL/httpgzip latest
go: finding golang.org/x/sys/unix latest
go: finding google.golang.org/api/iterator latest
go: finding golang.org/x/sys latest
go: finding github.com/golang/protobuf/proto latest
go: finding github.com/shurcooL/issues latest
go: finding github.com/shurcooL/issues/maintner latest
go: finding go4.org/syncutil latest
go: finding google.golang.org/api/compute latest
go: finding github.com/jellevandenhooff/dkim latest
go: finding golang.org/x/tools/go/vcs latest
go: finding github.com/google/go-cmp/cmp latest
go: finding golang.org/x/tools/go latest
go: finding github.com/bradfitz/go-smtpd/smtpd latest
go: finding golang.org/x/oauth2/google latest
go: finding github.com/bradfitz/go-smtpd latest
go: finding golang.org/x/tools latest
go: finding golang.org/x/net/context/ctxhttp latest
go: finding google.golang.org/api/container latest
go: finding golang.org/x/net/context latest
go: finding golang.org/x/net/nettest latest
go: finding google.golang.org/genproto/googleapis/api/metric latest
go: finding github.com/shurcooL/issuesapp latest
go: finding github.com/coreos/go-systemd/activation latest
go: finding github.com/coreos/go-systemd/daemon latest
go: finding github.com/coreos/go-systemd latest
go: finding github.com/shurcooL/gofontwoff latest
go: finding cloud.google.com/go/monitoring/apiv3 latest
go: finding cloud.google.com/go/storage latest
go: finding cloud.google.com/go/bigquery latest
go: finding cloud.google.com/go/errorreporting latest
go: finding cloud.google.com/go/datastore latest
go: finding cloud.google.com/go/monitoring latest
go: finding cloud.google.com/go/compute/metadata latest
go: finding cloud.google.com/go/compute latest
go: finding github.com/shurcooL/github_flavored_markdown latest
go: finding github.com/shurcooL/htmlg latest
go: finding github.com/shurcooL/users latest
go: finding github.com/shurcooL/octicon latest
go: finding github.com/shurcooL/reactions/component latest
go: finding github.com/shurcooL/notifications latest
go: finding github.com/dustin/go-humanize latest
go: finding github.com/shurcooL/reactions latest
go: finding google.golang.org/grpc/metadata latest
go: finding google.golang.org/grpc/codes latest
go: finding github.com/shurcooL/httpfs/html/vfstemplate latest
go: finding github.com/shurcooL/httpfs/html latest
go: finding github.com/google/go-querystring/query latest
go: finding github.com/shurcooL/httpfs latest
go: finding google.golang.org/grpc/status latest
go: finding github.com/shurcooL/httpfs/union latest
go: finding github.com/google/go-querystring latest
go: finding go.opencensus.io/plugin/ocgrpc latest
go: finding go.opencensus.io/stats/view latest
go: finding go.opencensus.io/trace latest
go: finding golang.org/x/text/unicode/norm latest
go: finding go.opencensus.io/plugin latest
go: finding go.opencensus.io/stats latest
go: finding github.com/shurcooL/github_flavored_markdown/gfmstyle latest
go: finding golang.org/x/text/unicode latest
go: finding google.golang.org/grpc/credentials latest
go: finding google.golang.org/grpc/credentials/oauth latest
go: finding google.golang.org/grpc/naming latest
go: finding github.com/shurcooL/events latest
go: finding github.com/shurcooL/events/event latest
go: finding golang.org/x/text/unicode/bidi latest
go: finding go.opencensus.io/plugin/ochttp latest
go: finding golang.org/x/text/secure/bidirule latest
go: finding github.com/anmitsu/go-shlex latest
go: finding github.com/shurcooL/webdavfs/vfsutil latest
go: finding go.opencensus.io/exporter/stackdriver/propagation latest
go: finding go.opencensus.io/exporter/stackdriver latest
go: finding github.com/shurcooL/webdavfs latest
go: finding go.opencensus.io/exporter latest
go: finding golang.org/x/text/secure latest
go: finding github.com/shurcooL/httperror latest
go: finding github.com/shurcooL/go/gopherjs_http latest
go: finding dmitri.shuralyov.com/state latest
go: finding github.com/shurcooL/go latest
go: finding github.com/google/martian/httpspec latest
go: finding dmitri.shuralyov.com/html/belt latest
go: import "golang.org/x/build/autocertcache" ->
	import "cloud.google.com/go/storage" ->
	test ->
	import "cloud.google.com/go/httpreplay" ->
	import "cloud.google.com/go/httpreplay/internal/proxy" ->
	import "github.com/google/martian/httpspec": cannot find module providing package github.com/google/martian/httpspec

@bcmills bcmills added the modules label Jul 25, 2018

@bcmills bcmills added this to the Go1.12 milestone Jul 25, 2018

@bcmills bcmills changed the title from cmd/go: allow 'go mod -sync' to proceed despite errors to cmd/go: allow 'go mod tidy' to proceed despite errors Oct 24, 2018

@bcmills bcmills modified the milestones: Go1.12, Go1.13 Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment