Article 6F90W regression: mesa failed to build with newer meson 1.2.2

regression: mesa failed to build with newer meson 1.2.2

by
lucabon
from LinuxQuestions.org on (#6F90W)
With the introduction of meson 1.2.2, mesa failed to build with the following error:

Code:FAILED: src/gallium/frontends/rusticl/rusticl_mesa_bindings.rs
/usr/bin/bindgen ../src/gallium/frontends/rusticl/rusticl_mesa_bindings.h --output /root/tmp/mesa-23.2.1/meson-build/src/gallium/frontends/rusticl/rusticl_mesa_bindings.rs [...]

warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-nonnull-compare' [-Wunknown-warning-option]
error: unknown argument: '-mtls-dialect=gnu2'
warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-nonnull-compare' [-Wunknown-warning-option]
/usr/include/stdlib.h:32:10: fatal error: 'stddef.h' file not found
clang diag: warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option]
clang diag: warning: unknown warning option '-Wno-nonnull-compare' [-Wunknown-warning-option]
panicked at 'Unable to generate bindings: ClangDiagnostic("error: unknown argument: '-mtls-dialect=gnu2'\n/usr/include/stdlib.h:32:10: fatal error: 'stddef.h' file not found\n")', bindgen-cli/main.rs:52:36This because meson 1.2.2 incorrectly add C compiler options to "bindgen" program.

Reverting the old behavior solves the issue:
Code:diff -ur meson-1.2.2/mesonbuild/modules/rust.py meson-1.2.1/mesonbuild/modules/rust.py
--- meson-1.2.2/mesonbuild/modules/rust.py 2023-09-28 17:25:47.000000000 +0200
+++ meson-1.2.1/mesonbuild/modules/rust.py 2023-08-07 22:40:24.000000000 +0200
@@ -232,12 +232,6 @@
elif isinstance(s, CustomTarget):
depends.append(s)

- clang_args.extend(state.global_args.get('c', []))
- clang_args.extend(state.project_args.get('c', []))
- cargs = state.get_option('args', state.subproject, lang='c')
- assert isinstance(cargs, list), 'for mypy'
- clang_args.extend(cargs)
-
if self._bindgen_bin is None:
self._bindgen_bin = state.find_program('bindgen')Maybe it could be possible to fix the issue also in Mesa's meson build file, but I'm not a meson expert....
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments