Skip to content

Commit 42b762d

Browse files
committed
Travis uses gclient.
1 parent dad58cc commit 42b762d

30 files changed

+378
-229
lines changed

.travis.yml

Lines changed: 86 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,100 @@
1+
sudo: false
12

23
language: cpp
34

4-
compiler:
5-
- clang
6-
75
env:
8-
- GOPATH=${TRAVIS_BUILD_DIR}/go CPPFLAGS="-I/usr/src/gmock/include" CXXFLAGS="-Wall -Werror"
6+
global:
7+
- INSTALL_DIR=${TRAVIS_BUILD_DIR}/../install
8+
- PROTOC="${INSTALL_DIR}/bin/protoc"
9+
- GOPATH=${INSTALL_DIR}/go
10+
- MAKE=make
11+
12+
addons:
13+
apt:
14+
sources: &common_sources
15+
- ubuntu-toolchain-r-test
16+
- llvm-toolchain-precise-3.6
17+
packages: &common_packages
18+
- autoconf
19+
- automake
20+
- build-essential
21+
- python-dev
22+
- libstdc++-4.9-dev
23+
- tcl8.5
24+
25+
matrix:
26+
include:
27+
- compiler: clang
28+
os: osx
29+
- compiler: clang
30+
os: linux
31+
env: REAL_CC=clang-3.6 REAL_CXX=clang++-3.6
32+
addons:
33+
apt:
34+
sources: *common_sources
35+
packages:
36+
- *common_packages
37+
- clang-3.6
38+
exclude:
39+
- compiler: gcc
40+
os: linux
41+
env: REAL_CC=gcc-4.9 REAL_CXX=g++-4.9
42+
addons:
43+
apt:
44+
sources: *common_sources
45+
packages:
46+
- *common_packages
47+
- g++-4.9
48+
49+
cache:
50+
apt: true
51+
pip: true
52+
directories:
53+
- $HOME/.cache/pip
54+
- $HOME/.ccache
55+
- $TRAVIS_BUILD_DIR/../ct
56+
- $TRAVIS_BUILD_DIR/../depot_tools
57+
- $TRAVIS_BUILD_DIR/../install
958

10-
cache: apt
1159

