<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Soumya Lahiri</title>
    <description>The latest articles on DEV Community by Soumya Lahiri (@soumyalahiri).</description>
    <link>https://dev.to/soumyalahiri</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F358367%2F5ce9310a-d2ca-4236-ae5f-d0b4ee99c95f.jpeg</url>
      <title>DEV Community: Soumya Lahiri</title>
      <link>https://dev.to/soumyalahiri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/soumyalahiri"/>
    <language>en</language>
    <item>
      <title>How to Build Firefox on Ubuntu</title>
      <dc:creator>Soumya Lahiri</dc:creator>
      <pubDate>Tue, 31 Mar 2020 16:26:47 +0000</pubDate>
      <link>https://dev.to/soumyalahiri/building-firefox-on-ubuntu-4bd8</link>
      <guid>https://dev.to/soumyalahiri/building-firefox-on-ubuntu-4bd8</guid>
      <description>&lt;p&gt;I'm using Ubuntu 19.10 on my PC. This tutorial focuses on building Firefox for Desktop. Most of the stuff in this post can be found in Mozilla's &lt;a href="https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide"&gt;Developer Guide&lt;/a&gt;. I'm creating this post simplifying certain aspects of the process, especially for first-time contributors based on the difficulties I faced when I first contributed to Firefox.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;br&gt;
Ensure you have Python installed on your system. You can check if it is installed by using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python --version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you get a message like &lt;code&gt;Python 2.7.17&lt;/code&gt;, then you already have Python installed on your system. If you encounter some other error message, you can install Python on your system by the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You may be prompted for your password.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mercurial&lt;/strong&gt;&lt;br&gt;
Mozilla's preferred VCS is &lt;a href="https://www.mercurial-scm.org/"&gt;Mercurial&lt;/a&gt;. While it is possible to use Git for developing Firefox, that procedure is not mentioned in this article. If you aren't aware of what a VCS is, you should probably look that up first. You can check if Mercurial is installed on your system by using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hg --version
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you get a message showing the version of Mercurial installed alongside other details, then you already have Mercurial installed on your system. If you encounter some other error message, you can install Mercurial on your system by the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install mercurial
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You may be prompted for your password.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Building Firefox&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Directory Setup&lt;/strong&gt;&lt;br&gt;
Create a directory where you will clone the source files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir src &amp;amp;&amp;amp; cd src
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Bootstrapping&lt;/strong&gt;&lt;br&gt;
Download the &lt;a href="https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py"&gt;bootstrap.py&lt;/a&gt; file and place it in the &lt;code&gt;src&lt;/code&gt; folder created in the previous step. Now run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python bootstrap.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You will be prompted multiple times after this command. Most of the prompts will be asking before downloading certain dependencies for building Firefox. When prompted for choice of VCS, choose Mercurial. When prompted for choice of build, proceed with &lt;em&gt;Firefox for Desktop&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Getting the Source Files&lt;/strong&gt;&lt;br&gt;
Now you need to clone the original source files onto your system. Before executing this step, ensure you have a reliable internet connection and enough storage space on your system. This step can take some time based on your internet speed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hg clone https://hg.mozilla.org/mozilla-central
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Build Firefox&lt;/strong&gt;&lt;br&gt;
After successfully cloning the files, you should find a folder named &lt;code&gt;mozilla-central&lt;/code&gt; inside your &lt;code&gt;src&lt;/code&gt; folder. Navigate into &lt;code&gt;mozilla-central&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd mozilla-central
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now comes the final and the most time-consuming step of the whole procedure. This step can take up to 2 hours even on the fastest machines with the latest hardware, or more on older hardware. To build Firefox, run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./mach build
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If the build fails, a good option is to run the following command before trying to build again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./mach bootstrap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This will check and ensure that the development environment is set up and configured properly. If build failure persists, make sure your source files are up to date by running the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hg pull
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You should now be able to build your own copy of Firefox from source. If you have further issues or questions, you can join Mozilla's Developer IRC and ask about your issues there. &lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
