From 37fa5f8c3976bee2f15ca96a399d03a1dbf470fb Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Tue, 1 Sep 2026 10:57:46 +0100 Subject: [PATCH 1/6] github/workflows: pin KAS_CONTAINER_IMAGE to v5.5 It avoids reproducibility problems and is recommended by good security practices. Signed-off-by: Jose Quaresma --- .github/workflows/build-yocto.yml | 2 +- .github/workflows/compile.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-yocto.yml b/.github/workflows/build-yocto.yml index 67def1217..3b1c86434 100644 --- a/.github/workflows/build-yocto.yml +++ b/.github/workflows/build-yocto.yml @@ -29,7 +29,7 @@ env: CACHE_DIR: /efsx/qli/meta-qcom KAS_CLONE_DEPTH: 1 KAS_CONTAINER: ${{ github.workspace }}/kas-container - KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas:5.5 + KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas@sha256:4b210b0be3c887875973c4f4c35470b4ecf3edd2346c9de1bdd33feae5b86e94 # 5.5 jobs: kas-setup: diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 55e9ebe8d..bdf756e43 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -46,7 +46,7 @@ on: env: KAS_CLONE_DEPTH: 1 KAS_CONTAINER: ${{ github.workspace }}/kas-container - KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas:5.5 + KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas@sha256:4b210b0be3c887875973c4f4c35470b4ecf3edd2346c9de1bdd33feae5b86e94 # 5.5 jobs: reusable_compile_job: From 588e03d3976c8c3462613d724680bed3b8009e2d Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Fri, 28 Aug 2026 21:36:19 +0100 Subject: [PATCH 2/6] github/workflows: bump KAS_CONTAINER_IMAGE to 5.5-9 for ccache Proposed ccache to be installed on kas-container and it is accepted and available in the image. The change landed in master 5.5-9-g0555188 Signed-off-by: Jose Quaresma --- .github/workflows/build-yocto.yml | 2 +- .github/workflows/compile.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-yocto.yml b/.github/workflows/build-yocto.yml index 3b1c86434..d3e02b53e 100644 --- a/.github/workflows/build-yocto.yml +++ b/.github/workflows/build-yocto.yml @@ -29,7 +29,7 @@ env: CACHE_DIR: /efsx/qli/meta-qcom KAS_CLONE_DEPTH: 1 KAS_CONTAINER: ${{ github.workspace }}/kas-container - KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas@sha256:4b210b0be3c887875973c4f4c35470b4ecf3edd2346c9de1bdd33feae5b86e94 # 5.5 + KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas@sha256:3f3d3257e8d4ca3adfcb2e0025e6da24339fb8d68a6999ca36c37381351582d5 # 5.5-9-g0555188 jobs: kas-setup: diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index bdf756e43..95b5704fd 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -46,7 +46,7 @@ on: env: KAS_CLONE_DEPTH: 1 KAS_CONTAINER: ${{ github.workspace }}/kas-container - KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas@sha256:4b210b0be3c887875973c4f4c35470b4ecf3edd2346c9de1bdd33feae5b86e94 # 5.5 + KAS_CONTAINER_IMAGE: ghcr.io/siemens/kas/kas@sha256:3f3d3257e8d4ca3adfcb2e0025e6da24339fb8d68a6999ca36c37381351582d5 # 5.5-9-g0555188 jobs: reusable_compile_job: From 5451b3dbea78682edc0b1d7c1e747fbb663c899c Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Thu, 13 Aug 2026 19:17:39 +0100 Subject: [PATCH 3/6] ci: add KAS configuration for ccache Store the CCACHE_TOP_DIR inside the state-cache so we can access it from within the kas-container. Signed-off-by: Jose Quaresma --- ci/ccache.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ci/ccache.yml diff --git a/ci/ccache.yml b/ci/ccache.yml new file mode 100644 index 000000000..a079650c9 --- /dev/null +++ b/ci/ccache.yml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json + +header: + version: 14 + +local_conf_header: + ccache: | + INHERIT += "ccache" + CCACHE_MAXSIZE = "200G" + CCACHE_TOP_DIR = "${SSTATE_DIR}/ccache" + # required to build '-native' target + HOSTTOOLS += "ccache" + ASSUME_PROVIDED += "ccache-native" From 35458a258f3015ddb9c5f4a8ee1d9776316fec9e Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Thu, 13 Aug 2026 19:18:07 +0100 Subject: [PATCH 4/6] ci/ci: enable ccache The ccache can improve significantly our builds speeds when we can't take advantage of the bitbake sstate cache, in such scenario we need to compile the code. The cache storage needs to be available from the previous builds so we need to store these ccache artifacts temporay on our permanent storage. Fixes https://github.com/qualcomm-linux/meta-qcom/issues/1051 Signed-off-by: Jose Quaresma --- ci/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/ci.yml b/ci/ci.yml index 0da5377e1..79b5a1a55 100644 --- a/ci/ci.yml +++ b/ci/ci.yml @@ -4,6 +4,7 @@ header: version: 14 includes: - ci/mirror.yml + - ci/ccache.yml local_conf_header: ci: | From 365630484461b5927ee7bd4d308efce239bcc88a Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Fri, 14 Aug 2026 10:19:44 +0100 Subject: [PATCH 5/6] ci/ccache: add table with enabled recipes We'll have to divide the available space among all existing components. Focusing a large portion of the allocated space on components that are fast enough even without ccache. We then conclude that it would be more efficient if we allocated space only to the components that take the most advantage of using ccache. Let's start with a short list of the heavier recipes; we'll adjust them as needed. A quick analysis of the buildstats of shows that the compilation time is high for this list of recipes. Signed-off-by: Jose Quaresma --- ci/ccache.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ci/ccache.yml b/ci/ccache.yml index a079650c9..fb5b732e6 100644 --- a/ci/ccache.yml +++ b/ci/ccache.yml @@ -11,3 +11,21 @@ local_conf_header: # required to build '-native' target HOSTTOOLS += "ccache" ASSUME_PROVIDED += "ccache-native" + + ccache-recipe-contol: | + # disable all recipes + CCACHE_DISABLE = "1" + # table with enabled recipes + CCACHE_DISABLE:pn-clang = "0" + CCACHE_DISABLE:pn-clang-native = "0" + CCACHE_DISABLE:pn-gcc = "0" + CCACHE_DISABLE:pn-gcc-cross-aarch64 = "0" + CCACHE_DISABLE:pn-gcc-cross-arm = "0" + CCACHE_DISABLE:pn-glibc = "0" + CCACHE_DISABLE:pn-llvm = "0" + CCACHE_DISABLE:pn-llvm-native = "0" + CCACHE_DISABLE:pn-linux-qcom = "0" + CCACHE_DISABLE:pn-linux-qcom-next = "0" + CCACHE_DISABLE:pn-linux-yocto = "0" + CCACHE_DISABLE:pn-rust = "0" + CCACHE_DISABLE:pn-rust-native = "0" From 39cf1856083fe252efdaa789f9c696c032e10897 Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Wed, 2 Sep 2026 10:33:26 +0100 Subject: [PATCH 6/6] github/workflows/sstate-cleanup: exclude ccache The ccache it's saved within sstate-cache because it needs to be in a persistent storage location in order to be reused. Its management is private and therefore it should be excluded from the sstate-cache cleanup policy. Signed-off-by: Jose Quaresma --- .github/workflows/sstate-cleanup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sstate-cleanup.yml b/.github/workflows/sstate-cleanup.yml index 9934c43db..27e45f635 100644 --- a/.github/workflows/sstate-cleanup.yml +++ b/.github/workflows/sstate-cleanup.yml @@ -20,5 +20,5 @@ jobs: run: | # bitbake refreshes the mtime of every sstate file a build uses, so # a file older than 15 days was not used by any build in 15 days - find "${CACHE_DIR}/sstate-cache" -type f -mtime +15 -delete - find "${CACHE_DIR}/sstate-cache" -mindepth 1 -type d -empty -delete + find "${CACHE_DIR}/sstate-cache" -not -path "*/ccache/*" -type f -mtime +15 -delete + find "${CACHE_DIR}/sstate-cache" -not -path "*/ccache/*" -mindepth 1 -type d -empty -delete