void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.51k stars 2.11k forks source link

firefox 69 fails build with some options disabled #14269

Closed svenper closed 3 years ago

svenper commented 5 years ago

System

Expected behavior

Firefox can either build without dbus, or does not have dbus optional.

Actual behavior

Firefox does not build without these template options. References to dbus::Error::empty, dbus::connection::Connection::get_private, dbus::connection::Connection::conn_from_ptr, dbus::watch::WatchList::new, etc. fail. Lots of lines of

/usr/bin/ld: DWARF error: mangled line number section (bad file number)

Building firefox on my machine is quite slow so I've yet to find exactly what build options cause the fail but it looks like dbus based on the log.

end of log

Steps to reproduce the behavior

./xbps-src pkg firefox -o alsa,~dbus,~pulseaudio,~sndio,~startup_notification,~wayland,~xscreensaver
Duncaen commented 5 years ago

--disable-dbus was removed. https://bugzilla.mozilla.org/show_bug.cgi?id=1561207

dylanaraps commented 4 years ago

--disable-dbus was removed.

This is false. --disable-dbus is still supported. The Firefox build system errors during configure if unsupported flags are used (it doesn't with --disable-dbus).

What happened in Firefox 69 was a regression, it's a bug that --disable-dbus still lets through a dbus related component.

I have written a patch for it here and Firefox builds fine without dbus afterwards: https://github.com/kisslinux/repo/blob/master/extra/firefox/patches/firefox-69-no-dbus.patch

svenper commented 4 years ago

@dylanaraps thanks for the info! I was able to apply your v72 patch to Void after stripping one path level. Was there anything in particular that caused you to downgrade to the ESR version?

Edit: my adaptation of that patch for later versions

firefox-73-no-dbus.patch firefox-74-no-dbus.patch

dylanaraps commented 4 years ago

Firefox (and Chromium) are hard to maintain and each year this issue gets worse and worse. Firefox started taking up a lot of my time as each release broke something.

Swapping to the ESR means a singe big (and breaking) release a year with minor security fixes throughout. Much easier to maintain and it allows me to dedicate more time elsewhere.

The ESR has also enabled me to ship a firefox-bin package to users which enables them to avoid building rust, nodejs, gtk2, python2 and Firefox every so often.

I also don't know what the future holds for Firefox and staying behind the main releases gives me some breathing room regarding dbus, alsa (still working), etc.

svenper commented 4 years ago

@dylanaraps did you ever encounter this error or have an idea what could cause it?

collect2: fatal error: ld terminated with signal 9 [Killed]

I'm trying to build Void's 76.0.1_1 with the only change being adding your latest patch. 75 worked

In context: ```text 53:46.55 widget/gtk/mozwayland/libmozwayland.so 53:46.70 tools/power/rapl 53:46.85 toolkit/components/telemetry/pingsender/pingsender 53:47.03 browser/app/firefox 53:47.66 media/ffvpx/libavcodec/libmozavcodec.so.symbols.stub 53:47.74 config/external/nspr/ds/libplds4.so 53:47.91 media/ffvpx/libavcodec/libmozavcodec.so 53:48.03 config/external/nspr/libc/libplc4.so 53:48.33 security/nss/lib/util/out.nssutil.def.stub 53:48.59 security/nss/lib/util/libnssutil3.so 53:48.69 security/nss/lib/freebl/out.freebl_hash_vector.def.stub 53:48.94 security/nss/lib/freebl/out.freebl_hash.def.stub 53:48.94 security/nss/lib/freebl/libfreeblpriv3.so 53:49.20 security/nss/lib/freebl/libfreebl3.so 53:49.44 security/nss/lib/ckfw/builtins/out.nssckbi.def.stub 53:49.49 security/nss/lib/softoken/out.softokn.def.stub 53:49.70 security/nss/lib/ckfw/builtins/libnssckbi.so 53:49.74 security/nss/lib/softoken/libsoftokn3.so 53:50.07 js/src/build/libjs_static.a 53:50.15 security/sandbox/linux/libmozsandbox.so 53:50.68 security/nss/lib/nss/out.nss.def.stub 53:50.93 security/nss/lib/nss/libnss3.so 53:51.81 security/nss/lib/smime/out.smime.def.stub 53:52.10 security/nss/lib/smime/libsmime3.so 53:52.58 security/nss/lib/ssl/out.ssl.def.stub 53:52.82 security/nss/lib/ssl/libssl3.so 53:53.77 media/gmp-clearkey/0.1/libclearkey.so 53:53.94 security/nss/cmd/shlibsign/shlibsign 53:54.30 security/nss/cmd/pk12util/pk12util 53:54.34 security/nss/cmd/modutil/modutil 53:54.65 security/nss/cmd/certutil/certutil 54:52.53 Finished release [optimized] target(s) in 52m 35s 54:53.70 toolkit/library/build/symverscript.stub 54:53.86 toolkit/library/build/libxul.so 58:22.85 collect2: fatal error: ld terminated with signal 9 [Killed] 58:22.85 compilation terminated. 58:22.85 make[4]: *** [/builddir/firefox-76.0.1/config/rules.mk:610: libxul.so] Error 1 58:22.85 make[4]: *** Deleting file 'libxul.so' 58:22.85 make[3]: *** [/builddir/firefox-76.0.1/config/recurse.mk:74: toolkit/library/build/target] Error 2 58:22.85 make[2]: *** [/builddir/firefox-76.0.1/config/recurse.mk:34: compile] Error 2 58:22.85 make[1]: *** [/builddir/firefox-76.0.1/config/rules.mk:394: default] Error 2 58:22.87 make: *** [client.mk:125: build] Error 2 58:22.89 0 compiler warnings present. 58:23.21 ccache (direct) hit rate: 90.3%; (preprocessed) hit rate: 1.0%; miss rate: 8.7% ```
dylanaraps commented 4 years ago

Interesting. I can't personally reproduce this at all. It builds fine here. Tried having a look at what build flags we use, etc?

Duncaen commented 4 years ago

checked dmesg for oom kill?

pullmoll commented 4 years ago

This is usually a sign of ENOMEM.

svenper commented 4 years ago

What exactly are we looking for?

sudo dmesg | grep -Ei 'memory|oom|mem\b' ```dmesg [21662.540805] IPDL Background invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0 [21662.540832] oom_kill_process.cold+0xb/0x10 [21662.540836] out_of_memory+0x1a1/0x440 [21662.540954] Mem-Info: mapped:4134 shmem:4208 pagetables:7889 bounce:0 [21662.540966] Node 0 active_anon:3227628kB inactive_anon:645436kB active_file:196kB inactive_file:224kB unevictable:16776kB isolated(anon):256kB isolated(file):0kB mapped:16536kB dirty:0kB writeback:8kB shmem:16832kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no [21662.541050] 0 pages HighMem/MovableOnly [21662.541053] Tasks state (memory values in pages): [21662.541054] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name [21662.541294] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=ld,pid=4869,uid=1000 [21662.541308] Out of memory: Killed process 4869 (ld) total-vm:11085876kB, anon-rss:3796320kB, file-rss:4kB, shmem-rss:0kB, UID:1000 pgtables:20292kB oom_score_adj:0 [21664.624082] oom_reaper: reaped process 4869 (ld), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB ```
Duncaen commented 4 years ago
[21662.541308] Out of memory: Killed process 4869 (ld) total-vm:11085876kB, anon-rss:3796320kB, file-rss:4kB, shmem-rss:0kB, UID:1000 pgtables:20292kB oom_score_adj:0

Yes was killed because your system did run out of memory.

svenper commented 4 years ago

After clearing some disk space I was able to build! Still confusing though, is that I have 8GB RAM plus 8GB swap. Am I reading the total-vm:11085876kB correctly that it killed at 11GB? I probably ran out of disk space but the swap file should be a fixed size anyway, so why this error, and not a disk space error?

(I was definitely not using 5GB of RAM for anything else, xbps-src was the only thing running except the desktop and the terminal, I even closed the browser)

$ free
              total        used        free      shared  buff/cache   available
Mem:        8122788      423424     6753304      283556      946060     7065116
Swap:       8323068        4444     8318624
ericonr commented 3 years ago

Is this issue still relevant?

svenper commented 3 years ago

not as of 81.0.1_1, I haven't built later ones yet however

ericonr commented 3 years ago

Feel free to reopen if you experience the issue again.

Thanks!