Failing to build librewolf unstable package

I’m trying to install the librewolf unstable package, which seems to attempt to build librewolf 129.0.1-1 but the builder of it seems to fail (more specifically, the builder of the librewolf-unwrapped package which I think needs to be built for the wrapped package) for me and I’m not exactly sure why?
Attached below is the log:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/yvfbccqmlyz22aygk7pg6s83lpx5nx4n-firefox-129.0.1.source.tar.xz
source root is firefox-129.0.1
setting SOURCE_DATE_EPOCH to timestamp 1723466949 of file firefox-129.0.1/sourcestamp.txt
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
applying patch /nix/store/9lx1746yy56pn3dpc35l1xr6l3lykbin-env_var_for_system_dir-ff111.patch
patching file toolkit/xre/nsXREDirProvider.cpp
Hunk #2 succeeded at 313 (offset 3 lines).
applying patch /nix/store/6wsdh6246xbmlv3jr5q7qpl9ay3acq04-no-buildconfig-ffx121.patch
patching file docshell/base/nsAboutRedirector.cpp
patching file toolkit/content/jar.mn
Hunk #1 succeeded at 44 (offset 3 lines).
applying patch /nix/store/14gmmaq28hb5892lvwap2yblww7afgpz-cbindgen-0.27.0-compat.patch
patching file servo/components/style_traits/values.rs
Hunk #1 succeeded at 383 (offset -1 lines).
Hunk #2 succeeded at 408 (offset -1 lines).
patching file servo/ports/geckolib/cbindgen.toml
Hunk #1 succeeded at 355 (offset -2 lines).
applying patch /nix/store/idkwbyzx5hv6cjbmq6aplxpkxyji0n4x-mozbz-1898476-1.patch
patching file widget/gtk/MozContainerWayland.cpp
patching file widget/gtk/MozContainerWayland.h
patching file widget/gtk/moz.build
patching file widget/gtk/MozContainerSurfaceLock.cpp
patching file widget/gtk/MozContainerSurfaceLock.h
applying patch /nix/store/n6drjva08mkxwrx0ikz9xkzby4zsfail-mozbz-1898476-2.patch
patching file widget/gtk/GtkCompositorWidget.cpp
patching file widget/gtk/GtkCompositorWidget.h
patching file widget/gtk/nsWindow.cpp
patching file widget/gtk/nsWindow.h
applying patch /nix/store/7f249yx91fri3wb2nwgy1k8l8ms4sqm9-mozbz-1898476-3.patch
patching file gfx/webrender_bindings/RenderCompositorEGL.cpp
patching script interpreter paths in mach build
mach: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/04gg5w1s662l329a8kh9xcwyp0k64v5a-py>
build/unix/build-gcc/build-gcc.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/4bj2kxdm1462fzcc2>
build/unix/build-binutils/build-binutils.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/4bj2kxd>
build/unix/print-non-newline.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/4bj2kxdm1462fzcc2i2s4>
build/unix/build-hfsplus/build-hfsplus.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/4bj2kxdm1>
build/cargo-linker: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/04gg5w1s662l329a8kh9x>
build/cargo-host-linker: interpreter directive changed from "#!/bin/sh" to "/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2an>
build/qemu-wrap: interpreter directive changed from "#!/bin/bash" to "/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-ba>
build/clang-plugin/import_mozilla_checks.py: interpreter directive changed from "#!/usr/bin/python3" to "/nix/store/>
build/build-clang/build-clang.py: interpreter directive changed from "#!/usr/bin/python3" to "/nix/store/04gg5w1s662>
build/vs/generate_yaml.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/04gg5w1s662l32>
build/macosx/xcrun: interpreter directive changed from "#!/bin/sh" to "/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-b>
build/pgo/profileserver.py: interpreter directive changed from "#!/usr/bin/python" to "/nix/store/04gg5w1s662l329a8k>
build/checksums.py: interpreter directive changed from "#!/usr/bin/python" to "/nix/store/04gg5w1s662l329a8kh9xcwyp0>
build/autoconf/install-sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2>
build/autoconf/config.sub: interpreter directive changed from "#! /bin/sh" to "/nix/store/4bj2kxdm1462fzcc2i2s4dn33g>
build/autoconf/config.guess: interpreter directive changed from "#! /bin/sh" to "/nix/store/4bj2kxdm1462fzcc2i2s4dn3>
build/package/mac_osx/make-diskimage: interpreter directive changed from "#!/bin/sh" to "/nix/store/4bj2kxdm1462fzcc>
build/package/mac_osx/unpack-diskimage: interpreter directive changed from "#!/bin/bash" to "/nix/store/4bj2kxdm1462>
applying LibreWolf patch: patches/allow-JXL-in-non-nightly-browser.patch
patching file toolkit/moz.configure
Hunk #1 succeeded at 905 (offset 202 lines).
applying LibreWolf patch: patches/allow-ubo-private-mode.patch
patching file toolkit/components/extensions/Extension.sys.mjs
Hunk #1 succeeded at 3717 (offset 431 lines).
applying LibreWolf patch: patches/bootstrap.patch
patching file python/mozversioncontrol/mozversioncontrol/__init__.py
Hunk #1 succeeded at 1137 (offset 118 lines).
applying LibreWolf patch: patches/context-menu.patch
patching file browser/base/content/browser-context.inc
...skipping...
Hunk #2 succeeded at 206 (offset 2 lines).
Hunk #3 succeeded at 267 (offset 11 lines).
Hunk #4 succeeded at 438 (offset 11 lines).
Hunk #5 succeeded at 447 (offset 11 lines).
Hunk #6 succeeded at 500 (offset 11 lines).
Hunk #7 succeeded at 516 (offset 11 lines).
patching file services/settings/RemoteSettingsClient.sys.mjs
Hunk #4 succeeded at 610 (offset 1 line).
patching file toolkit/components/translations/actors/TranslationsParent.sys.mjs
Hunk #1 succeeded at 1217 (offset 183 lines).
Hunk #2 succeeded at 1605 (offset 183 lines).
Hunk #3 succeeded at 1685 (offset 209 lines).
Hunk #4 succeeded at 1711 (offset 209 lines).
Hunk #5 succeeded at 2006 (offset 337 lines).
applying LibreWolf patch: patches/hide-passwordmgr.patch
patching file browser/base/content/browser-init.js
patching file browser/components/preferences/privacy.js
Hunk #1 succeeded at 1274 (offset 60 lines).
applying LibreWolf patch: patches/librewolf-prefs.patch
patching file browser/app/profile/firefox.js
applying LibreWolf patch: patches/mozilla_dirs.patch
patching file toolkit/xre/nsXREDirProvider.cpp
Hunk #1 succeeded at 301 with fuzz 1 (offset 1 line).
Hunk #2 succeeded at 383 (offset 12 lines).
Hunk #3 succeeded at 415 (offset 4 lines).
Hunk #4 succeeded at 1134 (offset 20 lines).
Hunk #5 succeeded at 1400 (offset 37 lines).
Hunk #6 succeeded at 1410 (offset 37 lines).
applying LibreWolf patch: patches/msix.patch
patching file browser/installer/windows/msix/AppxManifest.xml.in
Hunk #1 succeeded at 30 (offset 1 line).
Hunk #2 succeeded at 120 (offset 11 lines).
patching file python/mozbuild/mozbuild/mach_commands.py
Hunk #1 succeeded at 2620 (offset 109 lines).
Hunk #2 succeeded at 2779 (offset 131 lines).
patching file python/mozbuild/mozbuild/repackaging/msix.py
Hunk #2 succeeded at 354 (offset -1 lines).
Hunk #3 succeeded at 480 (offset -29 lines).
applying LibreWolf patch: patches/nvidia-wayland-backported-fixes-0001-Bug-1898476-Wayland-Move-MozContainerSurfaceL>
The next patch would create the file widget/gtk/MozContainerSurfaceLock.cpp,
which already exists!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored
The next patch would create the file widget/gtk/MozContainerSurfaceLock.h,
which already exists!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored
patching file widget/gtk/MozContainerWayland.cpp
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file widget/gtk/MozContainerWayland.cpp.rej
patching file widget/gtk/MozContainerWayland.h
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file widget/gtk/MozContainerWayland.h.rej
patching file widget/gtk/moz.build
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file widget/gtk/moz.build.rej