1260
before_install:
13-
- sudo apt-add-repository -y ppa:sao/backports
14-
- sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
15-
- sudo apt-add-repository -y ppa:fcitx-team/nightly
16-
- sudo apt-add-repository -y ppa:chris-lea/protobuf
17-
- sudo apt-add-repository -y ppa:asolovets/backports
18-
- sudo apt-get update -qq
19-
- sudo apt-get install -qq openssl libssl-dev autoconf automake protobuf-compiler libprotobuf-java libprotobuf-dev python-dev libjson-c-dev libgoogle-glog-dev libgflags-dev libldns-dev libstdc++-4.8-dev libleveldb-dev libsnappy-dev libgoogle-perftools-dev
20-
# Stupid frikkin' google-mock package on Precise is b0rked, so hack it up:
21-
- wget https://googlemock.googlecode.com/files/gmock-1.7.0.zip -O /tmp/gmock-1.7.0.zip
22-
- unzip -d /tmp /tmp/gmock-1.7.0.zip
23-
- sudo mv /tmp/gmock-1.7.0 /usr/src/gmock
24-
- wget https://github.com/ellzey/libevhtp/archive/1.2.10.zip -O /tmp/libevhtp-1.2.10.zip
25-
- unzip -d /tmp/ /tmp/libevhtp-1.2.10.zip
26-
- mkdir /tmp/libevhtp-1.2.10/build
27-
- pushd /tmp/libevhtp-1.2.10/build && cmake -DEVHTP_DISABLE_REGEX:STRING=ON -DCMAKE_C_FLAGS="-fPIC" .. && sudo make install; popd
28-
- sudo pip install -r python/requirements.txt
29-
- sudo ln -s protobuf-java.jar /usr/share/java/protobuf.jar
61+
# Set compiler version overrides if we have any:
62+
- if [ "${REAL_CC}" != "" ]; then export CC=${REAL_CC} CXX=${REAL_CXX}; fi
63+
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then . ./build/travis.osx.before_install.sh; fi
64+
- mkdir -p ${INSTALL_DIR}/include ${INSTALL_DIR}/lib ${INSTALL_DIR}/java
65+
- echo "INSTALL_DIR=${INSTALL_DIR}"
3066
- mkdir -p $GOPATH/src/github.com/google
31-
- ln -s $PWD $GOPATH/src/github.com/google
67+
- ln -sf $PWD $GOPATH/src/github.com/google
68+
- echo "jars.protobuf = ${INSTALL_DIR}/java/protobuf.jar" > local.properties
69+
- echo "protoc.bin = ${PROTOC}" >> local.properties
70+
71+
install:
72+
- autoconf --version
73+
- pushd ..
74+
- mkdir -p ct
75+
- wget http://central.maven.org/maven2/com/google/protobuf/protobuf-java/2.6.0/protobuf-java-2.6.0.jar -O ${INSTALL_DIR}/java/protobuf.jar
76+
- if [ ! -e depot_tools/gclient ]; then git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git; fi
77+
- export PATH="$PATH:/usr/local/bin:"`pwd`/depot_tools
78+
- cd ct
79+
- ln -s ../certificate-transparency certificate-transparency
80+
- if [ ! -f .gclient ]; then gclient config --name="certificate-transparency" --unmanaged https://github.com/${TRAVIS_REPO_SLUG}.git; fi
81+
- gclient sync
82+
- popd
83+
- export PYTHONPATH=$(python -m site --user-site)
84+
- pip install --user --upgrade -r python/requirements.txt
3285
# Sigh, go get -t will fetch part of this package, but doesn't catch the transitive deps so grab it manually:
3386
- go get github.com/stretchr/testify
3487
- go get -v -d -t ./...
35-
- java -version
36-
- javac -version
37-
- go version
38-
- openssl version
39-
40-
install:
41-
- ./autogen.sh
4288

4389
script:
44-
- ./configure && make -j$(getconf _NPROCESSORS_ONLN) check VERBOSE=1
90+
- getconf _NPROCESSORS_ONLN
91+
- ${MAKE} -j$(getconf _NPROCESSORS_ONLN) check VERBOSE=1
4592
- ant build test
46-
- make -C python test
47-
- go test -v ./go/...
93+
- ${MAKE} -C python test
94+
- |
95+
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
96+
pushd ${GOPATH}
97+
LD_LIBRARY_PATH=${INSTALL_DIR}/lib CGO_CPPFLAGS="-I${INSTALL_DIR}/include" CGO_LDFLAGS="-L${INSTALL_DIR}/lib" go test -v ./src/github.com/google/certificate-transparency/...
98+
popd
99+
fi
100+

DEPS

