-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vendor: add fake imports for glide's benefit
We've repeatedly encountered issues arising from the fact that entries in `glide.yaml` are not treated as the, or even as additional, roots in the calulation of the transitive dependency closure. Previously in #11797, we attempted to clarify the situation by pruning all derivable specs from `glide.yaml`, so that it would be clear where the dependency roots were indeed coming from. We however left vendored tools, and their transitive dependencies, there, as they were not derivable from any imports (e.g. some are not importable due to `package main`). As we've already found though, simply adding a tool to `glide.yaml`, or even `glide get`'ing them, doesn't work. Thus, to reliably vendor tools and their dependencies, we need to introduce artifical imports of them. We get around the `package main` issue with by hiding the imports in a file that is build-tagged `+glide` so we never attempt to build it. --- The `glide up` used to test this also picked up the following uninteresting changes: - golang.org/x/tools: ae1141fc -> ae1141fc - golang/tools@ae1141f...3d92dd6 - github.com/cockroachdb/cockroach-go: 2c874f13 -> 140a8c58 - cockroachdb/cockroach-go@2c874f1...140a8c5 - github.com/coreos/etcd: cfd10b4 -> b713113 - etcd-io/etcd@cfd10b4...b713113 - github.com/docker/distribution: 67095fbc -> 844b9287 - distribution/distribution@67095fb...844b928 - github.com/google/go-github: 171a9316 -> 43e7458c - google/go-github@171a931...43e7458 - github.com/opencontainers/runc: 5974b4c7 -> 34f23cb9 - opencontainers/runc@5974b4c...34f23cb Note: The etcd bump *does* include [a raft change](etcd-io/etcd#6935), but it is test only
- Loading branch information
Showing
5 changed files
with
80 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2016 The Cockroach Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
// +build glide | ||
|
||
package main | ||
|
||
// Our vendoring tool, glide, only considers imports as the set of roots used | ||
// to compute the transitive closure of dependencies it should resolve. | ||
// We depend on many tools which we don't actually import directly elsewhere – | ||
// e.g in a `go generate` or our Makefiles – but convincing `glide` to vendor | ||
// them, and their dependencies, is difficult: https://github.com/Masterminds/glide/issues/690 | ||
// | ||
// Thus, instead of trying to use `glide get` or `glide.yaml` to document those | ||
// additional dependency roots, we add fake imports here for glide to find. | ||
// NB: Some of these are `package main` so they cannot acutally be imported, so | ||
// this file is build-tagged +glide to prevent attempting to build it. | ||
|
||
import ( | ||
_ "github.com/client9/misspell/cmd/misspell" | ||
_ "github.com/cockroachdb/c-protobuf/cmd/protoc" | ||
_ "github.com/cockroachdb/crlfmt" | ||
_ "github.com/cockroachdb/stress" | ||
_ "github.com/golang/lint/golint" | ||
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" | ||
_ "github.com/jteeuwen/go-bindata/go-bindata" | ||
_ "github.com/kisielk/errcheck" | ||
_ "github.com/kkaneda/returncheck" | ||
_ "github.com/mattn/goveralls" | ||
_ "github.com/mdempsky/unconvert" | ||
_ "github.com/mibk/dupl" | ||
_ "github.com/robfig/glock" | ||
_ "github.com/wadey/gocovmerge" | ||
_ "golang.org/x/tools/cmd/goimports" | ||
_ "golang.org/x/tools/cmd/goyacc" | ||
_ "golang.org/x/tools/cmd/stringer" | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters