Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(travis) Use ccache to speed up Travis CI builds. #5

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .ci/before_install.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail

ccache_wrapper () {
mkdir -p ~/ccache
echo '#!/bin/sh' >> ~/ccache/ccache-"$1"
echo "ccache $1 \"\$*\"" >> ~/ccache/ccache-"$1"
chmod +x ~/ccache/ccache-"$1"
}

if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
brew update
brew install findutils
brew install findutils ccache
brew cask reinstall java
brew unlink python # fixes 'run_one_line' is not defined error in backtrace
ccache_wrapper clang
ccache_wrapper clang++
ln -sf "$(command -v ccache)" "$(command -v clang)"
ln -sf "$(command -v ccache)" "$(command -v clang++)"
fi

if [[ "${TRAVIS_OS_NAME}" == linux ]]; then
wget https://raw.githubusercontent.com/sormuras/bach/master/install-jdk.sh
ccache_wrapper gcc
ccache_wrapper g++
ln -sf "$(command -v ccache)" "$(command -v gcc)"
ln -sf "$(command -v ccache)" "$(command -v g++)"
fi
2 changes: 1 addition & 1 deletion .ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BOOT_JDK10="jdk-10-ea+${BOOT_JDK10_VER}"
echo "which java: $(which java)"
ulimit -c unlimited -S

sh ./gradlew build -x :web:test --no-daemon --stacktrace --info
sh ./gradlew build -x :web:test --no-daemon --stacktrace --info --console=plain

# Print core dumps when JVM crashes.
RESULT=$?
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: java
language: c
sudo: false

addons:
Expand Down Expand Up @@ -39,6 +39,7 @@ before_cache:
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
ccache: true
directories:
- $HOME/.gradle/caches/

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build_script:
$env:VSVARS32FILE = "$env:VCINSTALLDIR\vcvars32.bat"
refreshenv
# Must invoke gradle with cmd.exe so stderr output doesn't fail the build:
- cmd: gradlew test -PCOMPILE_WEBKIT=false --stacktrace -x :web:test --info --no-daemon
- cmd: gradlew test -PCOMPILE_WEBKIT=false --stacktrace -x :web:test --info --no-daemon --console=plain
on_finish:
- ps: |
$crashes = Get-ChildItem -Include hs_err_pid*.log -Recurse
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/linux.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ setupTools("linux_freetype_tools",
}
)

def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "gcc";
def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "g++";
def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "gcc"
def linker = IS_COMPILE_PARFAIT ? "parfait-g++" : "g++"

LINUX.glass = [:]
LINUX.glass.variants = ["glass", "glassgtk2"]
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/mac.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def linkFlags = [
"-dynamiclib", "-lobjc"].flatten();


def compiler = IS_COMPILE_PARFAIT ? "parfait-clang" : "clang";
def linker = IS_COMPILE_PARFAIT ? "parfait-clang++" : "clang++";
def compiler = IS_COMPILE_PARFAIT ? "parfait-clang" : "clang"
def linker = IS_COMPILE_PARFAIT ? "parfait-clang++" : "clang++"

MAC.glass = [:]
MAC.glass.javahInclude = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class CCTask extends NativeCompileTask {
// debug builds, otherwise that flag is ignored "/Fd" or "-Fd"
project.exec({
commandLine(compiler);

// Add in any additional compilation params
if (params != null) {
// A little hack. Only use the -std=c99 flag if compiling .c or .m
Expand Down