Skip to content

ci/ci: enable ccache - #2936

Merged
Ricardo Salveti (ricardosalveti) merged 6 commits into
qualcomm-linux:masterfrom
quaresmajose:ccache
Sep 12, 2026
Merged

Ricardo Salveti (ricardosalveti) merged 6 commits into
qualcomm-linux:masterfrom
quaresmajose:ccache

Conversation

@quaresmajose

Copy link
Copy Markdown
Member

The ccache can improve significantly our builds speeds when we can't take
advantage of the bitbake sstate cache, in sutch 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 #1051

Comment thread ci/ccache.yml
INHERIT += "ccache"
CCACHE_MAXSIZE = "200G"
CCACHE_TOP_DIR = "${SSTATE_DIR}/ccache"
CCACHE_DISABLE = "1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just enable ccache for all the recipes? What are the drawbacks?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In internal discussions, we concluded that there wasn't much value in enabling it for everyone. However, the heavier packages in the compilation would always have some benefit. In reality, it's a trade-off between space occupied and benefit utilized.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there wasn't much value in enabling it for everyone

Why? What was the main argument for deciding it this way? Just to document it here. Do we have any stats?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have stats and that conclusion came from a internal slack discussion.

Basically, 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.

I'll add it to the commit.

Comment thread ci/ccache.yml Outdated
CCACHE_DISABLE:pn-glibc = "0"
CCACHE_DISABLE:pn-llvm = "0"
CCACHE_DISABLE:pn-linux-yocto = "0"
#CCACHE_DISABLE:pn-linux-yocto = "0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what is in 2026-08-14 09:59:21 - INFO - | ERROR: Details can be found at: /work/build/tmp/work-shared/qcom-armv8a/kernel-source/.kernel-meta/cfg/merge_config_build.log ? Why does it fail?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in the evaluation process and I don't yet know the reasons.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails becuas it also requires the ccache-native for the native tools. After install ccache on the container and add the required configs it works

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a missing dependency somewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The missing dependencie is HOSTTOOLS += "ccache"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes linux-yocto depend on the host's ccache, doesn't it? My point is that the recipe should be buildable even withou it, by using ccache-native.

Comment thread ci/ccache.yml
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

Test run workflow

Test jobs for commit 39cf185

qcom-distro
Pass: 11 | Fail: 1 | Total: 12
qcom-distro_linux-qcom-6.18
Pass: 6 | Fail: 2 | Total: 8
nodistro
Pass: 10 | Fail: 0 | Total: 10

@test-reporting-app

test-reporting-app Bot commented Aug 26, 2026

Copy link
Copy Markdown

Test Results

 30 files   -    51   30 suites   - 396   4h 12m 28s ⏱️ - 4h 3m 49s
 13 tests  -   160    9 ✅  -   143  0 💤  -  5   4 ❌  - 12 
269 runs   - 2 494  257 ✅  - 2 447  0 💤  - 29  12 ❌  - 18 

For more details on these failures, see this check.

Results for commit 39cf185. ± Comparison against base commit faf4f4c.

This pull request removes 160 tests.
0_AudioRecord_Config01 ‑ AudioRecord_Config01
0_BT_FW_KMD_Service ‑ BT_FW_KMD_Service
0_GStreamer_Video_Encode_h264_480p ‑ GStreamer_Video_Encode_h264_480p
0_Libcamera_cam ‑ Libcamera_cam
0_Weston_Runtime_Preflight ‑ Weston_Runtime_Preflight
0_hotplug ‑ hotplug
10_AudioRecord ‑ AudioRecord
10_Docker_Kernel_Config ‑ Docker_Kernel_Config
10_Kubernetes_Kernel_Config ‑ Kubernetes_Kernel_Config
10_Logging_Journalctl_Validation ‑ Logging_Journalctl_Validation
…

♻️ This comment has been updated with latest results.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 28464f9

  • qcomdistro: multimedia image-prop
    Pass: 44 | Fail: 0 | Total: 44
  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9

@quaresmajose

Copy link
Copy Markdown
Member Author

Proposed ccache to be installed on kas-container and it is accepted and available in :next image.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 2ca5572

  • qcomdistro: multimedia image-prop
    Pass: 36 | Fail: 0 | Total: 36
  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9

