diff mbox series

ref-manual/system-requirements.rst: add ccache in distros

Message ID 20260831095856.2298-1-jose.quaresma@oss.qualcomm.com
State New
Headers show
Series ref-manual/system-requirements.rst: add ccache in distros | expand

Commit Message

Jose Quaresma Aug. 31, 2026, 9:58 a.m. UTC
Looking at the Yocto docs, ccache is missing on Debian/Ubuntu
and OpenSUSE but is in all the others.

The ccache can improve significantly the builds speeds when we can't
take advantage of the bitbake sstate cache, in such scenario we need
o compile the code. The cache storage needs to be available from the
previous builds so we need to store these ccache artifacts temporary
on our permanent storage.

The ccache is required to build "-native" packages in oe-core
because it requires HOSTTOOLS += "ccache".

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
---
 .../tools/host_packages_scripts/opensuse_essential_15.6.sh      | 2 +-
 .../tools/host_packages_scripts/opensuse_essential_16.0.sh      | 2 +-
 documentation/tools/host_packages_scripts/ubuntu_essential.sh   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Antonin Godard Aug. 31, 2026, 10:26 a.m. UTC | #1
Hi,

On Mon Aug 31, 2026 at 11:58 AM CEST, Jose Quaresma via lists.yoctoproject.org wrote:
> Looking at the Yocto docs, ccache is missing on Debian/Ubuntu
> and OpenSUSE but is in all the others.
>
> The ccache can improve significantly the builds speeds when we can't
> take advantage of the bitbake sstate cache, in such scenario we need
> o compile the code. The cache storage needs to be available from the
> previous builds so we need to store these ccache artifacts temporary
> on our permanent storage.
>
> The ccache is required to build "-native" packages in oe-core
> because it requires HOSTTOOLS += "ccache".

Thanks for the patch. Actually, it makes me wonder if we should rather do the
opposite and remove this for all distros, as this doesn't sound like a host
"requirement" to me.

Antonin
Jose Quaresma Aug. 31, 2026, 10:48 a.m. UTC | #2
On Mon, Aug 31, 2026 at 11:26 AM Antonin Godard <antonin.godard@bootlin.com>
wrote:

> Hi,
>
> On Mon Aug 31, 2026 at 11:58 AM CEST, Jose Quaresma via
> lists.yoctoproject.org wrote:
> > Looking at the Yocto docs, ccache is missing on Debian/Ubuntu
> > and OpenSUSE but is in all the others.
> >
> > The ccache can improve significantly the builds speeds when we can't
> > take advantage of the bitbake sstate cache, in such scenario we need
> > o compile the code. The cache storage needs to be available from the
> > previous builds so we need to store these ccache artifacts temporary
> > on our permanent storage.
> >
> > The ccache is required to build "-native" packages in oe-core
> > because it requires HOSTTOOLS += "ccache".
>
> Thanks for the patch. Actually, it makes me wonder if we should rather do
> the
> opposite and remove this for all distros, as this doesn't sound like a host
> "requirement" to me.
>

Yeah, This is opcional and not a requirement as you said.

However, this can greatly improve build time. So it fits in the same
category as the
python-websockets, which are not a requirement because upstream hashequiv
server is not enabled by default, but it also appears listed.

To take full advantage of the ccache.bbclass, you need to have the tool in
the host;
otherwise, you can only use it for the ":target" arch.

Jose



>
> Antonin
>
Antonin Godard Aug. 31, 2026, 12:26 p.m. UTC | #3
On Mon Aug 31, 2026 at 12:48 PM CEST, Jose Quaresma wrote:
> On Mon, Aug 31, 2026 at 11:26 AM Antonin Godard <antonin.godard@bootlin.com>
> wrote:
>
>> Hi,
>>
>> On Mon Aug 31, 2026 at 11:58 AM CEST, Jose Quaresma via
>> lists.yoctoproject.org wrote:
>> > Looking at the Yocto docs, ccache is missing on Debian/Ubuntu
>> > and OpenSUSE but is in all the others.
>> >
>> > The ccache can improve significantly the builds speeds when we can't
>> > take advantage of the bitbake sstate cache, in such scenario we need
>> > o compile the code. The cache storage needs to be available from the
>> > previous builds so we need to store these ccache artifacts temporary
>> > on our permanent storage.
>> >
>> > The ccache is required to build "-native" packages in oe-core
>> > because it requires HOSTTOOLS += "ccache".
>>
>> Thanks for the patch. Actually, it makes me wonder if we should rather do
>> the
>> opposite and remove this for all distros, as this doesn't sound like a host
>> "requirement" to me.
>>
>
> Yeah, This is opcional and not a requirement as you said.
>
> However, this can greatly improve build time. So it fits in the same
> category as the
> python-websockets, which are not a requirement because upstream hashequiv
> server is not enabled by default, but it also appears listed.

websockets became a requirement when we made the "poky-with-sstate"
bitbake-setup configuration proposed as part of the choices when running
"bitbake-setup init". It would have made no sense to suggest a configuration
with a missing package otherwise.

> To take full advantage of the ccache.bbclass, you need to have the tool in
> the host;
> otherwise, you can only use it for the ":target" arch.

I think this should then be stated in the ccache class documentation, in
documentation/ref-manual/classes.rst. The host requirements should be kept
minimal, IMO.

