зеркало из https://github.com/github/vitess-gh.git
Clean up build system
Switch to using go install. Leads to faster and cleaner builds. go install directly installs the binaries into $VTROOT/bin directly because $GOPATH==$VTROOT. It also intalls intermediate libraries under pkg, which results in reuse. There is also no more clutter in the source dirs: cleaner .gitignore.
This commit is contained in:
Родитель
6e13a72f92
Коммит
6615bcd90b
|
@ -1,37 +1,15 @@
|
|||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.py[cod]
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.out
|
||||
# Produced by yacc
|
||||
*.output
|
||||
|
||||
# vim files
|
||||
*.swp
|
||||
tags
|
||||
.DS_Store
|
||||
|
||||
# cbson & other C build dirs
|
||||
**/build
|
||||
|
||||
# mysql build dirs
|
||||
third_party/mysql
|
||||
go/cmd/mysqlctl/mysqlctl
|
||||
go/cmd/normalizer/normalizer
|
||||
go/cmd/topo2topo/topo2topo
|
||||
go/cmd/vtaction/vtaction
|
||||
go/cmd/vtgate/vtgate
|
||||
go/cmd/vtclient2/vtclient2
|
||||
go/cmd/vtctl/vtctl
|
||||
go/cmd/vtctld/vtctld
|
||||
go/cmd/vtocc/vtocc
|
||||
go/cmd/vttablet/vttablet
|
||||
go/cmd/vtworker/vtworker
|
||||
go/cmd/zk/zk
|
||||
go/cmd/zkclient2/zkclient2
|
||||
go/cmd/zkctl/zkctl
|
||||
go/cmd/zkns2pdns/zkns2pdns
|
||||
go/cmd/zkocc/zkocc
|
||||
test/goloadgen/goloadgen
|
||||
|
||||
go/logfile/tfile*
|
||||
|
|
36
Makefile
36
Makefile
|
@ -7,25 +7,11 @@ MAKEFLAGS = -s
|
|||
all: build unit_test queryservice_test integration_test
|
||||
|
||||
build:
|
||||
cd go/cmd/mysqlctl; go build
|
||||
cd go/cmd/normalizer; go build
|
||||
cd go/cmd/topo2topo; go build
|
||||
cd go/cmd/vtaction; go build
|
||||
cd go/cmd/vtgate; go build
|
||||
cd go/cmd/vtclient2; go build
|
||||
cd go/cmd/vtctl; go build
|
||||
cd go/cmd/vtctld; go build
|
||||
cd go/cmd/vtocc; go build
|
||||
cd go/cmd/vttablet; go build
|
||||
cd go/cmd/vtworker; go build
|
||||
cd go/cmd/zk; go build
|
||||
cd go/cmd/zkclient2; go build
|
||||
cd go/cmd/zkctl; go build
|
||||
cd go/cmd/zkns2pdns; go build
|
||||
cd go/cmd/zkocc; go build
|
||||
go install ./go/...
|
||||
|
||||
clean:
|
||||
go clean -i ./go/...
|
||||
|
||||
# alphabetically ordered unit tests
|
||||
# the ones that are commented out don't pass
|
||||
unit_test:
|
||||
go test ./go/...
|
||||
|
||||
|
@ -52,17 +38,3 @@ integration_test:
|
|||
cd test ; echo "secure test"; time ./secure.py $$VT_TEST_FLAGS
|
||||
cd test ; echo "resharding test"; time ./resharding.py $$VT_TEST_FLAGS
|
||||
cd test ; echo "vtdb test"; time ./vtdb_test.py $$VT_TEST_FLAGS
|
||||
|
||||
clean:
|
||||
cd go/cmd/mysqlctl; go clean
|
||||
cd go/cmd/normalizer; go clean
|
||||
cd go/cmd/vtaction; go clean
|
||||
cd go/cmd/vtgate; go clean
|
||||
cd go/cmd/vtclient2; go clean
|
||||
cd go/cmd/vtctl; go clean
|
||||
cd go/cmd/vtocc; go clean
|
||||
cd go/cmd/vttablet; go clean
|
||||
cd go/cmd/vtworker; go clean
|
||||
cd go/cmd/zk; go clean
|
||||
cd go/cmd/zkctl; go clean
|
||||
cd go/cmd/zkocc; go clean
|
||||
|
|
17
bootstrap.sh
17
bootstrap.sh
|
@ -39,28 +39,13 @@ go install launchpad.net/gozk/zookeeper
|
|||
|
||||
# FIXME(szopa): Get rid of this dependency.
|
||||
# install opts-go
|
||||
go get code.google.com/p/opts-go
|
||||
go get code.google.com/p/opts-go
|
||||
go get github.com/golang/glog
|
||||
|
||||
ln -snf $VTTOP/config $VTROOT/config
|
||||
ln -snf $VTTOP/data $VTROOT/data
|
||||
ln -snf $VTTOP/py $VTROOT/py-vtdb
|
||||
ln -snf $VTTOP/go/cmd/mysqlctl/mysqlctl $VTROOT/bin/mysqlctl
|
||||
ln -snf $VTTOP/go/cmd/normalizer/normalizer $VTROOT/bin/normalizer
|
||||
ln -snf $VTTOP/go/cmd/vtaction/vtaction $VTROOT/bin/vtaction
|
||||
ln -snf $VTTOP/go/cmd/vtgate/vtgate $VTROOT/bin/vtgate
|
||||
ln -snf $VTTOP/go/cmd/vtclient2/vtclient2 $VTROOT/bin/vtclient2
|
||||
ln -snf $VTTOP/go/cmd/vtctl/vtctl $VTROOT/bin/vtctl
|
||||
ln -snf $VTTOP/go/cmd/vtctld/vtctld $VTROOT/bin/vtctld
|
||||
ln -snf $VTTOP/go/cmd/vtocc/vtocc $VTROOT/bin/vtocc
|
||||
ln -snf $VTTOP/go/cmd/vttablet/vttablet $VTROOT/bin/vttablet
|
||||
ln -snf $VTTOP/go/cmd/vttopo/vttopo $VTROOT/bin/vttopo
|
||||
ln -snf $VTTOP/go/cmd/zk/zk $VTROOT/bin/zk
|
||||
ln -snf $VTTOP/go/cmd/zkctl/zkctl $VTROOT/bin/zkctl
|
||||
ln -snf $VTTOP/go/cmd/zkocc/zkocc $VTROOT/bin/zkocc
|
||||
ln -snf $VTTOP/go/cmd/zkclient2/zkclient2 $VTROOT/bin/zkclient2
|
||||
ln -snf $VTTOP/go/zk/zkctl/zksrv.sh $VTROOT/bin/zksrv.sh
|
||||
ln -snf $VTTOP/test/vthook-test.sh $VTROOT/vthook/test.sh
|
||||
|
||||
# install mysql
|
||||
if [ -d $VTROOT/dist/mysql ];
|
||||
|
|
|
@ -150,7 +150,7 @@ class VttabletTestEnv(TestEnv):
|
|||
if self.vtroot is None:
|
||||
raise EnvironmentError("VTROOT not defined")
|
||||
|
||||
framework.execute('go build', verbose=utils.options.verbose, cwd=self.vttop+'/go/cmd/mysqlctl')
|
||||
framework.execute('go install', verbose=utils.options.verbose, cwd=self.vttop+'/go/cmd/mysqlctl')
|
||||
|
||||
utils.wait_procs([self.tablet.init_mysql()])
|
||||
self.tablet.mquery("", ["create database vt_test_keyspace", "set global read_only = off"])
|
||||
|
@ -247,8 +247,8 @@ class VtoccTestEnv(TestEnv):
|
|||
|
||||
utils.setup()
|
||||
|
||||
framework.execute('go build', verbose=utils.options.verbose, cwd=self.vttop+'/go/cmd/vtocc')
|
||||
framework.execute('go build', verbose=utils.options.verbose, cwd=self.vttop+'/go/cmd/mysqlctl')
|
||||
framework.execute('go install', verbose=utils.options.verbose, cwd=self.vttop+'/go/cmd/vtocc')
|
||||
framework.execute('go install', verbose=utils.options.verbose, cwd=self.vttop+'/go/cmd/mysqlctl')
|
||||
|
||||
# start mysql
|
||||
res = subprocess.call([
|
||||
|
|
|
@ -245,7 +245,7 @@ def prog_compile(names):
|
|||
if options.no_build:
|
||||
logging.debug('Skipping build of %s', name)
|
||||
else:
|
||||
run('go build', cwd=vttop+'/go/cmd/'+name)
|
||||
run('go install', cwd=vttop+'/go/cmd/'+name)
|
||||
|
||||
# background zk process
|
||||
# (note the zkocc addresses will only work with an extra zkocc process)
|
||||
|
|
Загрузка…
Ссылка в новой задаче