diff --git a/Makefile b/Makefile index 29f59a2daa4c..4424ceb22d8c 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ TAGS := ARCHIVE := cockroach.src.tgz STARTFLAGS := -s type=mem,size=1GiB --logtostderr BUILDMODE := install -BUILDTARGET := . +BUILDTARGET := ./pkg/cmd/cockroach SUFFIX := INSTALL := install prefix := /usr/local diff --git a/pkg/acceptance/cluster/dockercluster.go b/pkg/acceptance/cluster/dockercluster.go index 828401709397..785a298ed768 100644 --- a/pkg/acceptance/cluster/dockercluster.go +++ b/pkg/acceptance/cluster/dockercluster.go @@ -75,7 +75,7 @@ var maxRangeBytes = config.DefaultZoneConfig().RangeMaxBytes // CockroachBinary is the path to the host-side binary to use. var CockroachBinary = flag.String("b", func() string { - rootPkg, err := build.Import("github.com/cockroachdb/cockroach", "", 0) + rootPkg, err := build.Import("github.com/cockroachdb/cockroach", "", build.FindOnly) if err != nil { panic(err) } diff --git a/pkg/cli/flags_test.go b/pkg/cli/flags_test.go index de4522ba4462..24beb837fd0c 100644 --- a/pkg/cli/flags_test.go +++ b/pkg/cli/flags_test.go @@ -46,7 +46,7 @@ func TestNoLinkForbidden(t *testing.T) { defer leaktest.AfterTest(t)() // Verify that the cockroach binary doesn't depend on certain packages. buildutil.VerifyNoImports(t, - "github.com/cockroachdb/cockroach", true, + "github.com/cockroachdb/cockroach/pkg/cmd/cockroach", true, []string{ "testing", // defines flags "go/build", // probably not something we want in the main binary diff --git a/main.go b/pkg/cmd/cockroach/main.go similarity index 94% rename from main.go rename to pkg/cmd/cockroach/main.go index 2329452b29dc..7e5bc4f7c31a 100644 --- a/main.go +++ b/pkg/cmd/cockroach/main.go @@ -12,11 +12,13 @@ // implied. See the License for the specific language governing // permissions and limitations under the License. -package main - +// This is the default entry point for a CockroachDB binary. +// // The ccl hook import below means building this will produce CCL'ed binaries. // This file itself remains Apache2 to preserve the organization of ccl code // under the /pkg/ccl subtree, but is unused for pure FLOSS builds. +package main + import ( _ "github.com/cockroachdb/cockroach/pkg/ccl" // ccl init hooks "github.com/cockroachdb/cockroach/pkg/cli"