From a3dd5d0359338b73709fe9a52da1956744ccd46a Mon Sep 17 00:00:00 2001 From: oguzkaganozt Date: Wed, 20 Mar 2024 19:06:19 +0300 Subject: [PATCH] Link CC and CXX to ccache Signed-off-by: oguzkaganozt --- .github/workflows/build-main-self-hosted.yaml | 4 +++ .github/workflows/build-main.yaml | 4 +++ ansible/roles/build_tools/tasks/main.yaml | 25 +++++++++++++++++++ docker/autoware-openadk/Dockerfile | 3 --- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-main-self-hosted.yaml b/.github/workflows/build-main-self-hosted.yaml index e4cc44884e3..e76d58eb3d6 100644 --- a/.github/workflows/build-main-self-hosted.yaml +++ b/.github/workflows/build-main-self-hosted.yaml @@ -67,3 +67,7 @@ jobs: - name: Show disk space run: | df -h + + - name: Show ccache stats + run: | + ccache -s diff --git a/.github/workflows/build-main.yaml b/.github/workflows/build-main.yaml index 7b21980574a..03a123a9469 100644 --- a/.github/workflows/build-main.yaml +++ b/.github/workflows/build-main.yaml @@ -62,3 +62,7 @@ jobs: - name: Show disk space run: | df -h + + - name: Show ccache stats + run: | + ccache -s diff --git a/ansible/roles/build_tools/tasks/main.yaml b/ansible/roles/build_tools/tasks/main.yaml index e83056a6428..2d1b728d367 100644 --- a/ansible/roles/build_tools/tasks/main.yaml +++ b/ansible/roles/build_tools/tasks/main.yaml @@ -4,3 +4,28 @@ name: ccache state: latest update_cache: true + +- name: Add CCACHE_DIR to .bashrc + ansible.builtin.lineinfile: + dest: ~/.bashrc + line: export CCACHE_DIR="/ccache" + state: present + create: true + mode: 0644 + +- name: Export CC to ccache + ansible.builtin.lineinfile: + dest: ~/.bashrc + line: export CC="/usr/lib/ccache/gcc" + state: present + create: true + mode: 0644 + +- name: Export CXX to ccache + ansible.builtin.lineinfile: + dest: ~/.bashrc + line: export CXX="/usr/lib/ccache/g++" + state: present + create: true + mode: 0644 + diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 561862f1e3e..7b8919b20b9 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -45,9 +45,6 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ARG SETUP_ARGS ARG ROS_DISTRO -ENV CCACHE_DIR=/ccache -ENV CC="/usr/lib/ccache/gcc" -ENV CXX="/usr/lib/ccache/g++" # Set up development environment RUN --mount=type=ssh \