Meson crossbuild

Hi, I am developing Conan recipe for Aravis library but I got into serious problems with cross-build. I’ve never worked with meson before so I am not sure if it is problem with Aravis meson script or directly in the meson??? For some reason meson tries to run sanity checks on cross-compiler by trying to run its product which obviously fails. In some cases it passes (when called from the command line), cause sanity checks are run on system compiler instead of cross-compiler (why he does it is beyond me) and the actual cross-compilation itself works. My question is whether is it possible the problem is in the build script or directly in the Meson? And if you can do something about the meson sanity checks/cross-build in the Aravis build script?

there is a meson log when actual build succeds, you can see that it builds sanity check using system gcc:

'''Build started at 2019-12-14T18:32:43.817560
Main binary: /usr/bin/python3
Build Options: -Dprefix=/home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/package/08f0f6b54224d0f59c7a23bfbaa25f463db315ae -Dlibdir=lib -Dbindir=bin -Dsbindir=bin -Dlibexecdir=bin -Dincludedir=include -Dcpp_std=none -Ddefault_library=static -Db_staticpic=true -Dviewer=false -Dgst-plugin=false -Dpacket-socket=false -Dusb=false -Ddocumentation=false -Dintrospection=false -Dbackend=ninja -Dbuildtype=release '--cross-file crossFiles/aarch64-linux-gnu.txt'
Python system: Linux
The Meson build system
Version: 0.52.1
Source dir: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/aravis
Build dir: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build
Build type: cross build
Project name: aravis
Project version: 0.7.3
No CFLAGS in the environment, not changing global flags.
No LDFLAGS in the environment, not changing global flags.
No CPPFLAGS in the environment, not changing global flags.
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.c -o /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.exe
C compiler for the build machine: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
C linker for the build machine: GNU ld.bfd 2.30
No CXXFLAGS in the environment, not changing global flags.
No LDFLAGS in the environment, not changing global flags.
No CPPFLAGS in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
Sanity check compiler command line: c++ /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckcpp.cc -o /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckcpp.exe
C++ compiler for the build machine: c++ (gcc 7.4.0 "c++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
C++ linker for the build machine: GNU ld.bfd 2.30
Sanity testing C compiler: /usr/bin/aarch64-linux-gnu-gcc
Is cross compiler: True.
Sanity check compiler command line: /usr/bin/aarch64-linux-gnu-gcc /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.c -o /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc_cross.exe -pipe -D_FILE_OFFSET_BITS=64 -c
Sanity check compile stdout:

-----
Sanity check compile stderr:'''

There is one when it fails:

Build started at 2019-12-14T19:09:13.975030
Main binary: /usr/bin/python3
Build Options: -Dprefix=/home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/package/08f0f6b54224d0f59c7a23bfbaa25f463db315ae -Dlibdir=lib -Dbindir=bin -Dsbindir=bin -Dlibexecdir=bin -Dincludedir=include -Dcpp_std=none -Ddefault_library=static -Db_staticpic=true -Dviewer=false -Dgst-plugin=false -Dpacket-socket=false -Dusb=false -Ddocumentation=false -Dintrospection=false -Dbackend=ninja -Dbuildtype=release '--cross-file crossFiles/aarch64-linux-gnu.txt'
Python system: Linux
The Meson build system
Version: 0.52.1
Source dir: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/aravis
Build dir: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build
Build type: cross build
Project name: aravis
Project version: 0.7.3
Appending CFLAGS from environment: '-O3 -s -fPIC'
No LDFLAGS in the environment, not changing global flags.
Appending CPPFLAGS from environment: '-DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1'
Sanity testing C compiler: aarch64-linux-gnu-gcc
Is cross compiler: False.
Sanity check compiler command line: aarch64-linux-gnu-gcc /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.c -o /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.exe -O3 -s -fPIC -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=1 -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.exe

meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build/meson-private/sanitycheckc.exe'.

and this is actuall command used in both cases:

meson "/home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/aravis" "/home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/build/08f0f6b54224d0f59c7a23bfbaa25f463db315ae/build" --backend=ninja -Dprefix="/home/robo/.conan/data/Aravis/0.7.3_0/roboauto/stable/package/08f0f6b54224d0f59c7a23bfbaa25f463db315ae" -Dlibdir="lib" -Dbindir="bin" -Dsbindir="bin" -Dlibexecdir="bin" -Dincludedir="include" -Dcpp_std="none" -Ddefault_library="static" -Db_staticpic="true" '-Dviewer=false' '-Dgst-plugin=false' '-Dpacket-socket=false' '-Dusb=false' '-Ddocumentation=false' '-Dintrospection=false' '--cross-file=crossFiles/aarch64-linux-gnu.txt' --buildtype=release

Last thing is that when I compile version 7.4 the library name is v0.8 which is there any reason for that?