From c2d2c68da3354d2631338361a58fee4a5be54cf7 Mon Sep 17 00:00:00 2001 From: Daniel Jacob Chittoor Date: Fri, 24 May 2024 14:03:17 +0530 Subject: [PATCH 1/2] Dockerfile: Seperate out CCACHE_DIR for BRANCH_NAME --- Dockerfile | 6 +++--- src/build.sh | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 37386ba..e876025 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ MAINTAINER Romain Hunault ####################### ENV SRC_DIR /srv/src -ENV CCACHE_DIR /srv/ccache +ENV CCACHE_BASE_DIR /srv/ccache ENV ZIP_DIR /srv/zips ENV LMANIFEST_DIR /srv/local_manifests ENV KEYS_DIR /srv/keys @@ -158,7 +158,7 @@ ENV REPO_CUSTOM_MANIFEST false # Create Volume entry points ############################ VOLUME $SRC_DIR -VOLUME $CCACHE_DIR +VOLUME $CCACHE_BASE_DIR VOLUME $ZIP_DIR VOLUME $LMANIFEST_DIR VOLUME $KEYS_DIR @@ -173,7 +173,7 @@ COPY src/ /root/ # Create missing directories ############################ RUN mkdir -p $SRC_DIR -RUN mkdir -p $CCACHE_DIR +RUN mkdir -p $CCACHE_BASE_DIR RUN mkdir -p $ZIP_DIR RUN mkdir -p $LMANIFEST_DIR RUN mkdir -p $KEYS_DIR diff --git a/src/build.sh b/src/build.sh index b8ce8b5..c12979a 100755 --- a/src/build.sh +++ b/src/build.sh @@ -132,6 +132,11 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then mkdir -p "$SRC_DIR/$branch_dir" cd "$SRC_DIR/$branch_dir" || return 1 + mkdir -p "$CCACHE_BASE_DIR/$branch_dir" + export CCACHE_DIR="$CCACHE_BASE_DIR/$branch_dir" + + echo ">> [$(date)] Setting up CCache, CCACHE_DIR=${CCACHE_DIR} CCACHE_SIZE=${CCACHE_SIZE}" + echo ">> [$(date)] Branch: ${BRANCH_NAME}" echo ">> [$(date)] Device: ${DEVICE}" -- GitLab From 317910812b6301b9d40a4345d506a449694f8d1d Mon Sep 17 00:00:00 2001 From: Daniel Jacob Chittoor Date: Fri, 24 May 2024 14:18:50 +0530 Subject: [PATCH 2/2] Dockerfile: Bump CCACHE_SIZE to 100G --- Dockerfile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e876025..0676d4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ ENV USE_CCACHE 1 # ccache maximum size. It should be a number followed by an optional suffix: k, # M, G, T (decimal), Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0 # for no limit. -ENV CCACHE_SIZE 50G +ENV CCACHE_SIZE 100G # We need to specify the ccache binary since it is no longer packaged along with AOSP ENV CCACHE_EXEC /usr/bin/ccache diff --git a/README.md b/README.md index 677fda4..572c44f 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ your builds with your own keys (**highly recommended**): Other useful settings are: - * `CCACHE_SIZE (50G)`: change this if you want to give more (or less) space to + * `CCACHE_SIZE (100G)`: change this if you want to give more (or less) space to ccache * `WITH_SU (false)`: set to `true` to embed `su` in the build (note that, even when set to `false`, you can still enable root by flashing the -- GitLab