Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
Another attempt of getting Travis CI to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnall committed Jan 10, 2016
1 parent ba1859f commit 521aa14
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 45 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Expand Up @@ -2,10 +2,8 @@
*.sw*
.DS_Store

# Build tools.
build/ninja
build/llvm
build/llvm-build/
# Build infrastracture.
build/

# Build products.
out/
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -25,3 +25,6 @@
[submodule "deps/googletest"]
path = deps/googletest
url = https://chromium.googlesource.com/external/googletest
[submodule "deps/cmake"]
path = deps/cmake
url = https://cmake.org/cmake.git
50 changes: 40 additions & 10 deletions .travis.yml
@@ -1,13 +1,43 @@
language: cpp
sudo: false
compiler: gcc
# sudo: required
os: linux
# dist: trusty
language: generic
addons:
apt:
sources:
- llvm-toolchain-precise-3.7
- ubuntu-toolchain-r-test
packages:
- clang-3.7
- g++-5

env:
global:
- CC=clang-3.7
- CXX=clang++-3.7
matrix:
# - BUILD=Debug
- BUILD=Release

install:
# Check baseline memory usage; useful to know when OOMs occur
- free
- vmstat
- ps aux --sort=-rss | head -n 10

# Run the scripts in scripts/deps/all.sh one at a time. This buys a little
# time, as Travis limits each step here to 50 minutes.
- ./scripts/deps/setup.sh
- ./scripts/deps/ninja.sh
- ./scripts/deps/cmake.sh
- ./scripts/deps/llvm.sh

before_script:
- ./build/deps.sh
- ./build/run_gyp.sh
env:
- BUILD=Debug
- BUILD=Release
script: ./build/ninja -C out/$BUILD &&
./out/$BUILD/bare_tests &&
./out/$BUILD/crypto_tests &&
./out/$BUILD/monitor_tests

script:
- ./build/ninja -C out/$BUILD
- ./out/$BUILD/bare_tests
- ./out/$BUILD/crypto_tests
- ./out/$BUILD/monitor_tests
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -10,7 +10,7 @@ RISC V processor.
### One-Time Setup

```bash
./build/deps.sh
./scripts/deps/all.sh
./build/run_gyp.sh
```

Expand Down
29 changes: 0 additions & 29 deletions build/deps.sh

This file was deleted.

1 change: 1 addition & 0 deletions deps/cmake
Submodule cmake added at a9e8b1
15 changes: 15 additions & 0 deletions scripts/deps/all.sh
@@ -0,0 +1,15 @@
#!/bin/sh
#
# Sets up the build system dependencies.

set -o errexit # Stop the script on the first error.
set -o nounset # Catch un-initialized variables.

# NOTE: All the scripts below also need to be listed in .travis.yml
# We cannot call all.sh directly in .travis.yml, because that would
# exceed the 50-minute time limit for a single build step.

./scripts/deps/setup.sh
./scripts/deps/ninja.sh
./scripts/deps/cmake.sh
./scripts/deps/llvm.sh
15 changes: 15 additions & 0 deletions scripts/deps/cmake.sh
@@ -0,0 +1,15 @@
#!/bin/sh
#
# Builds and symlinks CMake.

set -o errexit # Stop the script on the first error.
set -o nounset # Catch un-initialized variables.

mkdir -p build/cmake-build
cd build/cmake-build
../../deps/cmake/bootstrap
make

cd ../..
rm -f build/cmake
ln -s "$PWD/build/cmake-build/bin/cmake" build/
23 changes: 23 additions & 0 deletions scripts/deps/llvm.sh
@@ -0,0 +1,23 @@
#!/bin/sh
#
# Builds and symlinks LLVM.

set -o errexit # Stop the script on the first error.
set -o nounset # Catch un-initialized variables.

mkdir -p build/llvm-build
cd build/llvm-build

# NOTE: CMake's ninja generator barfs if it can't find ninja on the path.
PATH="$PATH:$PWD/../" ../cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DLLVM_ENABLE_RTTI:BOOL=ON \
-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
-DLLVM_EXTERNAL_CLANG_SOURCE_DIR:PATH="$PWD/../../deps/clang" \
../../deps/llvm
../ninja

cd ../..
rm -f build/llvm
ln -s "$PWD/build/llvm-build/Release+Debug+Asserts/" build/llvm
16 changes: 16 additions & 0 deletions scripts/deps/ninja.sh
@@ -0,0 +1,16 @@
#!/bin/sh
#
# Builds and symlinks Ninja.

set -o errexit # Stop the script on the first error.
set -o nounset # Catch un-initialized variables.

# NOTE: Ninja really wants to be built inside its source tree.
cd deps/ninja

./configure.py --bootstrap
rm -f null.o # NOTE: This gets created for some weird reason.

cd ../..
rm -f build/ninja
ln -s "$PWD/deps/ninja/ninja" build/ninja
13 changes: 13 additions & 0 deletions scripts/deps/setup.sh
@@ -0,0 +1,13 @@
#!/bin/sh
#
# Project-specific setup.

set -o errexit # Stop the script on the first error.
set -o nounset # Catch un-initialized variables.

# Check out all the build dependencies stored in Git submodules.
git submodule update --init

# Symlink build scripts in the build directory.
mkdir -p build/
ln -s "$PWD/scripts/run_gyp.sh" build/run_gyp.sh
File renamed without changes.
2 changes: 1 addition & 1 deletion src/common.gypi
@@ -1,6 +1,6 @@
{
'variables': {
'clang': 'build/llvm-build/Release+Debug+Asserts/bin',
'clang': 'build/llvm-build/bin',
'library': 'static_library',
'mac_sdk': '10.11',
'mac_deployment_target': '10.7',
Expand Down

0 comments on commit 521aa14

Please sign in to comment.