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

tools/ci/docker/linux/Dockerfile: fix ccache when running container as user #13290

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

userid0x0
Copy link

Normally ccache places the temporary files in ~/.ccache, when invoking the container with
-u <uid>:<gid>
as e.g. Jenkins does, this might result in a invalid/unknown home folder. Thus ccache tries to write to /.ccache which doesn't exist and the user doesn't have any permissions.

Explicitly set CCACHE_DIR to a folder with appropriate permissions.

Summary

Impact

Testing

Before:

# docker run --rm --tty --interactive -u 1000:1000 ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest
cd /tmp
touch test.c
arm-none-eabi-gcc -c test.c
# ccache: error: Failed to create directory //.cache/ccache/tmp: Permission denied

…s user

Normally ccache places the temporary files in `~/.ccache`, when invoking the container with
  `-u <uid>:<gid>`
as e.g. Jenkins does, this might result in a invalid/unknown home folder.
Thus ccache tries to write to `/.ccache` which doesn't exist and the user doesn't have any permissions.

Explicitly set `CCACHE_DIR` to a folder with appropriate permissions.
@xiaoxiang781216 xiaoxiang781216 merged commit 39937c9 into apache:master Sep 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants