Progress on porting Firefox

Very good job !
Two problems for me:

I don’t manage to test webgl water test, maybe due to my old hardware (ATI H4550 RV710)

Thanks for all your staff !!

1 Like

I’ve tried to follow the instructions on the wiki to compile :

I’m OK until the ./mach boostrap and then with ./mach build I have the below : any idea what’s wrong ?

 0:00.70 W Clobber not needed.
 0:00.76 W Adding make options from /boot/home/Documents/C/gecko-dev/mozconfig
    MOZ_OBJDIR=/boot/home/Documents/C/gecko-dev/obj-ff-dbg
    OBJDIR=/boot/home/Documents/C/gecko-dev/obj-ff-dbg
    FOUND_MOZCONFIG=/boot/home/Documents/C/gecko-dev/mozconfig
    export FOUND_MOZCONFIG
 0:00.76 /bin/make -f client.mk -j4 -s
 0:01.53 Elapsed: 0.00s; From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:01.54 Elapsed: 0.00s; From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:01.72 Elapsed: 0.14s; From _tests: Kept 679 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:01.95 Elapsed: 0.51s; From dist/include: Kept 6561 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:02.24 Elapsed: 0.32s; From dist/bin: Kept 2908 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:02.49 ./ServoStyleConsts.h.stub
 0:02.95 thread 'main' panicked at /boot/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cbindgen-0.27.0/src/bindgen/config.rs:1125:34:
 0:02.95 called `Result::unwrap()` on an `Err` value: "Couldn't parse config file: TOML parse error at line 355, column 1\n    |\n355 | \"Keyframe\" = \"Keyframe\"\n    | ^\nduplicate key `Keyframe` in table `export.rename`\n."
 0:02.95 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 0:03.00 backend.mk:571: recipe for target 'layout/style/.deps/ServoStyleConsts.h.stub' failed
 0:03.00 make[3]: *** [layout/style/.deps/ServoStyleConsts.h.stub] Error 101
 0:03.00 make[3]: *** Waiting for unfinished jobs....
 0:03.18 /boot/home/Documents/C/gecko-dev/config/recurse.mk:32: recipe for target 'export' failed
 0:03.18 make[2]: *** [export] Error 2
 0:03.18 /boot/home/Documents/C/gecko-dev/config/rules.mk:361: recipe for target 'default' failed
 0:03.18 make[1]: *** [default] Error 2
 0:03.18 client.mk:59: recipe for target 'build' failed
 0:03.18 make: *** [build] Error 2
 0:03.20 W 0 compiler warnings present.
1 Like

Welcome to the gecko hacking land!

I didn’t see that error. It seems cbindgen failed to generate .toml file probably rust copmpiler use.

cbindgen is a rust binding generator for C(/limited C++) library. Mozilla’s build system has build phases including configure, export, compile, misc and so on. In export phase it generates source files from data or other type files. cbindgen failed to generate correct output here, but not catched.

I don’t know what failed in detail, but want to see clean generated files and regenerate it.

Run ./mach clobber which cleans build output, then ./mach build again.

See also:

1 Like

I just find an article for you.

https://firefox-source-docs.mozilla.org/browser/components/storybook/docs/README.xul-and-html.stories.html

2 Likes

Thank you for reporting. Registered issue for the former. The latter is known and some people pointed out.

2 Likes

OK I found the problem

cbindgen 0.27 was not compatible with our tree

to fix we can

  • Rebase our branch to esr128 latest
  • Or build cbindgen 0.26 specifically on your side as a workaround

Could you try the latter for now?

2 Likes

With cbindgen 0.26 indeed I dont’ have anymore the error. Compilation in progress.

Thanks :slight_smile:

2 Likes

I reach “wgpu_bindings” with the below error : any idea about the I/O failure ?
Maybe not enough remaining memory ? (90% of my 8 Gb are used)

13:28.13    Compiling fluent-langneg-ffi v0.1.0 (/boot/home/Documents/C/gecko-dev/intl/locale/rust/fluent-langneg-ffi)
13:31.27    Compiling wgpu_bindings v0.1.0 (/boot/home/Documents/C/gecko-dev/gfx/wgpu_bindings)
14:37.30 rustc-LLVM ERROR: IO failure on output stream: Permission denied
14:37.45 error: could not compile `tabs` (lib)
14:37.45 warning: build failed, waiting for other jobs to finish...
14:37.89 dom/abort
14:38.53 clang++: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]
15:34.91 dom/animation
15:35.65 clang++: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]

