r/Gentoo • u/manfromredstar • 2d ago
Discussion I've always used binary Firefox, and finally decided to build from source
Do you think it will be possible to build it? And is it worth it?
(I have 16 GB RAM and 39 GB swap on NVMe)
9
u/ThatGingerGuy98- 2d ago
I've compiled Firefox (well, Librewolf) from source with 4 gigs of ram & 4 gigs of swap. It took me about a day to update lol.
5
3
u/thomas-rousseau 2d ago
I often get annoyed at the two hours it takes me, and that's with PORTAGE_TMPDIR on bountiful zram running at -j8. I'm primarily using Zen and Helium as AppImages and am strongly contemplating removing Firefox from my world set.
1
u/manfromredstar 2d ago
That's brutal XD
3
u/ThatGingerGuy98- 2d ago
It was. I ended up moving away from Gentoo temporarily just because I didn't want it on my big gaming laptop, nor do I have a powerful enough daily driver.
6
u/WaterFoxforlife 2d ago
Even if you build with PGO the official binaries tend to be faster so no, it's usually not worth it
11
u/rem_34 2d ago edited 2d ago
both xorg and wayland?
p.s. why are you worrying over firefox? it's not webkit
7
u/HyperFurious 2d ago
In desktop profiles, i think that both xorg and wayland are enabled by default.
2
4
u/ysychov 2d ago
lol i do think if you ask it, it definitely not worth for you. I can only imagine that worth it if you A you want to apply some freaking patch that is no way applied from a maintainer of the shit, B you need some experimental flag for the same reason as previous. Just to compile 2 days on shitty hardware to get exact same build is a complete nonsense to me, dear sir!
4
8
u/m0lest 2d ago
I always used firefox from source. But for some reason turnstile started flagging my source-build firefox as bot :-( So I was forced more or less to use firefox-bin...
2
u/BeginningEcho4983 2d ago
More info? I am curious... Of turnstile running on gentoo
8
u/m0lest 2d ago
The cloudflare turnstile thingy always thought I'm a bot. You can check it here: https://browser-compat.turnstile.workers.dev/
I could rarely use any sites which use turnstile. It started around 2-3 month ago. I first thought it was my IP or something (I have a static IP). Then I tried a different browser (chrome) and turnstile worked fine. Then I thought it's a firefox thing. After 1-2 month annoyance I took another attempt at solving it. I then installed firefox-bin and all problems were gone. I never got flagged as bot again.
4
u/BeginningEcho4983 2d ago
Oh! THAT turnstile! I first remembered a logind replacement "turnstile" from chimera and was wondering what it has to do with bots
3
u/granadesnhorseshoes 2d ago
TIL, Cloudflare intentionally bans arbitrary UA strings. It's about the only thing that could (and probably is, vis a vis some 'src' tag appended at build time) different between the 2 builds.
If you care enough, change the UA string on a source build to mimic -bin and see what happens.
2
u/m0lest 2d ago edited 2d ago
I have ofc also tried user-agent. This was really multiple weeks of testing all kinds of stuff. I even still have the source-build firefox installed and I can still reproduce it everytime. When changing the user-agent turnstile didn't even complete the basic tests. If default UA it at least said that my configuration is fine but still it failed with Error: 600010 (Unknown).
The only solution (at least for me) was to install firefox-bin.
Edit: I just have checked both versions user-agents. And they are the same just that the source build is a bit older. But there is no way to see which one is custom build and which one is binary by the user-agent alone.
2
3
u/ruby_R53 2d ago
what do you mean "possible", you're on Gentoo
i too have 16 gigs of RAM but 8 gigs of swap already does it for me, but this depends on how many threads you're using to compile stuff (16/16 here for example)
3
u/s1ltarini 2d ago
I compiled it with i5 6500 and 4 ram it took 4 days not joking
1
3
u/hangint3n 1d ago
I've been compiling everything on various hardware since 2002. I've never used a bin files unless there was no other option. 😀
4
u/redyos_s 2d ago
39 GB of swap for one Firefox build is a lot. Lower the build parallelism first — heavy swapping just turns a RAM limit into slow storage I/O.
4
u/Disastrous-Brother81 2d ago
No prob. I've compiled Firefox on Raspberry Pi 4. You can try enabling PGO (which will roughly double the build time) and jumbo-build (which is supposed to combine smaller source files into bigger ones thus reducing the number of compiler calls). I normally compile it with clang (there's flag for that) as the upstream compiles and tests it with clang.
2
u/manfromredstar 2d ago
Great, after 2.5 hours the package compilation failed XD
It looks like gcc-16.2 has problems building Firefox
2
u/HyperFurious 2d ago
I remember the days when you could compile Firefox on an AMD Duron 700 in 2005...
2
u/Techwolf_Lupindo 2d ago
I use Librewolf. They maintain there own overlay to make installing and upgrades easy for us. There are checks in the ebuild to make sure you have enough RAM and storage space before doing the build.
2
u/fllthdcrb 2d ago
I have 16 GB RAM
Do you think it will be possible to build it?
Absolutely. I administer a system with that much RAM, and build Firefox regularly on it. It's definitely not quick, just because of how massive the code is. But it's doable—even with PGO—if you're willing to do it on storage, instead of RAM. (I build nearly everything else in RAM. But Firefox exceeds that capacity.)
1
u/Quiet-Dot-4187 1d ago
It's doable, but it will take a while, as I think that this kind of tasks depend heavily on your CPU and your availab space.
I think that the web browsers are mostly the reason why gentoo has binaries now, but your system your rules.
If you think that the gains are worth your time, you're doing the right thing. But even if you do it just for the sake of it,it's your system.
1
u/AliveRegion466 18h ago
Binary is open-source. You can freely modify it, it just won't be comfortable. That's like using linux instead of windows
-4
u/manfromredstar 2d ago
Damn chatgpt misled me XD
Before emerging, I asked him if it was necessary to enable the WebAssembly target for LLVM, chatgpt said “no, no, these are not related things”; it turned out that it was still necessary :)
Well, I'm rebuilding LLVM...
23
u/krumpfwylg 2d ago
I took the opposite direction. For years, I was compiling FF, but ~2 years ago, I switched to firefox-bin.
Why ? Gain of time mostly. Plus the firefox-bin ebuild pulls the binary produced by Mozilla, which comes with O3 LTO & PGO. All of those settings are achievable at home with USE flags, but pgo will double compilation time.
Also, compiling firefox sometimes requires to unmask LLVM/Clang, or to keep a previous version installed, depending if you're using firefox rapid or esr branch.
You can check build configuration using this url
about:buildconfig