meson: `meson install` tries to run target's `fc-cache` when cross compiling
Hi,
The new meson setup is great and makes cross compiling much easier than with the autotools build system!
However meson install
fails because it tries to execute the just built fc-cache
, which is built for the target platform not the build host.
I'm building with master as of today, and meson 0.55.3.
Here's the reproduction steps:
[jbit@hina]/src/fontconfig$ git rev-parse HEAD
abc723366d692df2210346e0d4d3c5686e22c3ef
[jbit@hina]/src/fontconfig$ meson --version
0.55.3
[jbit@hina]/src/fontconfig$ mkdir build/ && cd build/
[jbit@hina]/src/fontconfig/build$ cat << EOF > cross.conf
[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'cortex-a53'
endian = 'little'
[properties]
sys_root = '/sysroot/aarch64'
pkg_config_libdir = '/sysroot/aarch64/usr/lib/pkgconfig'
[binaries]
c = 'aarch64-linux-musl-gcc'
cpp = 'aarch64-linux-musl-g++'
ar = 'aarch64-linux-musl-ar'
ld = 'aarch64-linux-musl-ld'
objcopy = 'aarch64-linux-musl-objcopy'
strip = 'aarch64-linux-musl-strip'
pkgconfig = 'pkg-config'
EOF
[jbit@hina]/src/fontconfig/build$ meson ./ ../ --cross-file=cross.conf -Ddoc=disabled -Dtests=disabled
[... Meson output, succeeds ...]
[jbit@hina]/src/fontconfig/build$ meson compile
[... Meson output, succeeds ...]
[jbit@hina]/src/fontconfig/build$ DESTDIR=$PWD/out meson install
[... snipped ...]
Running custom install script '/usr/bin/python3 /src/fontconfig/fc-cache/../install-cache.py /src/fontconfig/build/fc-cache/fc-cache'
Traceback (most recent call last):
File "/src/fontconfig/fc-cache/../install-cache.py", line 11, in <module>
sys.exit(subprocess.run([args.fccache, '-s', '-f', '-v']).returncode)
File "/usr/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/src/fontconfig/build/fc-cache/fc-cache'
FAILED: install script '/usr/bin/python3 /src/fontconfig/fc-cache/../install-cache.py /src/fontconfig/build/fc-cache/fc-cache' exit code 1, stopped
I have a fix for this, and will open a Merge Request, I just wanted to make sure it's in the issue tracker too.
Cheers
jbit
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information