Compiling Mesa v22 fails on install step

Hi there,

I am trying to compile and install. Mesa appears to compile correctly, but I am getting a weird behavior on the install step:

Compile: Asserting that requirements are met...
SandboxInstall: overlayfs is available. Using UnionSandbox.
SandboxInstall: Installing Mesa...
[15/23] Compiling C object src/gallium/frontends/va/libva_st.a.p/surface.c.o
FAILED: src/gallium/frontends/va/libva_st.a.p/surface.c.o 
cc -Isrc/gallium/frontends/va/libva_st.a.p -Isrc/gallium/frontends/va -I../src/gallium/frontends/va -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/util -I../src/util -I/usr/include/libdrm -fvisibility=hidden -flto=auto -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O3 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="22.0.0"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_X11_PLATFORM -DHAVE_WAYLAND_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DUSE_ELF_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=1 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_QSORT_R -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LIBUDEV -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="13.0.1"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DUSE_LIBGLVND=1 -DMESA_EXECMEM -DHAVE_LIBUNWIND -DWL_HIDE_DEPRECATED -DHAVE_OPENMP -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_GALLIUM_EXTRA_HUD=1 -DHAVE_LIBSENSORS=1 -DVK_USE_PLATFORM_WAYLAND_KHR -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_XLIB_XRANDR_EXT -DVK_USE_PLATFORM_DISPLAY_KHR -mtls-dialect=gnu2 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -fno-common -Werror=format -Wformat-security -ffunction-sections -fdata-sections -O2 -fomit-frame-pointer -pipe -fPIC -pthread -DVA_DRIVER_INIT_FUNC=__vaDriverInit_1_13 -MD -MQ src/gallium/frontends/va/libva_st.a.p/surface.c.o -MF src/gallium/frontends/va/libva_st.a.p/surface.c.o.d -o src/gallium/frontends/va/libva_st.a.p/surface.c.o -c ../src/gallium/frontends/va/surface.c
../src/gallium/frontends/va/surface.c: In function ‘vlVaQuerySurfaceAttributes’:
../src/gallium/frontends/va/surface.c:518:25: error: ‘VASurfaceAttribDRMFormatModifiers’ undeclared (first use in this function)
  518 |       attribs[i].type = VASurfaceAttribDRMFormatModifiers;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/frontends/va/surface.c:518:25: note: each undeclared identifier is reported only once for each function it appears in
../src/gallium/frontends/va/surface.c: In function ‘vlVaCreateSurfaces2’:
../src/gallium/frontends/va/surface.c:831:10: error: unknown type name ‘VADRMFormatModifierList’
  831 |    const VADRMFormatModifierList *modifier_list;
      |          ^~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/frontends/va/surface.c:901:12: error: ‘VASurfaceAttribDRMFormatModifiers’ undeclared (first use in this function)
  901 |       case VASurfaceAttribDRMFormatModifiers:
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/frontends/va/surface.c:905:35: error: request for member ‘modifiers’ in something not a structure or union
  905 |          modifiers = modifier_list->modifiers;
      |                                   ^~
../src/gallium/frontends/va/surface.c:906:41: error: request for member ‘num_modifiers’ in something not a structure or union
  906 |          modifiers_count = modifier_list->num_modifiers;
      |                                         ^~
[20/23] Compiling C object src/gallium/frontends/va/libva_st.a.p/picture_hevc_enc.c.o
ninja: build stopped: subcommand failed.
UnionSandbox: Cleaning up.
UnionSandbox: Moving entries to: /Programs/Mesa/22.0.0/.SandboxInstall_Root
Compile: Installation was moved to /Programs/Mesa/22.0.0-failed
Compile: Mesa 22.0.0 - Installation failed

It looks like Compile is executing a build process in the install step?
I have never had this, what could be wrong?

This is my Recipe:

url="https://mesa.freedesktop.org/archive/mesa-22.0.0.tar.xz"
file_size=15565680
file_md5=cbc2f80946339578e75adcefe32cbd8a
recipe_type=meson

environment=(
    GALLIUM_DRV=
    DRI_DRIVERS=
    CPLUS_INCLUDE_PATH="/System/Index/include/c++/11.2.0:/System/Index/include:$CPLUS_INCLUDE_PATH"
)

meson_variables=(
    -D buildtype=release
    -D b_lto=true
    -D b_ndebug=true
    -D platforms=x11,wayland
    -D build-tests=false
    -D gallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris,crocus,zink,d3d12
    -D vulkan-drivers=amd,intel,swrast
    -D vulkan-layers=device-select,intel-nullhw,overlay
    -D dri3=enabled
    -D egl=enabled
    -D gallium-extra-hud=true
    -D gallium-nine=true
    -D gallium-omx=bellagio
    -D gallium-opencl=icd
    -D gallium-va=enabled
    -D gallium-vdpau=enabled
    -D gallium-xa=enabled
    -D gallium-xvmc=disabled
    -D gbm=enabled
    -D gles1=disabled
    -D gles2=enabled
    -D glvnd=true
    -D glx=dri
    -D libunwind=enabled
    -D llvm=enabled
    -D lmsensors=enabled
    -D osmesa=true
    -D shared-glapi=enabled
    -D microsoft-clc=disabled
    -D valgrind=disabled
)

symlink_options=(
   --conflict=overwrite
)

Just as a reference, here is the ArchLinux PKGBUILD.

Ok, for some reason updating to LibVA 2.13.0 → 2.14.0 fixed it, even though ArchLinux uses LibVA 2.13.0 in their build :thinking:

But yeah at least that fixed it :slight_smile:

1 Like

So, I should use the updated version of LibVA. Is that right?

No, unless you want to build mesa v22. But our latest Mesa recipe already sets LibVA >= 2.14.0, so Compile will ask you to update LibVA automatically: