osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/34701?usp=email )
Change subject: ttcn3.sh: use ccache ...................................................................... ttcn3.sh: use ccache Use ccache for building Osmocom programs and TTCN-3 testsuites. Change-Id: I800062d0379295a6905851db29e820ff16217653 --- M .gitignore M ttcn3/scripts/docker_configure_make.sh M ttcn3/ttcn3.opts M ttcn3/ttcn3.sh 4 files changed, 20 insertions(+), 2 deletions(-) Approvals: osmith: Looks good to me, approved; Verified diff --git a/.gitignore b/.gitignore index 6aa1dd0..2e88651 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ !net/README !net/fill_config.py ttcn3/3G+2G_ttcn3.deps +ttcn3/ccache/ ttcn3/out/ ttcn3/make/ ttcn3/.run.sh diff --git a/ttcn3/scripts/docker_configure_make.sh b/ttcn3/scripts/docker_configure_make.sh index 25cedb4..56fee71 100755 --- a/ttcn3/scripts/docker_configure_make.sh +++ b/ttcn3/scripts/docker_configure_make.sh @@ -7,12 +7,13 @@ DIR_OSMODEV="$(readlink -f "$(dirname $0)/../..")" DIR_MAKE="$DIR_OSMODEV/ttcn3/make" DIR_USR_LOCAL="$DIR_OSMODEV/ttcn3/usr_local" +DIR_CCACHE="$DIR_OSMODEV/ttcn3/ccache/osmocom-programs" RUN_SCRIPT="$DIR_OSMODEV/ttcn3/.run.sh" DOCKER_IMG="$1" UID="$(id -u)" shift -mkdir -p "$DIR_MAKE" +mkdir -p "$DIR_MAKE" "$DIR_CCACHE" # Script running as user inside docker echo "#!/bin/sh -ex" > "$RUN_SCRIPT" @@ -29,6 +30,7 @@ -v "$DIR_OSMODEV:$DIR_OSMODEV" \ -v "$DIR_USR_LOCAL:/usr/local" \ -v "$RUN_SCRIPT:/tmp/run.sh:ro" \ + -v "$DIR_CCACHE:/home/build/.ccache" \ "$DOCKER_IMG" \ sh -ex -c " if ! id -u $UID 2>/dev/null; then diff --git a/ttcn3/ttcn3.opts b/ttcn3/ttcn3.opts index 8acec2d..bf2f472 100644 --- a/ttcn3/ttcn3.opts +++ b/ttcn3/ttcn3.opts @@ -1 +1,2 @@ osmo-bts --enable-trx +ALL CC="/usr/lib/ccache/gcc" CXX="/usr/lib/ccache/g++" diff --git a/ttcn3/ttcn3.sh b/ttcn3/ttcn3.sh index 68dec64..5c5f711 100755 --- a/ttcn3/ttcn3.sh +++ b/ttcn3/ttcn3.sh @@ -338,16 +338,19 @@ local testsuite_image="$(get_testsuite_image)" echo "testsuite_image: $testsuite_image" + mkdir -p "$"$DIR_OSMODEV/ttcn3/ccache/ttcn3 + # -t: add a tty, so we get color output from the compiler docker run \ --rm \ -t \ -v "$hacks:/osmo-ttcn3-hacks" \ + -v "$DIR_OSMODEV/ttcn3/ccache/ttcn3:/root/.ccache" \ "$testsuite_image" \ sh -exc " cd /osmo-ttcn3-hacks/$(basename "$(get_testsuite_dir)"); ./gen_links.sh; - ./regen_makefile.sh; + USE_CCACHE=1 ./regen_makefile.sh; make compile; make -j"$JOBS" " -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/34701?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I800062d0379295a6905851db29e820ff16217653 Gerrit-Change-Number: 34701 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osm...@sysmocom.de> Gerrit-Reviewer: osmith <osm...@sysmocom.de> Gerrit-MessageType: merged