=media-libs:mesa-24.2.2 build fails to build after upgrade to rust-1.81.0 Reproducible: Always Steps to Reproduce: install/update to rust-1.81.0 emerge =mesa-mesa-24.2.2 Actual Results: FAILED: src/gallium/frontends/rusticl/librusticl_opencl_gen.rlib 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 rusticl_opencl_gen --emit dep-info=src/gallium/frontends/rusticl/rusticl_opencl_gen.d --emit link=src/gallium/frontends/rusticl/librusticl_opencl_gen.rlib --out-dir src/gallium/frontends/rusticl/librusticl_opencl_gen.rlib.p -C metadata=b863b06@@rusticl_opencl_gen@sta -Aclippy::all -Aimproper_ctypes -Aunused_unsafe -Anon_camel_case_types -Anon_snake_case -Anon_upper_case_globals src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7030:31 | 7030 | ["Alignment of cl_char8"][::std::mem::align_of::<cl_char8>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7180:10 | 7180 | [::std::mem::align_of::<cl_char16__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7471:32 | 7471 | ["Alignment of cl_uchar8"][::std::mem::align_of::<cl_uchar8>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7624:10 | 7624 | [::std::mem::align_of::<cl_uchar16__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7809:32 | 7809 | ["Alignment of cl_short4"][::std::mem::align_of::<cl_short4>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:7900:10 | 7900 | [::std::mem::align_of::<cl_short8__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:8264:33 | 8264 | ["Alignment of cl_ushort4"][::std::mem::align_of::<cl_ushort4>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:8358:10 | 8358 | [::std::mem::align_of::<cl_ushort8__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:9060:30 | 9060 | ["Alignment of cl_int2"][::std::mem::align_of::<cl_int2>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:9138:10 | 9138 | [::std::mem::align_of::<cl_int4__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:9511:31 | 9511 | ["Alignment of cl_uint2"][::std::mem::align_of::<cl_uint2>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:9589:10 | 9589 | [::std::mem::align_of::<cl_uint4__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:10862:32 | 10862 | ["Alignment of cl_float2"][::std::mem::align_of::<cl_float2>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error[E0080]: evaluation of constant value failed --> src/gallium/frontends/rusticl/rusticl_opencl_bindings.rs:10940:10 | 10940 | [::std::mem::align_of::<cl_float4__bindgen_ty_3>() - 8usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `4_usize - 8_usize`, which would overflow error: aborting due to 14 previous errors For more information about this error, try `rustc --explain E0080`. systen is full ~arch bug was found during emerge -e @world that include the rust upgrade
Created attachment 903243 [details] emerge --info
Created attachment 903244 [details] mesa-24.2.2-build-fail.log
Surely rust-1.81.0 breakage.
*** Bug 939824 has been marked as a duplicate of this bug. ***
Created attachment 903300 [details] build fail with rust downgrade to rust-1.80.1
Downgraded bindgen to =dev-util/bindgen-0.69.4 mesa built successfully with =rust-1.80.1 updated rust to rust-1.81.0 bindgen-0.70.1 was the problem package
I can confirm this also happens with mesa 24.1.7 and latest bindgen-0.70.1. Downgrading to bindgen-0.69.4 fixes the issue.
Ran into this as well, Freedesktop has a bug on this I think. https://gitlab.freedesktop.org/mesa/mesa/-/issues/11722
It seems the problem was fixed in media-libs/mesa-24.2.5
I can't build mesa 24.2.5 with bindgen 0.70.1, and I masked it on my system. Downgrading it allows mesa to build. So I don't think is fixed.
(In reply to Ghiunhan Mamut from comment #10) > I can't build mesa 24.2.5 with bindgen 0.70.1, and I masked it on my system. > Downgrading it allows mesa to build. So I don't think is fixed. Hm... it works for me though: amd64 / rust-1.81.0 / bindgen-0.70.1 / mesa-24.2.5 - builds fine mesa-24.1.7 - fails with the above message My USE="X abi_x86_32 abi_x86_64 amd64 cpu_flags_x86_sse2 elibc_glibc kernel_linux llvm llvm_slot_18 lm-sensors opencl opengl osmesa proprietary-codecs vaapi vdpau video_cards_intel vulkan wayland xa zstd"
I also got this error with media-libs/mesa-24.1.7 when adding ABI_X68="32". Using media-libs/mesa-24.2.5 instead it installs fine.
*** Bug 942043 has been marked as a duplicate of this bug. ***
*** Bug 939668 has been marked as a duplicate of this bug. ***
https://gitlab.freedesktop.org/mesa/mesa/-/commit/3b938aa4cd508456c96843ac6d7b720c0b2d451d is in >=24.2.3. Stable still needs fixing or we stable 24.2.x.
Here's what happens for me (rust-bin 1.81.0) - 24.1.7[-opencl] -- works - 24.1.7[opencl] -- fails with this bug - 24.2.6 -- works for both USE flags
same here on media-libs/mesa-24.1.7-r1 with dev-util/bindgen-0.70.1-r1 Installed versions: 24.1.7^t(15:27:28 19/09/2024)(X llvm opencl opengl vaapi vdpau wayland zstd -d3d9 -debug -lm-sensors -osmesa -proprietary-codecs -selinux -test -unwind -valgrind -vulkan -vulkan-overlay -xa ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" CPU_FLAGS_X86="sse2" LLVM_SLOT="18 -15 -16 -17" VIDEO_CARDS="intel -d3d12 -freedreno -lavapipe -lima -nouveau -nvk -panfrost -r300 -r600 -radeon -radeonsi -v3d -vc4 -virgl -vivante -vmware -zink")
Can confirm that package builds -opencl use flag.
Created attachment 908355 [details, diff] Commit from mesa-24.2.0, prerequisite for patching mesa-24.1.7 I can confirm that the commit mentioned earlier appears to fix the problem for me. However, it does not apply directly to the mesa-24.1.7 build. To fix that, I am attaching a commit from mesa-24.2.0; when used to patch mesa-24.1.7, the commit that appears to fix the problem will apply. This is a commit taken directly from a release branch of mesa, and so should fall under the same licensing as mesa.
Created attachment 908356 [details, diff] Commit from mesa-24.2.3, appears to fix the problem This is a commit from mesa-24.2.3 (the commit ID is in the patch file). When applied to mesa-24.1.7, it appears to fix the problem for me (also mentioned above as a potential fix). However, it does not apply directly to the mesa-24.1.7 tree; it does appear to apply if the prerequisite commit (above) is applied first. This patch is taken directly from a commit from a release build branch of mesa, and so should fall under the same licensing.
Created attachment 908357 [details] Sample ebuild applying the above patches This is an example of a modification of the mesa-24.1.7.ebuild that applies the above patches in the proper order. For me, at least, this appears to fix the problem. I will leave it to others to decide if they prefer any alternatives, including using USE=-opencl, stabilizing/keywording a newer version of mesa, or applying the above patches using /etc/portage/patches/.
(In reply to Anon Emuss from comment #21) > Created attachment 908357 [details] > Sample ebuild applying the above patches > I believe it's decided to stabilize 24.2.6 and call it a day rather than patch older versions.
FYI - even with mesa-24.6.2, I had to mask >=bindgen-0.70 for opencl USE and nvk+nouveau VIDEO_CARDS
Is a similar workaround doable in the ebuild? https://github.com/Frogging-Family/mesa-git/pull/50 According to latest updates this seems to be a meson cross-build issue.