I’m not sure if this would be related at all, but before I updated the flake for the packages, librewolf 128.something seemed to build correctly but would segfault before being able to launch the gui unless I started it in safe mode which in that case it would work fine.

There is also a possibility this is a completely unrelated to nixos issue, but I figured I should ask here in case it is.

A fix was merged a couple of days ago librewolf-unwrapped: use nvidia explicit sync vendored patches by ryand56 · Pull Request #336304 · NixOS/nixpkgs · GitHub. You can track it here Nixpkgs-tracker. You either wait for it to reach nixos-unstable, or temporarily get it from nixos-unstable-small.

Thanks, that seems to help a bit, however I’m still finding the new build failing at a later stage. The end of the logs goes as follows,

/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_xslt_xpath0.o -c  -I>
make[3]: *** [/build/firefox-129.0.1/config/makefiles/rust.mk:498: force-cargo-library-build] Error 101
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/toolkit/library/rust'
make[2]: *** [/build/firefox-129.0.1/config/recurse.mk:72: toolkit/library/rust/target-objects] Error 2
make[2]: *** Waiting for unfinished jobs....
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_xslt_xpath1.o -c  -I>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/webbrowserpersist'
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_xslt_xpath2.o -c  -I>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/webauthn'
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_svg7.o -c  -I/build/>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/workers/sharedworkers'
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_svg8.o -c  -I/build/>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/storage'
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_workers1.o -c  -I/bu>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/xslt/base'
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_remoteworkers1.o -c  -I/>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/xslt/xml'
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_serviceworkers2.o -c>
/nix/store/mr1y1rxkx59dr2bci2akmw2zkbbpmc15-clang-wrapper-18.1.8/bin/clang++ -o Unified_cpp_dom_serviceworkers3.o -c>
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/worklet'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/xml'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/xslt/xpath'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/xhr'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/svg'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/workers/remoteworkers'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/serviceworkers'
make[3]: Leaving directory '/build/firefox-129.0.1/objdir/dom/workers'
make[2]: Leaving directory '/build/firefox-129.0.1/objdir'
make[1]: *** [/build/firefox-129.0.1/config/recurse.mk:34: compile] Error 2
make[1]: Leaving directory '/build/firefox-129.0.1/objdir'
make: *** [/build/firefox-129.0.1/config/rules.mk:359: default] Error 2 

I am encountering oom issues during the rust build step which does kill some processes being used for it, but I’m not sure if it is that or something else that’s going wrong now.

It takes a lot of memory to build a browser like Firefox locally. I would wait for the changes to be available in the cache once it hits nixos-unstable.

okay, that makes sense, thanks!

Where are you getting the package from? AFAIK nixos-unstable-small has cached packages.

Uh this was the input I put in my flake for it

nixpkgs-unstable-small.url = "github:nixos/nixpkgs/nixos-unstable-small";

Regardless, since it got merged to the regular unstable branch, that worked fine for me, and I was being silly when it came to the segfaults and they were just caused by me not calling the wrapped version, but if nixos-unstable-small does have cached packages and I included it wrong, that would be good information to know for the future.