Created attachment 914862 [details] build.log bzipped [ebuild U ] media-libs/mesa-24.3.2::gentoo [24.3.0::gentoo] USE="X d3d9 llvm lm-sensors opencl (opengl) proprietary-codecs vaapi vulkan wayland zstd -debug -osmesa (-selinux) -test -unwind -valgrind -vdpau -xa" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="18 -15 -16 -17" VIDEO_CARDS="radeon radeonsi -d3d12 (-freedreno) -intel -lavapipe (-lima) -nouveau -nvk (-panfrost) -r300 -r600 (-v3d) (-vc4) -virgl (-vivante) -vmware -zink" 0 KiB [1460/1846] /opt/rust-bin-1.81.0/bin/rustc -C linker=x86_64-pc-linux-gnu-gcc --color=always -C debug-assertions=no -C overflow-checks=no --crate-type rlib --edition=2021 --crate-name libc_rust_gen --emit dep-info=src/gallium/frontends/rusticl/libc_rust_gen.d --emit link=src/gallium/frontends/rusticl/liblibc_rust_gen.rlib --out-dir src/gallium/frontends/rusticl/liblibc_rust_gen.rlib.p -C metadata=b863b06@@libc_rust_gen@sta -Aclippy::all -Aimproper_ctypes -Aunused_unsafe -Anon_camel_case_types -Anon_snake_case -Anon_upper_case_globals src/gallium/frontends/rusticl/rusticl_libc_bindings.rs FAILED: src/gallium/frontends/rusticl/liblibc_rust_gen.rlib /opt/rust-bin-1.81.0/bin/rustc -C linker=x86_64-pc-linux-gnu-gcc --color=always -C debug-assertions=no -C overflow-checks=no --crate-type rlib --edition=2021 --crate-name libc_rust_gen --emit dep-info=src/gallium/frontends/rusticl/libc_rust_gen.d --emit link=src/gallium/frontends/rusticl/liblibc_rust_gen.rlib --out-dir src/gallium/frontends/rusticl/liblibc_rust_gen.rlib.p -C metadata=b863b06@@libc_rust_gen@sta -Aclippy::all -Aimproper_ctypes -Aunused_unsafe -Anon_camel_case_types -Anon_snake_case -Anon_upper_case_globals src/gallium/frontends/rusticl/rusticl_libc_bindings.rs error: extern block cannot be declared unsafe --> src/gallium/frontends/rusticl/rusticl_libc_bindings.rs:3:1 | 3 | unsafe extern "C" { | ^^^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information error: extern block cannot be declared unsafe --> src/gallium/frontends/rusticl/rusticl_libc_bindings.rs:9:1 | 9 | unsafe extern "C" { | ^^^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information error: extern block cannot be declared unsafe --> src/gallium/frontends/rusticl/rusticl_libc_bindings.rs:12:1 | 12 | unsafe extern "C" { | ^^^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information error: extern block cannot be declared unsafe --> src/gallium/frontends/rusticl/rusticl_libc_bindings.rs:15:1 | 15 | unsafe extern "C" { | ^^^^^^ | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information error: aborting due to 4 previous errors
Created attachment 914863 [details] emerge --info
same with mesa-9999 last successful build was 24.3.1 which had runtime crashes.
"unsafe extern" blocks require >=1.82 aka "2024 edition".
(In reply to Holger Hoffstätte from comment #3) > "unsafe extern" blocks require >=1.82 aka "2024 edition". That would require either llvm slot 19 for mesa or rust >=1.82 with llvm slot 18, if that works.
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c0b4a10435fe8fc45ff51d4818268779cd7f50b media-libs/mesa: Add LLVM_SLOT=19 9999 works now
*** Bug 950195 has been marked as a duplicate of this bug. ***
This is not fixed, see the duplicate bug. It appears that Rust < 1.82.0 can't successfully build 24.3.2. That doesn't appear to make sense based on the upstream Rust minimum requirements: https://docs.mesa3d.org/rusticl.html However 'unsafe extern' requires at least 1.82.0. https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html Haven't been able to reproduce this locally but I suspect that bindgen is targeting the wrong edition of Rust or something along those lines.
This is a meson bug fixed in meson 1.7.0
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a89a5cd12f2e2f63684df1790b8cf9162ce4d90b commit a89a5cd12f2e2f63684df1790b8cf9162ce4d90b Author: Matt Jolly <kangie@gentoo.org> AuthorDate: 2025-02-25 03:27:41 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2025-02-28 15:10:58 +0000 media-libs/mesa: bump meson and bindgen deps for Rust-related USE Due to a bug in Meson < 1.7.0, it is possible for bindgen to generate code that is not compatible with the compiler in use. This has the potential to cause build failures when e.g. edition 2024 bindings are generated for a compiler that only supports edition 2021 code. A patch has been submitted upstream to enforce this dependency in the Meson build scripts, however we can just enforce dependencies on appropriate bindgen and Meson versions if the USE flags that generate bindings are selected. Bug: https://bugs.gentoo.org/946913 Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12680 Signed-off-by: Matt Jolly <kangie@gentoo.org> Signed-off-by: Matt Turner <mattst88@gentoo.org> media-libs/mesa/mesa-25.0.0.ebuild | 6 ++++-- media-libs/mesa/mesa-9999.ebuild | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
meson-1.7.0 is stable now.