Sccache : integration problems in OpenSuse for distributed compilation

Hello OpenSuse community !

New to OpenSuse, I’m not new to Linux having worked as Linux admin. This is subject is linked to this issue on sccache GitHub repository.

To sum it up: AppArmor and systemd hardening block the “distributed compilation” mode of sccache. You will see in the published issue that I shared solution in my second post in the GitHub issue : a dedicated BubbleWrap (a.k.a. bwrap) AppArmor and a modified sccache-dist-sccache.service . I can help somebody else :slight_smile:

Sccache runs well as simple ccache-like software, the problems appear only with builder and scheduler services configured and running.

Minimum config to reproduce the problem:
On the same computer, configure a builder, scheduler and client following the issue’s first post informations. You can follow this page to help for the configuration. Or you can ask me.

My last problem is

/usr/lib64/gcc/x86_64-suse-linux/13/cc1plus: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
sccache: Compiler killed by signal 1

There, I’m a bit stuck. I hope someone in the comminity would have an idea ?

Welcome to the forum!

The error appears to be obvious (to me, anyway). The libz library can’t be found. Simply install it and try again. :+1:

Thank you for your welcome :slight_smile:

Without libz, nothing much would work on linux, like zypper. It’s already installed, even the libz1-x86-64-v3 package.
To be sure:

➜  Téléchargements ls /usr/lib64/ | grep libz.so
libz.so
libz.so.1
libz.so.1.3

@cyrilj run ldd against /usr/lib64/gcc/x86_64-suse-linux/13/cc1plus it’s not the libz in the standard location :wink: libz1-x86-64-v3

Logs in issues you linked mention something like /newroot which suggests chroot or equivalent. Are you sure this library is also present in chroot that is set up?

Thank you for your help. Sccache uses bwrap (BubbleWrap) which is a container technology. I am walking blind in this, but yes we are dealing with a chroot-like situation.

@malcolmlewis Here is the result:
➜ Téléchargements ldd /usr/lib64/gcc/x86_64-suse-linux/13/cc1plus
linux-vdso.so.1 (0x00007fffbefdd000)
libisl.so.23 => /lib64/libisl.so.23 (0x00007fb06ace1000)
libmpc.so.3 => /lib64/libmpc.so.3 (0x00007fb06acbf000)
libmpfr.so.6 => /lib64/libmpfr.so.6 (0x00007fb06ac07000)
libgmp.so.10 => /lib64/libgmp.so.10 (0x00007fb06ab5e000)
libz.so.1 => /lib64/glibc-hwcaps/x86-64-v3/libz.so.1.3 (0x00007fb06ab44000)
libzstd.so.1 => /lib64/glibc-hwcaps/x86-64-v3/libzstd.so.1.5.5 (0x00007fb06aa97000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb06a800000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb06aeff000)
libm.so.6 => /lib64/libm.so.6 (0x00007fb06a719000)

➜ x86-64-v3 ls /lib64/glibc-hwcaps/x86-64-v3/ | grep libz.so
libz.so.1
libz.so.1.3

@cyrilj as asked by @arvidjaar was that ldd command run inside the chroot?

I don’t know how sccache is using bwrap, I’m sorry. I’ll delve more on this tomorrow. Thanks for your time !