I am trying to recompile firefox 57 (the goal is to add a couple of patches) in Ubuntu 16.04.

I am performing the usual procedure:

sudo apt-get source firefox
sudo apt-get build-dep firefox
cd firefox-57.0.1+build2/
debuild -us -uc

On the build-dep stage I get the following error:

The following packages have unmet dependencies:
 builddeps:firefox : Depends: cargo (>= 0.20)
                     Depends: rustc (>= 1.19.0)
E: Unable to correct problems, you have held broken packages.

I have all standard repositories for xenial (including universe, multivers), and there are no such packages. The latest rustc has version 1.17.

I tried:

  1. Installing fresh rustc & cargo locally and passing it's path to debuild via --prepend-path
  2. Installing rustc & cargo globaly using ppa:jonathonf/rustlang.
  3. Installing rustc, cargo & clang/llvm from ppa:ubuntu-mozilla-security/ppa.

But I get a compilation errors:

/home/idavydov/src/ff/firefox-57.0.1+build2/obj-x86_64-linux-gnu/dist/include/mozilla/Compiler.h:49:12: fatal error: 'cstddef' file not found, err: true
/home/idavydov/src/ff/firefox-57.0.1+build2/obj-x86_64-linux-gnu/dist/include/mozilla/mozalloc.h:16:12: fatal error: 'new' file not found, err: true
/home/idavydov/src/ff/firefox-57.0.1+build2/obj-x86_64-linux-gnu/dist/include/mozilla/mozalloc.h:16:12: fatal error: 'new' file not found, err: true
    stack backtrace:
       0:     0x5584a7075fb3 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h8ed7485deb8ab958
                                   at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
       1:     0x5584a7072520 - std::sys_common::backtrace::_print::h3d4f9ea58578e60f
                                   at /checkout/src/libstd/sys_common/backtrace.rs:69
      11:     0x5584a707aa9b - std::sys::imp::thread::Thread::new::thread_start::hbaf1b5aa1ca8e3ea
                                   at /checkout/src/liballoc/boxed.rs:736
                                   at /checkout/src/libstd/sys_common/thread.rs:24
                                   at /checkout/src/libstd/sys/unix/thread.rs:90
      12:     0x2b1467a296b9 - start_thread
      13:     0x2b1467f5c3dc - clone
      14:                0x0 - <unknown>

What kind of compilation environment is required to rebuild firefox 57 deb in ubuntu xenial?

  • I think you simply need to run sudo apt-get build-dep firefox before compilation. But it does not work. – N0rbert Dec 7 '17 at 18:13
  • @N0rbert, yes, that what's I did when I got a builddep error. Adding mozilla ppa helps with builddep, but still I get compilation errors. – Iakov Davydov Dec 7 '17 at 18:39

I managed to solve this. There were two problems:

No packages for build-dep

For that the correct way was to add the relevant ppa:

sudo apt-get source firefox
sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa
sudo apt-get update
sudo apt-get build-dep firefox
cd firefox-57.0.1+build2/
debuild -uc -us -b

Compilation error

This was most likely related to the available free space on disk. Firefox requires 30GB of free space and at least 2GB of RAM to compile. I tried on another machine with a lot of resources, and it worked fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.