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

fix(ccache): enable ccache on bare-metal setups #4566

Merged
merged 6 commits into from
Mar 29, 2024
Merged
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
14 changes: 13 additions & 1 deletion ansible/roles/build_tools/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- name: Add CCACHE_DIR to .bashrc
ansible.builtin.lineinfile:
dest: ~/.bashrc
line: export CCACHE_DIR="/ccache"
line: export CCACHE_DIR="/var/tmp/ccache"
state: present
create: true
mode: 0644
Expand All @@ -28,3 +28,15 @@
state: present
create: true
mode: 0644

- name: Create ccache directory
ansible.builtin.file:
path: /var/tmp/ccache
state: directory
mode: 0755

- name: Source .bashrc
ansible.builtin.shell: source ~/.bashrc
args:
executable: /bin/bash
changed_when: false
5 changes: 4 additions & 1 deletion docker/autoware-openadk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
wget \
cmake \
curl \
gosu \

Check warning on line 16 in docker/autoware-openadk/Dockerfile

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (gosu)
gnupg \
vim \
unzip \
Expand Down Expand Up @@ -45,14 +45,17 @@
ARG ROS_DISTRO
ARG SETUP_ARGS
ARG ROS_DISTRO
ENV CCACHE_DIR="/var/tmp/ccache"
ENV CC="/usr/lib/ccache/gcc"
ENV CXX="/usr/lib/ccache/g++"

# Set up development environment
RUN --mount=type=ssh \
./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadk \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& find / -name 'libcu*.a' -delete \

Check warning on line 57 in docker/autoware-openadk/Dockerfile

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (libcu)
&& find / -name 'libnv*.a' -delete

Check warning on line 58 in docker/autoware-openadk/Dockerfile

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (libnv)

# Copy repository files
COPY autoware.repos /autoware/
Expand All @@ -71,7 +74,7 @@
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
&& find /autoware/install -type d -exec chmod 777 {} \; \
&& chmod -R 777 /ccache \
&& chmod -R 777 /var/tmp/ccache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& rm -rf /autoware/build /autoware/src

Expand Down
Loading