Open abergmeier opened 3 years ago
It is strange to me that the compiler itself is in a list.
I'm having this same issue trying to cross-compile for arm64 on:
Here's the trace:
$ meson build --cross cross_file_android_arm64_28.txt
The Meson build system
Version: 0.58.0
Source dir: /workspaces/pntos-for-android
Build dir: /workspaces/pntos-for-android/build
Build type: cross build
Project name: pntos-for-android
Project version: 0.0.1-dev
meson.build:1:0: ERROR: Unknown compiler(s): [['/workspaces/pntos-for-android/android-toolchain-arm64-28/bin/aarch64-linux-android-clang']]
A full log can be found at /workspaces/pntos-for-android/build/meson-logs/meson-log.txt
Traceback (most recent call last):
File "/usr/local/bin/meson", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/mesonmain.py", line 231, in main
return run(sys.argv[1:], launcher)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/mesonmain.py", line 222, in run
return CommandLineParser().run(args)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/mesonmain.py", line 134, in run
return options.run_func(options)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/msetup.py", line 281, in run
app.generate()
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/msetup.py", line 184, in generate
self._generate(env)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/msetup.py", line 201, in _generate
intr = interpreter.Interpreter(b)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreter/interpreter.py", line 258, in __init__
self.parse_project()
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 640, in parse_project
self.evaluate_codeblock(self.ast, end=1)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 680, in evaluate_codeblock
raise e
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 673, in evaluate_codeblock
self.evaluate_statement(cur)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 686, in evaluate_statement
return self.function_call(cur)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 1065, in function_call
return func(node, func_args, kwargs)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 212, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreterbase.py", line 243, in wrapped
return f(*wrapped_args, **wrapped_kwargs)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreter/interpreter.py", line 1054, in func_project
self.add_languages(proj_langs, True, MachineChoice.HOST)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreter/interpreter.py", line 1167, in add_languages
success = self.add_languages_for(args, required, for_machine)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/interpreter/interpreter.py", line 1199, in add_languages_for
comp = self.environment.detect_compiler_for(lang, for_machine)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/environment.py", line 2031, in detect_compiler_for
comp = self.compiler_from_language(lang, for_machine)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/environment.py", line 2003, in compiler_from_language
comp = self.detect_c_compiler(for_machine)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/environment.py", line 1491, in detect_c_compiler
return self._detect_c_or_cpp_compiler('c', for_machine)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/environment.py", line 1488, in _detect_c_or_cpp_compiler
self._handle_exceptions(popen_exceptions, compilers)
File "/usr/local/lib/python3.8/dist-packages/mesonbuild/environment.py", line 1046, in _handle_exceptions
raise EnvironmentException(errmsg)
mesonbuild.mesonlib.universal.EnvironmentException: Unknown compiler(s): [['/workspaces/pntos-for-android/android-toolchain-arm64-28/bin/aarch64-linux-android-clang']]
Here's cross_file_android_arm64_28.txt:
[host_machine]
system = 'android'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
[built-in options]
c_args = ['-I/workspaces/android-arm64-28/include']
c_link_args = ['-L/workspaces/android-arm64-28/lib64',
'-fuse-ld=gold']
[properties]
growing_stack = true
[binaries]
c = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-clang'
cpp = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-clang++'
ar = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-ar'
as = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-as'
ld = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-ld'
ranlib = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-ranlib'
strip = '/workspaces/android-toolchain-arm64-28/bin/aarch64-linux-android-strip'
pkgconfig = '/workspaces/android-arm64-28/bin/pkg-config'
I solved by installing libncurses5:
sudo apt install libncurses5
Should simply use the scripts provided by Android NDK. Or rather if it encounters an error it should spill as much internal information as possible. The current behavior is not optimal for providing proper bug reporting.
Spilling internal details doesn't necessarily mean making it hard to read the scrollback in your terminal. This is why meson prints:
A full log can be found at /user/build-android-aarch64/meson-logs/meson-log.txt
Forcing a backtrace isn't very helpful in this case. It lets you see the call stack of the meson codebase w.r.t. where the error was raised, which is definitely helpful in certain scenarios, but the build log containing the debug info should be the first thing you check.
Describe the bug When trying to use Android NDK, I only get the error message "Unknown compiler"
Setting
MESON_FORCE_BACKTRACE=1
it gives me:To Reproduce Uses latest mesa source and latest Android NDK.
Expected behavior Should simply use the scripts provided by Android NDK. Or rather if it encounters an error it should spill as much internal information as possible. The current behavior is not optimal for providing proper bug reporting.
system parameters
3.8.10
meson --version
0.53.2