Host/ccache not found

I'm compiling in a Docker container, using the v23.05.5 git tag version

CONFIG_CCACHE=y
CONFIG_CCACHE_DIR="/ccache"

are set in my config
However, ccache seems to not be found once the build of liblzo kicks off

#20 741.5 [1/137] /src/openwrt/staging_dir/host/bin/ccache /src/openwrt/staging_dir/host/bin/gcc -DHAVE_ACCESS=1 -DHAVE_ASSERT_H=1 -DHAVE_ATEXIT=1 -DHAVE_ATOI=1 -DHAVE_ATOL=1 -DHAVE_CHMOD=1 -DHAVE_CHOWN=1 -DHAVE_CLOCK_GETCPUCLOCKID=1 -DHAVE_CLOCK_GETRES=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_CTIME=1 -DHAVE_CTYPE_H=1 -DHAVE_DIFFTIME=1 -DHAVE_DIRENT_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_FLOAT_H=1 -DHAVE_FSTAT=1 -DHAVE_GETENV=1 -DHAVE_GETPAGESIZE=1 -DHAVE_GETRUSAGE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_GMTIME=1 -DHAVE_ISATTY=1 -DHAVE_LIMITS_H=1 -DHAVE_LOCALTIME=1 -DHAVE_LONGJMP=1 -DHAVE_LSTAT=1 -DHAVE_MALLOC_H=1 -DHAVE_MEMCMP=1 -DHAVE_MEMCPY=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMORY_H=1 -DHAVE_MEMSET=1 -DHAVE_MKDIR=1 -DHAVE_MKTIME=1 -DHAVE_MMAP=1 -DHAVE_MPROTECT=1 -DHAVE_MUNMAP=1 -DHAVE_QSORT=1 -DHAVE_RAISE=1 -DHAVE_RMDIR=1 -DHAVE_SETJMP=1 -DHAVE_SETJMP_H=1 -DHAVE_SIGNAL=1 -DHAVE_SIGNAL_H=1 -DHAVE_SNPRINTF=1 -DHAVE_STDARG_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRCASECMP=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRFTIME=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRRCHR=1 -DHAVE_STRSTR=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_TIME=1 -DHAVE_TIME_H=1 -DHAVE_UMASK=1 -DHAVE_UNISTD_H=1 -DHAVE_UTIME=1 -DHAVE_UTIME_H=1 -DHAVE_VSNPRINTF=1 -DLZO_ABI_LITTLE_ENDIAN=1 -DLZO_CFG_NO_CONFIG_HEADER=1 -DSIZEOF_DEV_T=8 -DSIZEOF_DOUBLE=8 -DSIZEOF_FLOAT=4 -DSIZEOF_INT=4 -DSIZEOF_INTMAX_T=8 -DSIZEOF_INTPTR_T=8 -DSIZEOF_LONG=8 -DSIZEOF_LONG_DOUBLE=16 -DSIZEOF_LONG_LONG=8 -DSIZEOF_MODE_T=4 -DSIZEOF_OFF_T=8 -DSIZEOF_PTRDIFF_T=8 -DSIZEOF_SHORT=2 -DSIZEOF_SIZE_T=8 -DSIZEOF_SSIZE_T=8 -DSIZEOF_TIME_T=8 -DSIZEOF_UINTMAX_T=8 -DSIZEOF_UINTPTR_T=8 -DSIZEOF_VOID_P=8 -I/src/openwrt/build_dir/host/lzo-2.10/include -I/src/openwrt/build_dir/host/lzo-2.10 -O2 -I/src/openwrt/staging_dir/host/include -DNDEBUG -Wall -W -Wcast-qual -MD -MT CMakeFiles/lzo_static_lib.dir/src/lzo1.c.o -MF CMakeFiles/lzo_static_lib.dir/src/lzo1.c.o.d -o CMakeFiles/lzo_static_lib.dir/src/lzo1.c.o -c /src/openwrt/build_dir/host/lzo-2.10/src/lzo1.c
#20 741.5 FAILED: CMakeFiles/lzo_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E_STRING_H=1 -DHAVE_STRNCASECMP=1 -DHAVE_STRRCHR=1 -DHAVE_STRSTR=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_TIME=1 -DHAVE_TIME_H=1 -DHAVE_UMASK=1 -DHAVE_UNISTD_H=1 -DHAVE_UTIME=1 -DHAVE_UTIME_H=1 -DHAVE_VSNPRINTF=1 -DLZO_ABI_LITTLE_ENDIAN=1 -DLZO_CFG_NO_CONFIG_HEADER=1 -DSIZEOF_DEV_T=8 -DSIZEOF_DOUBLE=8 -DSIZEOF_FLOAT=4 -DSIZEOF_INT=4 -DSIZEOF_INTMAX_T=8 -DSIZEOF_INTPTR_T=8 -DSIZEOF_LONG=8 -DSIZEOF_LONG_DOUBLE=16 -DSIZEOF_LONG_LONG=8 -DSIZEOF_MODE_T=4 -DSIZEOF_OFF_T=8 -DSIZEOF_PTRDIFF_T=8 -DSIZEOF_SHORT=2 -DSIZEOF_SIZE_T=8 -DSIZEOF_SSIZE_T=8 -DSIZEOF_TIME_T=8 -DSIZEOF_UINTMAX_T=8 -DSIZEOF_UINTPTR_T=8 -DSIZEOF_VOID_P=8 -I/src/openwrt/build_dir/host/lzo-2.10/include -I/src/openwrt/build_dir/host/lzo-2.10 -O2 -I/src/openwrt/staging_dir/host/include -DNDEBUG -Wall -W -Wcast-qual -MD -MT CMakeFiles/lzo_static_lib.dir/src/lzo1.c.o -MF CMakeFiles/lzo_static_lib.dir/src/lzo1.c.o.d -o CMakeFiles/lzo_static_lib.dir/src/lzo1.c.o -c /src/openwrt/build_dir/host/lzo-2.10/src/lzo1.c
#20 741.5 /bin/sh: 1: /src/openwrt/staging_dir/host/bin/ccache: not found
#20 741.5 ninja: build stopped: subcommand failed.

Same issue building with a7abc7ec3b61be553f33c49e5acc90a4d539d992 at the time of this post.

What build command you used? On what linux distribution inside the container.

1 Like

What build command you used?

make -j32 or make tools/liblzo/compile - same with -j1 by the way

On what linux distribution inside the container

Debian testing (debian:testing-slim)

Try debian stable, should be some error earlier.

1 Like

That's really strange - it does work on Debian stable.
That's still a bug though, right?

In this case you are testing debian, it is in the name.

No, I'm not sure. Building ccache alone in that environment works fine.

Obviously examine your whole output to see why/how ccache was not build beforehand.

I can reproduce this on Debian stable, but I don't think I'll be debugging further as I already lost a lot of time to this.

  • make defconfig
  • set CONFIG_CCACHE=y
  • make tools/liblzo/compile
    ccache does not seem to be built so the compile fails.

If you explicitly call tools/ccache/compile beforehand it works.