NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.38k stars 14.33k forks source link

chromium fails to build on nixpkgs master #118931

Closed flokli closed 3 years ago

flokli commented 3 years ago

To Reproduce Steps to reproduce the behavior:

nix-build -A chromium

FAILED: obj/media/gpu/vaapi/vaapi/vaapi_video_decoder.o 
clang++ -MMD -MF obj/media/gpu/vaapi/vaapi/vaapi_video_decoder.o.d -DMEDIA_GPU_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-12-init-16296-g5e476061-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=375504 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_
VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DVK_USE_PLATFORM_XCB_KHR -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_USE_LIBGIFCODEC -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_USE_PLATFORM_XCB_KHR -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TR
ACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DVK_NO_PROTOTYPES -DUSE_VULKAN_XCB -I../.. -Igen -I../../third_party/libvpx/source/config -I../../third_party/libvpx/source/config/linux/x64 -I../../third_party/libvpx/source/libvpx -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Ige
n/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../third_party/vulkan-deps/vulkan-headers/src/include -I../../third_party/libyuv/include -Igen/shim_headers/ffmpeg_shim -Igen/shim_headers/opus_shim -Igen/shim_headers/snappy_shim -I../../third_party/khronos -I../../gpu -Igen/third_party/dawn/src/include -I../../third_party/dawn/src/include -I../../third_party/libwebm/source -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/skia -I../../third_party/libgifcodec -I../../third_party/vulkan/include -I../../third_party/vulkan-deps/v
ulkan-headers/src/include -I../../third_party/mesa_headers -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include -I../../third_party/crashpad/crashpad -I../../third_party/crashpad/crashpad/compat/non_mac -I../../third_party/crashpad/crashpad/compat/linux -I../../third_party/crashpad/crashpad/compat/non_win -I../../third_party/ced/src -I../../third_party/libvpx/source/libvpx -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-prot
ector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers -m64 -march=x86-64 -msse3 -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimi
ze -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/ignores.txt -fsanitize=cfi-icall -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -I/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include -Wno-conversion -Wno-parentheses-equality -Wno-unused-function -I/nix/store/vmz5z5gr7r09ay7pn2a8p5yl4y
ih0x4y-glib-2.66.8-dev/include -I/nix/store/vmz5z5gr7r09ay7pn2a8p5yl4yih0x4y-glib-2.66.8-dev/include/glib-2.0 -I/nix/store/ap4d6cqfhakl2dp6081z2c6bsdcinsha-glib-2.66.8/lib/glib-2.0/include -DPROTOBUF_ALLOW_DEPRECATED=1 -Wno-shorten-64-to-32 -I/nix/store/n2msf8y6pnvy2kzxiygy7y62i4bjidb6-libdrm-2.4.104-dev/include -I/nix/store/n2msf8y6pnvy2kzxiygy7y62i4bjidb6-libdrm-2.4.104-dev/include/libdrm -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../media/gpu/
vaapi/vaapi_video_decoder.cc -o obj/media/gpu/vaapi/vaapi/vaapi_video_decoder.o
In file included from ../../media/gpu/vaapi/vaapi_video_decoder.cc:27:
In file included from ../../media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h:12:
In file included from ../../media/gpu/vaapi/vaapi_video_decoder_delegate.h:23:
../../third_party/libva_protected_content/va_protected_content.h:136:14: error: redefinition of '_VA_TEE_EXEC_FUNCTION_ID'
typedef enum _VA_TEE_EXEC_FUNCTION_ID {
             ^
/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include/va/va_prot.h:405:14: note: previous definition is here
typedef enum _VA_TEE_EXEC_FUNCTION_ID {
             ^
In file included from ../../media/gpu/vaapi/vaapi_video_decoder.cc:27:
In file included from ../../media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h:12:
In file included from ../../media/gpu/vaapi/vaapi_video_decoder_delegate.h:23:
../../third_party/libva_protected_content/va_protected_content.h:163:16: error: redefinition of '_VAEncryptionSegmentInfo'
typedef struct _VAEncryptionSegmentInfo {
               ^
/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include/va/va.h:2044:16: note: previous definition is here
typedef struct _VAEncryptionSegmentInfo {
               ^
In file included from ../../media/gpu/vaapi/vaapi_video_decoder.cc:27:
In file included from ../../media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h:12:
In file included from ../../media/gpu/vaapi/vaapi_video_decoder_delegate.h:23:
../../third_party/libva_protected_content/va_protected_content.h:183:16: error: redefinition of '_VAEncryptionParameters'
typedef struct _VAEncryptionParameters {
               ^
/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include/va/va.h:2064:16: note: previous definition is here
typedef struct _VAEncryptionParameters {
               ^
3 errors generated.
^M[21096/44266] CXX obj/components/services/app_service/public/cpp/preferred_apps/preferred_apps_list.o^M[21097/44266] CXX obj/components/services/app_service/public/cpp/intents/intent_util.o^M[21098/44266] CXX obj/components/services/app_service/public/cpp/icon_loader/icon_cache.o^M[21099/44266] CXX obj/components/services/app_service/public/cpp/icon_loader/icon_coalescer.o^M[21100/44266] CXX obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o
FAILED: obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o 
clang++ -MMD -MF obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o.d -DMEDIA_GPU_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-12-init-16296-g5e476061-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=375504 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DVK_USE_PLATFORM_XCB_KHR -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_USE_LIBGIFCODEC -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_USE_PLATFORM_XCB_KHR -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DVK_NO_PROTOTYPES -DUSE_VULKAN_XCB -I../.. -Igen -I../../third_party/libvpx/source/config -I../../third_party/libvpx/source/config/linux/x64 -I../../third_party/libvpx/source/libvpx -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -Igen/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../third_party/vulkan-deps/vulkan-headers/src/include -I../../third_party/libyuv/include -Igen/shim_headers/ffmpeg_shim -Igen/shim_headers/opus_shim -Igen/shim_headers/snappy_shim -I../../third_party/khronos -I../../gpu -Igen/third_party/dawn/src/include -I../../third_party/dawn/src/include -I../../third_party/libwebm/source -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/skia -I../../third_party/libgifcodec -I../../third_party/vulkan/include -I../../third_party/vulkan-deps/vulkan-headers/src/include -I../../third_party/mesa_headers -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include -I../../third_party/crashpad/crashpad -I../../third_party/crashpad/crashpad/compat/non_mac -I../../third_party/crashpad/crashpad/compat/linux -I../../third_party/crashpad/crashpad/compat/non_win -I../../third_party/ced/src -I../../third_party/libvpx/source/libvpx -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers -m64 -march=x86-64 -msse3 -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/ignores.txt -fsanitize=cfi-icall -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -I/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include -Wno-conversion -Wno-parentheses-equality -Wno-unused-function -I/nix/store/vmz5z5gr7r09ay7pn2a8p5yl4yih0x4y-glib-2.66.8-dev/include -I/nix/store/vmz5z5gr7r09ay7pn2a8p5yl4yih0x4y-glib-2.66.8-dev/include/glib-2.0 -I/nix/store/ap4d6cqfhakl2dp6081z2c6bsdcinsha-glib-2.66.8/lib/glib-2.0/include -DPROTOBUF_ALLOW_DEPRECATED=1 -Wno-shorten-64-to-32 -I/nix/store/n2msf8y6pnvy2kzxiygy7y62i4bjidb6-libdrm-2.4.104-dev/include -I/nix/store/n2msf8y6pnvy2kzxiygy7y62i4bjidb6-libdrm-2.4.104-dev/include/libdrm -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../media/gpu/vaapi/vaapi_video_decode_accelerator.cc -o obj/media/gpu/vaapi/vaapi/vaapi_video_decode_accelerator.o
In file included from ../../media/gpu/vaapi/vaapi_video_decode_accelerator.cc:39:
In file included from ../../media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h:12:
In file included from ../../media/gpu/vaapi/vaapi_video_decoder_delegate.h:23:
../../third_party/libva_protected_content/va_protected_content.h:136:14: error: redefinition of '_VA_TEE_EXEC_FUNCTION_ID'
typedef enum _VA_TEE_EXEC_FUNCTION_ID {
             ^
/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include/va/va_prot.h:405:14: note: previous definition is here
typedef enum _VA_TEE_EXEC_FUNCTION_ID {
             ^
In file included from ../../media/gpu/vaapi/vaapi_video_decode_accelerator.cc:39:
In file included from ../../media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h:12:
In file included from ../../media/gpu/vaapi/vaapi_video_decoder_delegate.h:23:
../../third_party/libva_protected_content/va_protected_content.h:163:16: error: redefinition of '_VAEncryptionSegmentInfo'
typedef struct _VAEncryptionSegmentInfo {
               ^
/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include/va/va.h:2044:16: note: previous definition is here
typedef struct _VAEncryptionSegmentInfo {
               ^
In file included from ../../media/gpu/vaapi/vaapi_video_decode_accelerator.cc:39:
In file included from ../../media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h:12:
In file included from ../../media/gpu/vaapi/vaapi_video_decoder_delegate.h:23:
../../third_party/libva_protected_content/va_protected_content.h:183:16: error: redefinition of '_VAEncryptionParameters'
typedef struct _VAEncryptionParameters {
               ^
/nix/store/gajw8rnjaqmjjx2ik6lyhlwlmdp3pjcb-libva-2.11.0-dev/include/va/va.h:2064:16: note: previous definition is here
typedef struct _VAEncryptionParameters {
               ^
3 errors generated.
^M[21101/44266] CXX obj/media/gpu/vaapi/vaapi/vaapi_video_encode_accelerator.o
ninja: build stopped: subcommand failed.
(END)

possibly caused by https://github.com/NixOS/nixpkgs/commit/780fa5556a686076196e66aea0df62be0254f44d, which did land in master via https://github.com/NixOS/nixpkgs/pull/118312. Not caused by https://github.com/NixOS/nixpkgs/pull/118133.

Expected behavior Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: chromium
# a list of nixos modules affected by the problem
module:
primeos commented 3 years ago

Thanks for the report! Yes, https://github.com/NixOS/nixpkgs/commit/780fa5556a686076196e66aea0df62be0254f44d should've caused this as libva 2.11.0 added the "LibVA Protected Content API" (DRM :o). Not sure how this slipped through staging-next (don't we have the tested jobset there as well?).

Anyway, I see the following options:

primeos commented 3 years ago

I've opened #119003 to hopefully fix the build. I've also looked into overriding libva but that turned out to be pretty complex/dirty and likely cannot safe us from a Chromium rebuild so the patch is probably the better option.

flokli commented 3 years ago

I think using the patch from archlinux, or using a downgraded version only defined in the chromium derivation for now, and dropping this once M90 is released both work.

We shouldn't keep chromium broken for people building master.