[PATCH 3/2 xserver] travis: Enable ccache.
Eric Anholt
eric at anholt.net
Fri Jun 2 16:08:54 UTC 2017
Aaron Plattner <aplattner at nvidia.com> writes:
> On 06/01/2017 01:59 PM, Eric Anholt wrote:
>> We bind-mount the cache directory into the container. Cuts build time
>> from about 4 minutes to 2.
>>
>> Signed-off-by: Eric Anholt <eric at anholt.net>
>> ---
>> .travis.yml | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index e10cfe1e134f..0a136b23dd80 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -1,4 +1,5 @@
>> language: c
>> +cache: ccache
>> dist: trusty
>> services: docker
>>
>> @@ -6,9 +7,9 @@ before_install:
>> - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull anholt/xserver-travis ; fi
>>
>> before_script:
>> - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM anholt/xserver-travis:v3 > Dockerfile ; fi
>> + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM anholt/xserver-travis:v4 > Dockerfile ; fi
>> - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile ; fi
>> - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit . ; fi
>>
>> script:
>> - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "cd /root && ./test/scripts/travis-test.sh" ; fi
>> + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run --volume $HOME/.ccache:/root/.ccache withgit /bin/sh -c "cd /root && ./test/scripts/travis-test.sh" ; fi
>
> This doesn't apply cleanly because the previous patch names it
> build-travis-deps.sh rather than travis-test.sh. But with that fixed,
> and running the commands manually, this series seems to work.
>
> With ccache, this took a whopping 17s on my medium-speed non-SSD
> workstation.
Yeah, I missed the commit --amend of the previous patch (we're not
building deps any more, so I renamed it).
I hadn't considered using this scripting locally, but it may be an
interesting way to go, once we have xts hooked up in meson.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170602/94dd6b0a/attachment.sig>
More information about the xorg-devel
mailing list