NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.4k stars 14.35k forks source link

Chromium maintenance #213862

Open primeos opened 1 year ago

primeos commented 1 year ago

Just an experiment / meta issue to track Chromium build failures, for coordination, etc (it'll be a bit noisy).

Chromium-specific documentation: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/chromium/README.md

cc https://github.com/NixOS/nixpkgs/issues/197609

primeos commented 1 year ago

The M110 (chromiumBeta) patch phase currently fails with the following error (easy to fix, we just need to adapt the build expressions to some upstream changes):

patchPhase completed in 40 seconds
configuring
WARNING at the command-line "--args":1:605: Build argument has no effect.
blink_symbol_level=0 chrome_pgo_phase=0 clang_base_path="/nix/store/fbgm8dzw6v3z2yv7p4zmiv7n0cx5y1dc-clang-wrapper-14.0.6" clang_use_chrome_plugins=false custom_toolchain="//build/toolchain/linux/unbundle:default" disable_fieldtrial_testing_config=true enable_hangout_services_extension=true enable_nacl=false enable_widevine=true ffmpeg_branding="Chrome" google_api_key="AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI" host_toolchain="//build/toolchain/linux/unbundle:default" is_official_build=true link_pulseaudio=true proprietary_codecs=true rtc_use_pipewire=true symbol_level=0 system_wayland_scanner_path="/nix/store/z9hm1agx9r7hjzlz6grfb57l4rr2ns81-wayland-1.21.0-bin/bin/wayland-scanner" treat_warnings_as_errors=false use_cups=true use_gio=true use_gnome_keyring=false use_pulseaudio=true use_qt=false use_sysroot=false use_system_libwayland=true
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^-----------------------------------------------------------------------------------
The variable "system_wayland_scanner_path" was set as a build argument
but never appeared in a declare_args() block in any buildfile.

To view all possible args, run "gn args --list <out_dir>"

The build continued as if that argument was unspecified.

Done. Made 18355 targets from 3147 files in 8059ms
WARNING
Found gn WARNING, exiting nix build
error: builder for '/nix/store/xl8bbllmpx7scha2njwspy8kzhrhvnn5-chromium-unwrapped-110.0.5481.52.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/ymy0mfggwbwbwii1k2djpxdj8kr370xz-chromium-beta-110.0.5481.52.drv' failed to build
primeos commented 1 year ago

TODOs for M110:

primeos commented 1 year ago

Next issue (expected / we already got this in the past when building with the bundled wayland):

building
ninja: Entering directory `out/Release'
[1950/1950] LINK ./mksnapshot.stampmksnapshot.stamptamp.stamporm_v8.oK[K[K)fault)
ninja: Entering directory `out/Release'
[3/3] LINK ./chrome_sandboxome_sandbox/sandbox.o_linux.o
ninja: Entering directory `out/Release'
[9956/52365] CC obj/third_party/fontconfig/fontconfig/fcxml.ooKK.oin/linux/unbundle:default)bundle:default)linux/unbundle:default)ault)lt)Kle:default)efault)[Kult)undle:default)imization_guide_internals.mojom-webui.js
../../third_party/fontconfig/src/src/fcxml.c:3609:6: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
            strerror_r (errno_, ebuf, BUFSIZ);
            ^~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[17177/52365] CXX obj/third_party/dawn/src/dawn/native/sources/ShaderModule.o[K[K.o[K.otrinary-minmax.stampoolchain/linux/unbundle:default)default)ault)
../../third_party/dawn/src/dawn/native/ShaderModule.cpp:532:21: warning: unused variable 'id2Scalar' [-Wunused-variable]
        const auto& id2Scalar = inspector->GetOverrideDefaultValues();
                    ^
1 warning generated.
[18132/52365] SOLINK ./libvk_swiftshader.sor/src/WSI/WSI.stampfaceKHR.otiopus/audio_encoder_multi_channel_opus.oautogen.ootocol.odle:default)
FAILED: libvk_swiftshader.so libvk_swiftshader.so.TOC
python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm"  --sofile="./libvk_swiftshader.so" --tocfile="./libvk_swiftshader.so.TOC" --output="./libvk_swiftshader.so" -- clang++ -shared -Wl,-soname="libvk_swiftshader.so" -Wl,-Bsymbolic -Wl,--version-script=../../third_party/swiftshader/src/Vulkan/vk_swiftshader.lds -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=30 -fwhole-program-vtables -Wl,--undefined-version -Wl,--no-call-graph-profile-sort -m64 -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,--lto-O0 -fsanitize=cfi-vcall -fsanitize=cfi-icall -o "./libvk_swiftshader.so" @"./libvk_swiftshader.so.rsp"
ld.lld: error: unable to find library -l:libffi_pic.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[18135/52365] CXX obj/third_party/webrtc/api/crypto/options/crypto_options.oltiopus/audio_encoder_multi_channel_opus.o
ninja: build stopped: subcommand failed.
error: builder for '/nix/store/5rccszwvkdxvxc63ry8xba8wn6ambh1p-chromium-unwrapped-110.0.5481.52.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/innzdg1hhqaxjakialpbsdxmmya1ha3h-chromium-beta-110.0.5481.52.drv' failed to build
CyborgPotato commented 1 year ago

Have been trying to get it to work on a local build, and it seems the flag that would be necessary/an easy solution would be to make use of systemffi, as was added in this commit (v107):

https://github.com/chromium/chromium/commit/cf3ee09f082513e48f1212dcebd1e5c7a38ca73f

primeos commented 1 year ago

@DavidCromp yes, thanks :) We already discovered this issue and possible solutions in the past but I decided to stick with using Wayland from Nixpkgs back then. I already fixed it locally but forgot / didn't get around to submit the change.

primeos commented 1 year ago

The build and VM test both pass now :)

/nix/store/wk63f6dl3f4v920smlawj5fw9p6mx9qr-chromium-beta-110.0.5481.52
/nix/store/33f1i1pvha1dmhrsy9bvw65dlsdvg51q-vm-test-run-chromium-beta

I also just start a build of M111 / chromeDev to see if there's more work left (which would be a good challenge for new/additional maintainers as there's enough time to fix those issues - unlike M110 which will be released tomorrow).

primeos commented 1 year ago

chromiumDev (113.0.5638) is broken again:

[43269/53220] CXX obj/third_party/blink/renderer/core/core/ng_grid_layout_algorithm.o.oor.o[KKrator.oontext.ocreencanvasrenderingcontext2d_webgl2renderingcontext_webglrenderingcontext.otsi.tsts
FAILED: obj/third_party/blink/renderer/core/core/ng_grid_layout_algorithm.o
clang++ -MMD -MF obj/third_party/blink/renderer/core/core/ng_grid_layout_algorithm.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=e136ec5032a5e5d97e988ce66e8c269a80ff54c4 -D_LIBCPP_ENABLE_ASSERTIONS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBLINK_CORE_IMPLEMENTATION=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -DLIBYUV_DISABLE_NEON -DUSE_EGL -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_WAYLAND_KHR -DBLINK_IMPLEMENTATION=1 -DINSIDE_BLINK -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 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DGOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE=0 -DHAVE_PTHREAD -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DWEBRTC_USE_X11 -DWEBRTC_USE_PIPEWIRE -DWEBRTC_USE_GIO -DLOGGING_INSIDE_WEBRTC -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_ENABLE_SKSL -DSK_UNTIL_CRBUG_1187654_IS_FIXED -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_WIN_FONTMGR_NO_SIMULATIONS -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_HAS_WUFFS_LIBRARY -DSK_VULKAN=1 -DSK_GANESH -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DV8_COMPRESS_POINTERS -DV8_COMPRESS_POINTERS_IN_SHARED_CAGE -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_ENABLE_SANDBOX -DV8_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DCPPGC_POINTER_COMPRESSION -DCPPGC_SLIM_WRITE_BARRIER -DLEVELDB_PLATFORM_CHROMIUM=1 -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DWTF_USE_WEBAUDIO_PFFFT=1 -DUSE_INNER_HTML_PARSER_FAST_PATH=1 -DUSE_SYSTEM_LIBJPEG -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../third_party/libyuv/include -I../../third_party/jsoncpp/source/include -Igen/shim_headers/libpng_shim -Igen/shim_headers/libwebp_shim -I../../third_party/vulkan-deps/vulkan-headers/src/include -I../../third_party/wayland/src/src -I../../third_party/wayland/include/src -Igen/third_party/dawn/include -I../../third_party/dawn/include -I../../third_party/khronos -I../../gpu -Igen/shim_headers/flac_shim -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/ipcz/include -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../net/third_party/quiche/overrides -I../../net/third_party/quiche/src/quiche/common/platform/default -I../../net/third_party/quiche/src -Igen/net/third_party/quiche/src -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/skia -I../../third_party/wuffs/src/release/c -I../../third_party/vulkan/include -I../../v8/include -Igen/v8/include -I../../third_party/libwebm/source -I../../third_party/mesa_headers -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/linux -I../../third_party/crashpad/crashpad/compat/non_win -I../../third_party/zlib -I../../third_party/libaom/source/libaom -I../../third_party/iccjpeg -I../../third_party/ots/src/include -I../../third_party/libxml/src/include -I../../third_party/libxml/linux/include -I../../third_party/snappy/src -I../../third_party/snappy/linux -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-ignored-pragma-optimize -Wno-deprecated-builtins -Wno-bitfield-constant-conversion -Wno-deprecated-this-capture -Wshadow -fno-delete-null-pointer-checks -fno-ident -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 -ffp-contract=off -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers -m64 -msse3 -ffile-compilation-dir=. -no-canonical-prefixes -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -fsanitize=cfi-vcall -fsanitize-ignorelist=../../tools/cfi/ignores.txt -fsanitize=cfi-icall -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -g0 -I/nix/store/152gsygyjagsirvdg3icmz4px39wddwj-glib-2.74.5-dev/include -I/nix/store/152gsygyjagsirvdg3icmz4px39wddwj-glib-2.74.5-dev/include/glib-2.0 -I/nix/store/rcwsvm3zmcpwl71b7r5f9ql599hw6f2b-glib-2.74.5/lib/glib-2.0/include -Wno-redundant-parens -Wconversion -Wno-float-conversion -Wno-sign-conversion -Wno-implicit-float-conversion -Wno-implicit-int-conversion -DPROTOBUF_ALLOW_DEPRECATED=1 -I/nix/store/5q9cn8i6qrl6fycmgj8jkzrqhkml1g8h-nspr-4.35-dev/include -I/nix/store/7nk5x7ds6wcp7vpfngd969ad9axk6pav-nss-3.79.4-dev/include/nss -Wno-redundant-parens -I/nix/store/kkdn8237y00qqwg2lqz43v25pbrkb2n3-libpng-1.6.39-dev/include/libpng16 -DLIBXML_STATIC= -I/nix/store/i57f5lhc83sfnck9d6rik0dbnbxr9qlw-libxslt-1.1.37-dev/include -I/nix/store/0z5wasald7dmipjpbx8kw31pj0kzjxpg-libxml2-2.10.3-dev/include/libxml2 -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc -o obj/third_party/blink/renderer/core/core/ng_grid_layout_algorithm.o
../../third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc:530:28: error: reference to local binding 'grid_items' declared in enclosing function 'blink::NGGridLayoutAlgorithm::BuildGridSizingSubtree'
    for (auto& grid_item : grid_items) {
                           ^
../../third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc:512:10: note: 'grid_items' declared here
  auto& [grid_items, layout_data, subtree_size] =
         ^
../../third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc:540:5: error: reference to local binding 'layout_data' declared in enclosing function 'blink::NGGridLayoutAlgorithm::BuildGridSizingSubtree'
    layout_data.SetTrackCollection(
    ^
../../third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc:512:22: note: 'layout_data' declared here
  auto& [grid_items, layout_data, subtree_size] =
                     ^
2 errors generated.
[43272/53220] CXX obj/third_party/blink/renderer/core/core/ng_grid_node.olver.oion.o
ninja: build stopped: subcommand failed.
error: builder for '/nix/store/1dfhn82935xg4ac6ds7fkfch5d8v18zi-chromium-unwrapped-113.0.5638.0.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/qqqlng8hf65vbdmss3hk34l0y35yvw1w-chromium-dev-113.0.5638.0.drv' failed to build

Maybe LLVM 15 is already too "old" to build M113 but I haven't looked into it yet.

lorenz commented 1 year ago

Compiler bug in LLVM <= 15. Requires LLVM 16 or higher (unreleased). See also https://github.com/llvm/llvm-project/issues/48582.

RaitoBezarius commented 1 year ago

Compiler bug in LLVM <= 15. Requires LLVM 16 or higher (unreleased). See also llvm/llvm-project#48582.

Nice. I have started a llvm16 branch (https://github.com/nixos/nixpkgs/tree/llvm16) that's still very wipy. I opened https://github.com/llvm/llvm-project/issues/61350 because I am not able to solve this failing test.

RaitoBezarius commented 1 year ago

@primeos FWIW, https://github.com/NixOS/nixpkgs/pull/223282 has been opened. Hopefully, it should get us the fix for Chromium.

Hopefully as we land all the LLVM maintenance stuff, this should get us unstuck.

primeos commented 1 year ago

Thanks a lot @RaitoBezarius and @lorenz! :) It's great to have a PR for LLVM 16! :)

primeos commented 1 year ago

M114 seems to require libevdev as new dependency:

./ios/chrome/test/wpt/tools/run_clusterfuzz_test.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/zlf0f88vj30sc7567b80l52d19pbdmy2-bash-5.2-p15/bin/bash"
patchPhase completed in 35 seconds
configuring
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /tmp/nix-build-chromium-unwrapped-114.0.5696.0.drv-0/chromium-114.0.5696.0/out/Release/
Command: python3 /tmp/nix-build-chromium-unwrapped-114.0.5696.0.drv-0/chromium-114.0.5696.0/build/config/linux/pkg-config.py libevdev
Returned 1.
stderr:

Package libevdev was not found in the pkg-config search path.
Perhaps you should add the directory containing `libevdev.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libevdev' found
Could not run pkg-config.

See //remoting/host/BUILD.gn:232:3: whence it was called.
  pkg_config("libevdev") {
  ^-----------------------
See //BUILD.gn:890:7: which caused the file to be included.
      "//remoting/host:host",
      ^---------------------
note: keeping build directory '/tmp/nix-build-chromium-unwrapped-114.0.5696.0.drv-0'
error: builder for '/nix/store/zv07amm3y57h6ssczx3588bqfk8yjixd-chromium-unwrapped-114.0.5696.0.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/f3m6f3m596az3k0qcf793ahivlfkcz3b-chromium-dev-114.0.5696.0.drv' failed to build
RaitoBezarius commented 1 year ago

But we do have libevdev in nixpkgs, right?

primeos commented 1 year ago

Yes, that issue is luckily trivial to fix but I expected additional issues so I didn't commit the fix right away. But I've included it in https://github.com/NixOS/nixpkgs/pull/229995/commits/5267a346192e88f46e60798330869e9f0f714f6d now.

Anyway, unfortunately it's worse than I thought as it looks like the build scripts aren't compatible with LLVM 16 anymore and LLVM 17 definitely won't be out when M114 releases. I guess we'll have to patch the source code or rather build scripts (either by reverting the commit that introduced the problematic changes (preferred, if it's a dedicated commit) or by writing a custom patch.

I'm getting the following error now:

patchPhase completed in 34 seconds
configuring
Done. Made 17938 targets from 3224 files in 8763ms
building
ninja: Entering directory `out/Release'
[854/2934] LINK ./protocparty/perfetto/gn/protoc_lib.stampKk.osion_utils_portable.oorter_module.o.oK
FAILED: protoc
"python3" "../../build/toolchain/gcc_link_wrapper.py" --output="./protoc" -- clang++ -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=30 -Wl,-mllvm,-disable-auto-upgrade-debug-info -fwhole-program-vtables -Wl,--undefined-version -Wl,--no-call-graph-profile-sort -m64 -no-canonical-prefixes -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,--lto-O0 -fsanitize=cfi-vcall -fsanitize=cfi-icall -pie -Wl,--disable-new-dtags -o "./protoc" -Wl,--start-group @"./protoc.rsp"  -Wl,--end-group  -ldl -lpthread -lrt
ld.lld: error: -mllvm: ld.lld: Unknown command line argument '-disable-auto-upgrade-debug-info'.  Try: '/nix/store/bx494s1r30zwa7zdsyg72sjryy0k0pyg-llvm-binutils-16.0.1/bin/ld.lld --help'
ld.lld: Did you mean '--disable-auto-paired-vec-st'?
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[857/2934] CXX obj/v8/v8_bigint/div-burnikel.o
ninja: build stopped: subcommand failed.
note: keeping build directory '/tmp/nix-build-chromium-unwrapped-114.0.5735.16.drv-0'
error: builder for '/nix/store/krrwbfk0zkrf3jnfwabb5d35845prxga-chromium-unwrapped-114.0.5735.16.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/2y9spz2hyvymrdidlv1w7f4zjag2f0zv-chromium-beta-114.0.5735.16.drv' failed to build

Does someone have the time and motivation to investigate? Maybe there's already an upstream "bug" report with useful information/discussion or patches from other packagers.

lorenz commented 1 year ago

We don't care about this flag, I'd personally just revert https://chromium-review.googlesource.com/c/chromium/src/+/4470209, which should be fairly self-contained and maintainable.

But longer term I think we need to come to terms with the fact that Chromium pins their own LLVM toolchain which is close to master and does not guarantee compatibility with anything else (especially if it is older). Considering the amount of QA and other things they do to it it might make sense to just package their toolchain.

alyssais commented 1 year ago

I've sent a message to the distributions list to try to get a cross-distro perspective on this.

primeos commented 1 year ago

It seems like M115 introduces some initial Rust support (https://security.googleblog.com/2023/01/supporting-use-of-rust-in-chromium.html, https://bugs.chromium.org/p/chromium/issues/detail?id=1292038):

patchPhase completed in 34 seconds
configuring
ERROR at //build/config/rust.gni:126:24: Script returned non-zero exit code.
      rustc_revision = exec_script("//tools/rust/update_rust.py",
                       ^----------
Current dir: /tmp/nix-build-chromium-unwrapped-115.0.5790.13.drv-0/chromium-115.0.5790.13/out/Release/
Command: python3 /tmp/nix-build-chromium-unwrapped-115.0.5790.13.drv-0/chromium-115.0.5790.13/tools/rust/update_rust.py --print-package-version
Returned 1 and printed out:

The expected Rust version is 2a8221dbdfd180a2d56d4b0089f4f3952d8c2bcd-1-llvmorg-17-init-10134-g3da83fba-2 (or fallback 2a8221dbdfd180a2d56d4b0089f4f3952d8c2bcd-1-llvmorg-17-init-10134-g3da83fba-1 but the actual version is None
Did you run "gclient sync"?

See //BUILD.gn:17:1: whence it was imported.
import("//build/config/rust.gni")
^-------------------------------
error: builder for '/nix/store/bfw2ylczj124z0gckvkc28jnxaa55mgj-chromium-unwrapped-115.0.5790.13.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/1vnmnv1qalpkz71nflqnv6jk4ncz6i0h-chromium-beta-115.0.5790.13.drv' failed to build

This could be quite challenging for Nixpkgs - depending on how well Google handles it (since scripts like update_rust.py cannot make any network requests inside the Nix build sandbox (except for fixed-output derivations)).

Does someone have time and motivation to look into this?

@lorenz huge thanks for your analysis in https://github.com/NixOS/nixpkgs/issues/213862#issuecomment-1542927502 btw. I've credited you in https://github.com/primeos/nixpkgs/commit/16f87c4cdb1fe2388965cb5eb1f17e2d8192a0b9 - hope that's fine (I can also add you as co-author next time, if you want - alternatively you can of course also make a PR next time :wink:).

lorenz commented 1 year ago

I read the new GN specs and plumbed in the nixpkgs Rust compiler. From a look at Chromium's upstream packaging they do not use a patched Rust, so this should be fine (as fine as not using their bespoke LLVM is). Build is still running, but didn't fail during GN phase. I'll send a PR once it finished building.

lorenz commented 1 year ago

115 built successfully, I'll submit a patch this evening or tomorrow.

lorenz commented 1 year ago

https://github.com/NixOS/nixpkgs/pull/243319

yu-re-ka commented 12 months ago

I'm debugging the build of electron 28 / chromium 120.x currently. One of the patches no longer applies.

yu-re-ka commented 12 months ago

patch for building chromium 120 with llvm 16 is in #271677, please review (built a chromium 120 beta on x86_64-linux and electron 28 on aarch64-linux)