Comment thread ci/ccache.yml
@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 5989d85

  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9
  • qcomdistro: multimedia image-prop
    Pass: 30 | Fail: 4 | Total: 34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I believe we want to wait for kas 5.6, no?

Store the CCACHE_TOP_DIR inside the state-cache so we can access it
from within the kas-container.

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
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 qualcomm-linux#1051

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
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 <jose.quaresma@oss.qualcomm.com>
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 <jose.quaresma@oss.qualcomm.com>
@quaresmajose

Copy link
Copy Markdown
Member Author

I'm missing numbers in the commit about how much time it saves vs the amount of storage it adds

I don't have the exact numbers, but the more components that share the total space, the less space each one will have. Since less space results in less cache, then the more components, the less efficient it is.

@ricardosalveti

Copy link
Copy Markdown
Contributor

Should we wait for kas 5.6?

@quaresmajose

Copy link
Copy Markdown
Member Author

We don't need to wait. There is a cosmetic update in kas-container and the essential package list in Dockerfile was updated to mach Yocto 6. The rest has no impact on us.

$ git diff --stat 5.5 origin/master 
 .github/actions/docker-init/action.yml   |  2 +-
 .github/actions/perform-tests/action.yml | 24 +++++++++++++-----------
 .github/workflows/next.yml               |  3 +--
 Dockerfile                               | 54 +++++++++++++++++++++++++++++++-----------------------
 docs/format-changelog.rst                |  2 +-
 kas-container                            |  4 ++--
 scripts/build-container.sh               |  4 ++--

@ricardosalveti

Copy link
Copy Markdown
Contributor

Known failures.

@ricardosalveti
Ricardo Salveti (ricardosalveti) merged commit 87cec8c into qualcomm-linux:master Sep 12, 2026
241 of 242 checks passed
@quic-yocto-ci

Copy link
Copy Markdown
Contributor

Backport failed for wrynose, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin wrynose
git worktree add -d .worktree/backport/2936-to-wrynose origin/wrynose
cd .worktree/backport/2936-to-wrynose
git switch --create backport/2936-to-wrynose
git cherry-pick -x 37fa5f8c3976bee2f15ca96a399d03a1dbf470fb 588e03d3976c8c3462613d724680bed3b8009e2d 5451b3dbea78682edc0b1d7c1e747fbb663c899c 35458a258f3015ddb9c5f4a8ee1d9776316fec9e 365630484461b5927ee7bd4d308efce239bcc88a 39cf1856083fe252efdaa789f9c696c032e10897

@ricardosalveti

Copy link
Copy Markdown
Contributor

Jose Quaresma (@quaresmajose) mind having a look at backporting to wrynose?

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 39cf185

  • qcomdistro: multimedia image-prop
    Pass: 41 | Fail: 0 | Total: 41
  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9

@quaresmajose

Copy link
Copy Markdown
Member Author

Jose Quaresma (Jose Quaresma (@quaresmajose)) mind having a look at backporting to wrynose?

Proposed in #3144

Dmitry Baryshkov (lumag) added a commit that referenced this pull request Sep 13, 2026
Description
Backport of #2936 to
wrynose.
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
It avoids reproducibility problems and is recommended by good security
practices.

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
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

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
It avoids reproducibility problems and is recommended by good security
practices.

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
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

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
It avoids reproducibility problems and is recommended by good security
practices.

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
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

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
It avoids reproducibility problems and is recommended by good security
practices.

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to quaresmajose/meta-qcom-distro that referenced this pull request Sep 14, 2026
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

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Jose Quaresma (quaresmajose) added a commit to qualcomm-linux/meta-qcom-distro that referenced this pull request Sep 14, 2026
Partial port of meta-qcom:

github/workflows: extract kas-container from the image
Backport from qualcomm-linux/meta-qcom#2934

ci/ci: enable ccache
Backport from qualcomm-linux/meta-qcom#2936
Ricardo Salveti (ricardosalveti) pushed a commit to qualcomm-linux/meta-qcom-distro that referenced this pull request Sep 15, 2026
It avoids reproducibility problems and is recommended by good security
practices.

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
(cherry picked from commit e6bb390)
Ricardo Salveti (ricardosalveti) pushed a commit to qualcomm-linux/meta-qcom-distro that referenced this pull request Sep 15, 2026
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

Backport from qualcomm-linux/meta-qcom#2936

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
(cherry picked from commit fac2470)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable ccache on CI builds

6 participants