Meanwhile exploring SVG to HVIF icon for the upcoming Firefox :wink:

3 Likes

“Firefox” brand name and icon is probably not allowed to be used in HaikuPorts until Mozilla will have official Haiku support.

6 Likes

If log is correct, it fails with a permission error to output. When I start building, I sometimes experienced file system error with USB thumb drive.

What I concerned is which is your build directory a normal BFS partition on SSD/HDD, a VM image or some special partition or filesystem?

I successfully build on BFS partition of USB SSD of bare metal.

1 Like

Let’s hope Mozilla will give Haiku its blessing for using the Firefox brand.

It doesn’t really matter.
Using the Nightly brand,which I think is allowed without special agreement from Mozilla,won’t make it a different browser.
On the other hand,using a non-Firefox brand will give us a lot more freedom to finetune the settings and disable quite a few antifeatures by default.

7 Likes

16 Gb seem to be required as it’s now ok.
It’s a beast to compile :crazy_face:

I’ve used “./mach build”, what are the options to make the executable lighter ?

My version compiled :
3060336 oct. 21 05:23 firefox

Your version distributed :
358432 oct. 14 18:29 /boot/home/Desktop/firefox/firefox

And it’s exiting more often due to error :
Exiting due to channel error.

1 Like

You need to use haiku_mozconfig instead of haiku_mozconfig_dbg to get an optimized release build. Our build instruction specifies the former for development use.

You can change that by

  • rm mozconfig and ln -S haiku_mozconfig mozconfig
  • or export MOZCONFIG=path/to/haiku_mozconfig to override mozconfig specification

This is effectively changing following build settings

  • build output directory to one dedicated for release build
  • debug build to release optimized build

Such a big build config change results a full-build, so next ./mach build should take hours.


EDIT: you can make tgz package with ./mach package after build finished. What I uploaded was made with such steps.

You need revert this commit

I will push this to haiku128 branch later.

1 Like

Done in

1 Like

With the commit reverted indeed it’s more stable now :slight_smile: it tooks only a few minutes to recompile. (Versus more than 5 hours for the whole)

Thank you for the details of the mach build, I have now a working env for compiling gecko-dev : I think 8 Gb of memory is not enough, so maybe this can be indicated on the wiki to avoid this pitfall

3 Likes

I have a question as I’m new to the debugging land :

Why the Haiku Debugger tool is not displaying the source of the firexfox program even if it’s compiled with debug info ?

file /boot/home/Documents/C/gecko-dev/obj-ff-dbg/dist/bin/firefox

/boot/home/Documents/C/gecko-dev/obj-ff-dbg/dist/bin/firefox: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=2fd00db3ef61a3870fe8bbe568089e16aa74d066, with debug_info, not stripped

For a simple OpenGL program it’s working fine as per below :

But for firefox main program, the source is not displayed :

Short answer is, use GDB15 to debug firefox.

It is why I played with Haiku Native debugger. I was there last year:

There are two problem with Native Debugger:

  1. Latest debugging info(DWARF) support was missing
  2. Too large debugging info of libxul.so(Firefox’s core/body library)
    • Native Debugger doesn’t have scalability for this of magnitude.
    • it took minutes to load debugging info, exausts 16GB ram then I had. And every stepping execution a few minutes, simply not usable.

So I tackled try porting LLDB but it didn’t succeed then by lacking both of my skill and my spare time

In this year’s GSoC, a student @trungnt2910 worked on improving this situation

and he did! He ported latest GDB again and made it very stable enough to debug the firefox.

His blog series on this is great to read.

It can be used to debug C++/Rust mixed project. I’m using Qt Creator for GDB graphical frontend.

EDIT: I wrote GDB as GCC, I was sleeping in bed then.

4 Likes

This is my working debug configuration of Qt Creator

  1. Launch Qt Creator
  2. Open menu “Debug - Start Debugging - Start and Debug External Application…”
  3. Setting configuration like this
    • Local executable:
      • specify path to obj-ff-dbg/dist/bin/firefox
    • Command line arguments:
      • -no-remote -profile /boot/home/src/gecko-dev/obj-ff-dbg/tmp/profile-default
      • this is one which displayed when you ./mach run
    • Working directory:
      • I don’t believe this is important, but I use the source tree root as there is where ./mach run executed in

If you didn’t export WAYLAND_DISPLAY=:0 when you launch Qt Creator, you need Manage the Kit and specify that in Environment: field.

8 Likes