Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Clean up build system
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sougou committed Dec 24, 2013
1 parent 6e13a72 commit 6615bcd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 80 deletions.
34 changes: 6 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/...

Expand All @@ -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 changes: 1 addition & 16 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
6 changes: 3 additions & 3 deletions test/queryservice_tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def setUp(self):
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"])
Expand Down Expand Up @@ -247,8 +247,8 @@ def setUp(self):

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([
Expand Down
2 changes: 1 addition & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6615bcd

Please sign in to comment.