Lines changed: 81 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
deps = {
22
"gflags": "https://github.com/gflags/gflags.git@v2.1.2",
3-
"glog": "https://github.com/google/glog.git@v0.3.4",
4-
"gperftools": "https://github.com/gperftools/gperftools.git@gperftools-2.4",
3+
"glog": "https://github.com/benlaurie/glog.git@0.3.4-fix",
54
"googlemock": "https://github.com/google/googlemock.git@release-1.7.0",
65
"googlemock/gtest": "https://github.com/google/googletest.git@release-1.7.0",
7-
"json-c": "https://github.com/json-c/json-c.git@json-c-0.12-20140410",
8-
"ldns": "git://git.nlnetlabs.nl/ldns@release-1.6.17",
6+
"json-c": "https://github.com/AlCutter/json-c.git@json-c-0.12-20140410-fix",
7+
"ldns": "https://github.com/benlaurie/ldns.git@1.6.17-fix",
98
"leveldb": "https://github.com/google/leveldb.git@v1.18",
109
"libevent": "https://github.com/libevent/libevent.git@release-2.0.22-stable",
1110
"libevhtp": "https://github.com/ellzey/libevhtp.git@ba4c44eed1fb7a5cf8e4deb236af4f7675cc72d5",
12-
"openssl": "https://github.com/benlaurie/openssl.git@fd5d2ba5e09f86e9ccf797dddd2d09ac8e197e35", # 1.0.2-freebsd
13-
"protobuf/gtest": "https://github.com/google/googletest.git@release-1.5.0",
14-
"protobuf": "https://github.com/google/protobuf.git@v2.6.1",
11+
"openssl": "https://github.com/openssl/openssl.git@OpenSSL_1_0_2d",
12+
"protobuf": "https://github.com/google/protobuf.git@v2.6.1",
13+
"protobuf/gtest": "https://github.com/google/googletest.git@release-1.7.0",
1514
# Randomly chosen github mirror
1615
"sqlite3-export": "http://repo.or.cz/sqlite-export.git",
1716
"sqlite3": "http://repo.or.cz/sqlite.git@version-3.8.10.1",
@@ -23,10 +22,12 @@ deps_overrides = {
2322
"freebsd10": {
2423
"googlemock": "https://github.com/AlCutter/googlemock-fbsd.git@1.7.0",
2524
"googlemock/gtest": "https://github.com/AlCutter/googletest-fbsd.git@1.7.0",
26-
"protobuf/gtest": "https://github.com/benlaurie/googletest.git@1.5.0-fix",
27-
"protobuf": "https://github.com/benlaurie/protobuf.git@2.6.1-fix",
28-
"glog": "https://github.com/benlaurie/glog.git@0.3.4-fix",
29-
"ldns": "https://github.com/benlaurie/ldns.git@1.6.17-fix",
25+
"protobuf": "https://github.com/benlaurie/protobuf.git@2.6.1-fix",
26+
"protobuf/gtest": "https://github.com/AlCutter/googletest-fbsd.git@1.7.0",
27+
"libunwind": "git://git.sv.gnu.org/libunwind.git@v1.1",
28+
},
29+
"linux2": {
30+
"libunwind": "git://git.sv.gnu.org/libunwind.git@v1.1",
3031
},
3132
"darwin": {
3233
"ldns": "https://github.com/benlaurie/ldns.git@1.6.17-fix",
@@ -39,6 +40,7 @@ make_os = {
3940
}
4041

4142
import os
43+
import multiprocessing
4244
import sys
4345

4446
print "Host platform is %s" % sys.platform
@@ -49,15 +51,78 @@ if sys.platform in make_os:
4951
make = make_os[sys.platform]
5052
else:
5153
make = "make"
52-
print "Using make %s" % make
54+
55+
num_cores = multiprocessing.cpu_count()
56+
57+
print "Using make %s with %d jobs" % (make, num_cores)
5358

5459
here = os.getcwd()
55-
install = os.path.join(here, "install")
5660

5761
hooks = [
5862
{
59-
"name": "deps",
60-
"pattern": ".",
61-
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "INSTALL_DIR=%s"%install],
63+
"name": "libunwind",
64+
"pattern": "^libunwind/",
65+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_libunwind" ],
66+
},
67+
{
68+
"name": "tcmalloc",
69+
"pattern": "^tcmalloc/",
70+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_tcmalloc" ],
71+
},
72+
{
73+
"name": "openssl",
74+
"pattern": "^openssl/",
75+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_openssl" ],
76+
},
77+
{
78+
"name": "protobuf",
79+
"pattern": "^protobuf/",
80+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_protobuf" ],
81+
},
82+
{
83+
"name": "libevent",
84+
"pattern": "^libevent/",
85+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_libevent" ],
86+
},
87+
{
88+
"name": "libevhtp",
89+
"pattern": "^libevhtp/",
90+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_libevhtp" ],
6291
},
92+
{
93+
"name": "gflags",
94+
"pattern": "^gflags/",
95+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_gflags" ],
96+
},
97+
{
98+
"name": "glog",
99+
"pattern": "^glog/",
100+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_glog" ],
101+
},
102+
{
103+
"name": "ldns",
104+
"pattern": "^ldns/",
105+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_ldns" ],
106+
},
107+
{
108+
"name": "sqlite3",
109+
"pattern": "^sqlite3/",
110+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_sqlite3" ],
111+
},
112+
{
113+
"name": "leveldb",
114+
"pattern": "^leveldb/",
115+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_leveldb" ],
116+
},
117+
{
118+
"name": "json-c",
119+
"pattern": "^json-c/",
120+
"action": [ make, "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_json-c" ],
121+
},
122+
# Do this last
123+
{
124+
"name": "ct",
125+
"pattern": "^certificate-transparency/",
126+
"action": [ make, "-j", str(num_cores), "-f", os.path.join(here, "certificate-transparency/build.gclient"), "_configure-ct" ],
127+
}
63128
]

Makefile.am

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ACLOCAL_AMFLAGS = -Im4
12

23
AM_CPPFLAGS = \
34
-I$(GMOCK_DIR)/include \
@@ -18,7 +19,11 @@ BUILT_SOURCES = \
1819
BUILD_VERSION = `git describe --abbrev=0 --dirty --always --tags`
1920

2021
AM_TESTS_ENVIRONMENT = \
21-
export LD_LIBRARY_PATH=$(LIBRARY_PATH);
22+
LD_LIBRARY_PATH=$(INSTALL_DIR)/lib
23+
24+
# TODO(pphaneuf): change these to autoconf substitutions
25+
export PROTOC
26+
export INSTALL_DIR
2227

2328
.PHONY: cpp/version.cc
2429
cpp/version.o: \
@@ -48,6 +53,9 @@ noinst_LIBRARIES = \
4853
cpp/libtest.a
4954

5055
check_PROGRAMS = \
56+
cpp/util/thread_pool_test \
57+
cpp/monitoring/gcm/exporter_test \
58+
cpp/net/url_fetcher_test \
5159
$(TESTS)
5260

5361
# TODO(pphaneuf): ct-dns-server-test.py has been disabled, because of
@@ -79,9 +87,7 @@ TESTS = \
7987
cpp/monitor/database_test \
8088
cpp/monitoring/counter_test \
8189
cpp/monitoring/gauge_test \
82-
cpp/monitoring/gcm/exporter_test \
8390
cpp/monitoring/registry_test \
84-
cpp/net/url_fetcher_test \
8591
cpp/proto/serializer_test \
8692
cpp/server/proxy_test \
8793
cpp/util/etcd_delete_test \
@@ -91,11 +97,10 @@ TESTS = \
9197
cpp/util/libevent_wrapper_test \
9298
cpp/util/masterelection_test \
9399
cpp/util/sync_task_test \
94-
cpp/util/task_test \
95-
cpp/util/thread_pool_test
100+
cpp/util/task_test
96101

97102
all-local:
98-
$(MAKE) -C python PROTOC=$(PROTOC)
103+
$(MAKE) -C python
99104

100105
clean-local:
101106
$(MAKE) -C python clean

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Best and test Go code:
7373
- git
7474
- GNU make
7575
- libtool
76+
- shtool
7677
- Tcl
7778
- pkgconf
7879
- python27
@@ -89,7 +90,7 @@ of above deps], and Ubuntu 14.04.
8990
```bash
9091
mkdir ct # or whatever directory you prefer
9192
cd ct
92-
gclient config git@github.com:google/certificate-transparency.git
93+
gclient config --name="certificate-transparency" git@github.com:google/certificate-transparency.git
9394
gclient sync
9495
# substitute gmake or gnumake below if that's that your platform calls it:
9596
make -C certificate-transparency check

0 commit comments

Comments
 (0)