Skip to content

Commit

Permalink
fix: ccache permissions (autowarefoundation#4556)
Browse files Browse the repository at this point in the history
* fix ccache permissions

Signed-off-by: oguzkaganozt <[email protected]>

* Link CC and CXX to ccache

Signed-off-by: oguzkaganozt <[email protected]>

* style(pre-commit): autofix

---------

Signed-off-by: oguzkaganozt <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
oguzkaganozt and pre-commit-ci[bot] authored Mar 22, 2024
1 parent e1a4269 commit 59a4a95
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ jobs:
- name: Show disk space
run: |
df -h
- name: Show ccache stats
run: |
ccache -s
4 changes: 4 additions & 0 deletions .github/workflows/build-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ jobs:
- name: Show disk space
run: |
df -h
- name: Show ccache stats
run: |
ccache -s
24 changes: 24 additions & 0 deletions ansible/roles/build_tools/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,27 @@
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
7 changes: 1 addition & 6 deletions docker/autoware-openadk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -74,6 +71,7 @@ RUN --mount=type=ssh \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
&& find /autoware/install -type d -exec chmod 777 {} \; \
&& chmod -R 777 /ccache \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \
&& rm -rf /autoware/build /autoware/src

Expand All @@ -88,9 +86,6 @@ RUN --mount=type=ssh \
&& pip uninstall -y ansible ansible-core \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache

# Change working directory to workspace
WORKDIR /workspace

# Create entrypoint
COPY docker/autoware-openadk/etc/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
Expand Down

0 comments on commit 59a4a95

Please sign in to comment.