Antonin
Jose Quaresma Aug. 31, 2026, 1:06 p.m. UTC | #4
On Mon, Aug 31, 2026 at 1:26 PM Antonin Godard <antonin.godard@bootlin.com>
wrote:

> On Mon Aug 31, 2026 at 12:48 PM CEST, Jose Quaresma wrote:
> > On Mon, Aug 31, 2026 at 11:26 AM Antonin Godard <
> antonin.godard@bootlin.com>
> > wrote:
> >
> >> Hi,
> >>
> >> On Mon Aug 31, 2026 at 11:58 AM CEST, Jose Quaresma via
> >> lists.yoctoproject.org wrote:
> >> > Looking at the Yocto docs, ccache is missing on Debian/Ubuntu
> >> > and OpenSUSE but is in all the others.
> >> >
> >> > The ccache can improve significantly the builds speeds when we can't
> >> > take advantage of the bitbake sstate cache, in such scenario we need
> >> > o compile the code. The cache storage needs to be available from the
> >> > previous builds so we need to store these ccache artifacts temporary
> >> > on our permanent storage.
> >> >
> >> > The ccache is required to build "-native" packages in oe-core
> >> > because it requires HOSTTOOLS += "ccache".
> >>
> >> Thanks for the patch. Actually, it makes me wonder if we should rather
> do
> >> the
> >> opposite and remove this for all distros, as this doesn't sound like a
> host
> >> "requirement" to me.
> >>
> >
> > Yeah, This is opcional and not a requirement as you said.
> >
> > However, this can greatly improve build time. So it fits in the same
> > category as the
> > python-websockets, which are not a requirement because upstream hashequiv
> > server is not enabled by default, but it also appears listed.
>
> websockets became a requirement when we made the "poky-with-sstate"
> bitbake-setup configuration proposed as part of the choices when running
> "bitbake-setup init". It would have made no sense to suggest a
> configuration
> with a missing package otherwise.
>

I completely agree with what you say.


>
> > To take full advantage of the ccache.bbclass, you need to have the tool
> in
> > the host;
> > otherwise, you can only use it for the ":target" arch.
>
> I think this should then be stated in the ccache class documentation, in
> documentation/ref-manual/classes.rst. The host requirements should be kept
> minimal, IMO.
>

The documentation [1] already mention the requirements for "-native"
targets:

ASSUME_PROVIDED += "ccache-native"
HOSTTOOLS += "ccache"

[1] https://docs.yoctoproject.org/ref-manual/classes.html#ccache

This requirement was added last year
https://github.com/openembedded/openembedded-core/commit/cc91a0f6500e88dd96a56307226fcfd16c60c342

Jose


>
> Antonin
>
diff mbox series

Patch

diff --git a/documentation/tools/host_packages_scripts/opensuse_essential_15.6.sh b/documentation/tools/host_packages_scripts/opensuse_essential_15.6.sh
index 0d37e9bd5..9f839d190 100644
--- a/documentation/tools/host_packages_scripts/opensuse_essential_15.6.sh
+++ b/documentation/tools/host_packages_scripts/opensuse_essential_15.6.sh
@@ -1,2 +1,2 @@ 
-sudo zypper install bzip2 chrpath diffstat gcc gcc-c++ git gzip hostname libacl1 make makeinfo patch python python-curses python-xml python3 python3-Jinja2 python3-curses python3-pexpect python3-pip rpcgen socat tar wget which xz zstd
+sudo zypper install bzip2 ccache chrpath diffstat gcc gcc-c++ git gzip hostname libacl1 make makeinfo patch python python-curses python-xml python3 python3-Jinja2 python3-curses python3-pexpect python3-pip rpcgen socat tar wget which xz zstd
 sudo pip3 install GitPython
diff --git a/documentation/tools/host_packages_scripts/opensuse_essential_16.0.sh b/documentation/tools/host_packages_scripts/opensuse_essential_16.0.sh
index f3ee6ad54..3eae28dd4 100644
--- a/documentation/tools/host_packages_scripts/opensuse_essential_16.0.sh
+++ b/documentation/tools/host_packages_scripts/opensuse_essential_16.0.sh
@@ -1 +1 @@ 
-sudo zypper install bzip2 chrpath diffstat gcc gcc-c++ git gzip hostname libacl1 make makeinfo patch python3 python3-GitPython python3-Jinja2 python3-curses python3-pexpect python3-pip python3-websockets python3-xml rpcgen socat tar wget which xz zstd
+sudo zypper install bzip2 ccache chrpath diffstat gcc gcc-c++ git gzip hostname libacl1 make makeinfo patch python3 python3-GitPython python3-Jinja2 python3-curses python3-pexpect python3-pip python3-websockets python3-xml rpcgen socat tar wget which xz zstd
diff --git a/documentation/tools/host_packages_scripts/ubuntu_essential.sh b/documentation/tools/host_packages_scripts/ubuntu_essential.sh
index 43f071a09..849d669c9 100644
--- a/documentation/tools/host_packages_scripts/ubuntu_essential.sh
+++ b/documentation/tools/host_packages_scripts/ubuntu_essential.sh
@@ -1 +1 @@ 
-sudo apt-get install build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 libcrypt-dev locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd
+sudo apt-get install build-essential ccache chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 libcrypt-dev locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd