MSVC: Building both osmesa and tests fails
System information
OS: Windows 10.0.19042
Describe the issue
Building both osmesa and tests started failing at some point. 20.3 branch is fine, but 21.0 and master are affected. This regression wasn't noticed sooner due to loss of osmesa Windows CI coverage during migration from AppVeyor to Gitlab CI. Resembles to #1947 (closed)
087ef91c)
MSVC log (**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.8.4
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Build configuration command: meson.exe build/x64 --buildtype=release --prefix=C:/Software/DEVELO~1/projects/mesa-dist-win/dist/x64 -Db_vscrt=mt -Dzlib:default_library=static -Dllvm=enabled -Dshared-llvm=disabled --backend=ninja -Dgallium-drivers=swrast -Dosmesa=true -Dbuild-tests=true
The Meson build system
Version: 0.56.2
Source dir: C:\Software\Development\projects\mesa
Build dir: C:\Software\Development\projects\mesa\build\x64
Build type: native build
Program python found: YES (C:\Software\Python39\python.EXE)
Project name: mesa
Project version: 21.1.0-devel
C compiler for the host machine: cl (msvc 19.28.29336 "Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64")
C linker for the host machine: link link 14.28.29336.0
C++ compiler for the host machine: cl (msvc 19.28.29336 "Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64")
C++ linker for the host machine: link link 14.28.29336.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency clang found: NO (tried cmake)
Program C:\Software\Python39\python found: YES (C:\Software\Python39\python.exe)
Fetching value of define "ETIME" : 137
Checking for function "bswap32" : NO
Checking for function "bswap64" : NO
Checking for function "clz" : NO
Checking for function "clzll" : NO
Checking for function "ctz" : NO
Checking for function "expect" : NO
Checking for function "ffs" : NO
Checking for function "ffsll" : NO
Checking for function "popcount" : NO
Checking for function "popcountll" : NO
Checking for function "unreachable" : NO
Checking for function "types_compatible_p" : NO
Compiler for C supports function attribute const: NO
Compiler for C supports function attribute flatten: NO
Compiler for C supports function attribute malloc: NO
Compiler for C supports function attribute pure: NO
Compiler for C supports function attribute unused: NO
Compiler for C supports function attribute warn_unused_result: NO
Compiler for C supports function attribute weak: NO
Compiler for C supports function attribute format: NO
Compiler for C supports function attribute packed: NO
Compiler for C supports function attribute returns_nonnull: NO
Compiler for C supports function attribute alias: NO
Compiler for C supports function attribute noreturn: NO
Compiler for C supports function attribute visibility:hidden: NO
Checking if "__uint128_t" compiles: NO
Compiler for C supports arguments /wd4018: YES
Compiler for C++ supports arguments /wd4018: YES (cached)
Compiler for C supports arguments /wd4056: YES
Compiler for C++ supports arguments /wd4056: YES (cached)
Compiler for C supports arguments /wd4244: YES
Compiler for C++ supports arguments /wd4244: YES (cached)
Compiler for C supports arguments /wd4267: YES
Compiler for C++ supports arguments /wd4267: YES (cached)
Compiler for C supports arguments /wd4305: YES
Compiler for C++ supports arguments /wd4305: YES (cached)
Compiler for C supports arguments /wd4351: YES
Compiler for C++ supports arguments /wd4351: YES (cached)
Compiler for C supports arguments /wd4756: YES
Compiler for C++ supports arguments /wd4756: YES (cached)
Compiler for C supports arguments /wd4800: YES
Compiler for C++ supports arguments /wd4800: YES (cached)
Compiler for C supports arguments /wd4996: YES
Compiler for C++ supports arguments /wd4996: YES (cached)
Compiler for C supports arguments /wd4291: YES
Compiler for C++ supports arguments /wd4291: YES (cached)
Compiler for C supports arguments /wd4146: YES
Compiler for C++ supports arguments /wd4146: YES (cached)
Compiler for C supports arguments /wd4200: YES
Compiler for C++ supports arguments /wd4200: YES (cached)
Compiler for C supports arguments /wd4624: YES
Compiler for C++ supports arguments /wd4624: YES (cached)
Compiler for C supports arguments /wd4309: YES
Compiler for C++ supports arguments /wd4309: YES (cached)
Compiler for C supports arguments /wd4838: YES
Compiler for C++ supports arguments /wd4838: YES (cached)
Compiler for C supports arguments /we4020: YES
Compiler for C++ supports arguments /we4020: YES (cached)
Compiler for C supports arguments /we4024: YES
Compiler for C++ supports arguments /we4024: YES (cached)
Checking if "GCC atomic builtins" compiles: NO
Checking if "GCC 64bit atomics" with dependency not-found links: NO
Library ws2_32 found: YES
Header <sys/sysmacros.h> has symbol "major" : NO
Header <sys/mkdev.h> has symbol "major" : NO
Check usable header "sys/sysctl.h" : NO
Check usable header "xlocale.h" : NO
Check usable header "linux/futex.h" : NO
Check usable header "endian.h" : NO
Check usable header "dlfcn.h" : NO
Check usable header "execinfo.h" : NO
Check usable header "sys/shm.h" : NO
Check usable header "cet.h" : NO
Check usable header "pthread_np.h" : NO
Checking for function "strtof" : YES
Checking for function "mkostemp" : NO
Checking for function "timespec_get" : NO
Checking for function "memfd_create" : NO
Checking for function "random_r" : NO
Checking for function "flock" : NO
Checking for function "strtok_r" : NO
Checking for function "getrandom" : NO
Header <errno.h> has symbol "program_invocation_name" : NO
Checking whether type "struct dirent" has member "d_type" : NO
Checking if "strtod has locale support" links: NO
Checking if "Bsymbolic" links: NO
Checking if "gc-sections" links: NO
Checking if "version-script" links: NO
Checking if "dynamic-list" links: NO
Compiler for C supports link arguments -Wl,--build-id=sha1: NO
Checking for function "dlopen" : NO
Library dl found: NO
Checking for function "dladdr" with dependency -ldl: NO
Checking for function "dl_iterate_phdr" : NO
Found pkg-config: C:\Software\DEVELO~1\projects\pkgconf\pkgconf\pkg-config.EXE (1.7.3)
Run-time dependency zlib found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency zlib
|Executing subproject zlib method meson
|
|Project name: zlib
|Project version: 1.2.11
|C compiler for the host machine: cl (msvc 19.28.29336 "Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29336 for x64")
|C linker for the host machine: link link 14.28.29336.0
|Windows resource compiler: Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
|Build targets in project: 2
|Subproject zlib finished.
Dependency zlib from subproject subprojects/zlib-1.2.11 found: YES 1.2.11
Run-time dependency libzstd found: NO (tried pkgconfig and cmake)
Run-time dependency threads found: YES
Library m found: NO
Run-time dependency libdrm found: NO (tried pkgconfig and cmake)
llvm-config found: YES (C:\Software\DEVELO~1\projects\llvm\x64\bin\llvm-config.EXE) 11.0.1
Run-time dependency LLVM (modules: bitwriter, core, engine, executionengine, instcombine, mcdisassembler, mcjit, native, scalaropts, transformutils, coroutines) found: YES 11.0.1
Run-time dependency valgrind found: NO (tried pkgconfig)
Program win_flex found: YES (C:\Software\DEVELO~1\projects\flexbison\win_flex.EXE)
Program win_bison found: YES (C:\Software\DEVELO~1\projects\flexbison\win_bison.EXE)
Run-time dependency libunwind found: NO (tried pkgconfig and cmake)
Library sensors found: NO
Compiler for C supports link arguments -Wl,--gc-sections: NO
Program dumpbin found: YES (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\dumpbin.EXE)
Program symbols-check.py found: YES (python C:\Software\Development\projects\mesa\bin\symbols-check.py)
Program install_megadrivers.py found: YES (c:\software\python39\python.exe C:\Software\Development\projects\mesa\bin\install_megadrivers.py)
Program xmllint found: NO
Has header "sys/time.h" : NO
Message: Configuration summary:
prefix: C:/Software/DEVELO~1/projects/mesa-dist-win/dist/x64
libdir: lib
includedir: include
OpenGL: yes (ES1: no ES2: no)
OSMesa: libosmesa
EGL: no
GBM: no
Vulkan drivers: no
llvm: yes
llvm-version: 11.0.1
Gallium drivers: swrast
Gallium st: mesa
HUD lmsensors: no
Shared-glapi: no
Build targets in project: 176
mesa 21.1.0-devel
Subprojects
zlib: YES
Option buildtype is: release [default: debugoptimized]
Found ninja-1.10.2 at C:\Software\DEVELO~1\projects\ninja\ninja.EXE
Build command: ninja -C C:/Software/DEVELO~1/projects/mesa/build/x64 -j 3
Press any key to continue . . .
ninja: Entering directory `C:/Software/DEVELO~1/projects/mesa/build/x64'
[495/1250] Compiling C object src/gallium/auxiliary/libgallium.a.p/draw_draw_gs.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[525/1250] Compiling C object src/gallium/auxiliary/libgallium.a.p/draw_draw_tess.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[637/1250] Generating glcpp-parse.[ch] with a custom command
../../src/compiler/glsl/glcpp/glcpp-parse.y:176.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated]
176 | %pure-parser
| ^~~~~~~~~~~~
| %define api.pure
../../src/compiler/glsl/glcpp/glcpp-parse.y:177.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated]
177 | %error-verbose
| ^~~~~~~~~~~~~~
| %define parse.error verbose
../../src/compiler/glsl/glcpp/glcpp-parse.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
[647/1250] Generating glsl_parser with a custom command
../../src/compiler/glsl/glsl_parser.yy:85.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated]
85 | %pure-parser
| ^~~~~~~~~~~~
| %define api.pure
../../src/compiler/glsl/glsl_parser.yy:86.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated]
86 | %error-verbose
| ^~~~~~~~~~~~~~
| %define parse.error verbose
../../src/compiler/glsl/glsl_parser.yy: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
[800/1250] Generating program_parse_tab.[ch] with a custom command
../../src/mesa/program/program_parse.y:131.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated]
131 | %pure-parser
| ^~~~~~~~~~~~
| %define api.pure
../../src/mesa/program/program_parse.y:135.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated]
135 | %error-verbose
| ^~~~~~~~~~~~~~
| %define parse.error verbose
../../src/mesa/program/program_parse.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
[1034/1250] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_arit_overflow.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1044/1250] Compiling C++ object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_debug.cpp.obj
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm/IR/User.h(48): warning C4141: 'inline': used more than once
[1049/1250] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_nir_soa.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1050/1250] Compiling C object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_nir.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1064/1250] Compiling C++ object src/gallium/auxiliary/libgallium.a.p/gallivm_lp_bld_misc.cpp.obj
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm/IR/User.h(48): warning C4141: 'inline': used more than once
[1066/1250] Compiling C++ object src/gallium/auxiliary/libgallium.a.p/tessellator_tessellator.cpp.obj
../../src/gallium/auxiliary/tessellator/tessellator.cpp(199): warning C4293: '<<': shift count negative or too big, undefined behavior
../../src/gallium/auxiliary/tessellator/tessellator.cpp(380): note: see reference to function template instantiation 'INT32 floatToIDotF<15,16,false>(const float &)' being compiled
../../src/gallium/auxiliary/tessellator/tessellator.cpp(221): warning C4293: '<<': shift count negative or too big, undefined behavior
[1070/1250] Compiling C object src/gallium/auxiliary/libgallium.a.p/draw_draw_llvm.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1122/1250] Compiling C object src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_jit.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1132/1250] Compiling C object src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_setup_vbuf.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1142/1250] Compiling C object src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_state_cs.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1153/1250] Compiling C object src/gallium/drivers/llvmpipe/libllvmpipe.a.p/lp_tex_sample.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1154/1250] Compiling C object src/gallium/drivers/llvmpipe/lp_test_format.exe.p/lp_test_format.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1161/1250] Compiling C object src/gallium/drivers/llvmpipe/lp_test_printf.exe.p/lp_test_printf.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1165/1250] Compiling C object src/gallium/drivers/llvmpipe/lp_test_blend.exe.p/lp_test_blend.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1166/1250] Compiling C object src/gallium/drivers/llvmpipe/lp_test_conv.exe.p/lp_test_conv.c.obj
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_math.h(90): warning C4005: 'HUGE_VALF': macro redefinition
C:\Software\DEVELO~1\projects\llvm\x64\include\llvm-c/DataTypes.h(81): note: see previous definition of 'HUGE_VALF'
[1182/1250] Compiling C++ object src/gallium/targets/osmesa/osmesa-render.exe.p/test-render.cpp.obj
FAILED: src/gallium/targets/osmesa/osmesa-render.exe.p/test-render.cpp.obj
"cl" "-Isrc\gallium\targets/osmesa\osmesa-render.exe.p" "-Isrc\gallium\targets/osmesa" "-I..\..\src\gallium\targets\osmesa" "-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" "-I..\..\src\gtest\include" "-DNDEBUG" "/MT" "/nologo" "/showIncludes" "/W2" "/EHsc" "/std:c++14" "/permissive-" "/O2" "/Ob2" "/Gw" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DPACKAGE_VERSION=\"21.1.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\"" "-DENABLE_ST_OMX_BELLAGIO=0" "-DENABLE_ST_OMX_TIZONIA=0" "-DEGL_NO_X11" "-D_WINDOWS" "-D_WIN32_WINNT=0x0A00" "-DWINVER=0x0A00" "-DPIPE_SUBSYSTEM_WINDOWS_USER" "-D_USE_MATH_DEFINES" "-DVC_EXTRALEAN" "-D_CRT_SECURE_NO_WARNINGS" "-D_CRT_SECURE_NO_DEPRECATE" "-D_SCL_SECURE_NO_WARNINGS" "-D_SCL_SECURE_NO_DEPRECATE" "-D_ALLOW_KEYWORD_MACROS" "-D_HAS_EXCEPTIONS=0" "-DNOMINMAX" "-DMISSING_64BIT_ATOMICS" "-DHAVE_STRTOF" "-DHAVE_ZLIB" "-DLLVM_AVAILABLE" "-DMESA_LLVM_VERSION_STRING=\"11.0.1\"" "-DLLVM_IS_SHARED=0" "/wd4018" "/wd4056" "/wd4244" "/wd4267" "/wd4305" "/wd4351" "/wd4756" "/wd4800" "/wd4996" "/wd4291" "/wd4146" "/wd4200" "/wd4624" "/wd4309" "/wd4838" "/we4020" "/we4024" "/Fdsrc\gallium\targets/osmesa\osmesa-render.exe.p\test-render.cpp.pdb" /Fosrc/gallium/targets/osmesa/osmesa-render.exe.p/test-render.cpp.obj "/c" ../../src/gallium/targets/osmesa/test-render.cpp
../../src/gallium/targets/osmesa/test-render.cpp(173): error C2131: expression did not evaluate to a constant
../../src/gallium/targets/osmesa/test-render.cpp(173): note: failure was caused by a read of a variable outside its lifetime
../../src/gallium/targets/osmesa/test-render.cpp(173): note: see usage of 'h'
[1184/1250] Linking target src/gallium/targets/osmesa/osmesa.dll
Creating library src\gallium\targets/osmesa\osmesa.lib and object src\gallium\targets/osmesa\osmesa.exp
ninja: build stopped: subcommand failed.