Package: debhelper,meson
Version: 12.5.3,0.51.1-1
Severity: normal
Control: block 933799 by -1
Control: block 934673 by -1

I'm not sure whether this should be considered to be a bug in meson itself,
or in debhelper's meson integration, or what...

Steps to reproduce:
- Have a package that builds using meson, such as libgit2-glib
- Include ccache in your build chroot
- Build with sbuild, or otherwise as a user whose home directory is
  /nonexistent or similar

Expected result:
- Package builds successfully
- ccache is either used with a temporary cache directory, or disabled
  (either seems suitable)

Actual result:
> Compiler stderr:
>  ccache: error: Failed to create directory /sbuild-nonexistent/.ccache/tmp: 
> Permission denied

This has caused FTBFS in at least libgit2-glib (#934673) and geary
(#933799) when meson checks fail.

Possible solutions include:

- debhelper: set HOME=$(pwd)/debian/temp-home or similar, either in a new
  compat level or unconditionally (some packages already do this, usually
  because their build-time tests fail when $HOME is not writeable)
  - If this solution is chosen, it should probably also unset various
    XDG_* environment variables so that the default subdirectory of $HOME
    will be used (see glib2.0's debian/rules)
- debhelper: explicitly set CC=cc, CXX=c++ (or multiarch-tuple-prefixed
  gcc/g++) for Meson native builds, so that meson does not use ccache
  (this is the documented way to turn off automatic use of ccache)
- meson: if `ccache $CC` fails the first time it is attempted, automatically
  use $CC instead
- require all Meson-built packages to set HOME in their d/rules individually
  (I am not keen on this solution and would like to find something better)
- something clever that I haven't thought of

Thanks,
    smcv

Reply via email to