Giter Site home page Giter Site logo

tor-browser-build's Introduction

Tor Browser Build
=================

Installing build dependencies
-----------------------------

To build Tor Browser, you need a Linux distribution that has support
for runc (such as Debian jessie, Ubuntu 16.04, Fedora 20, etc ...).
On Debian jessie, the runc package is available in backports. On Debian
stretch, the runc package is available in the main repository.

Your user account should have sudo access, which is required to be able
to extract container file systems, start containers and copy files to and
from containers.

The sources of most components are downloaded using git, which needs to
be installed. The sources of webrtc are downloaded using gclient, which
requires GTK+ 2.0 development files and curl to be installed.

You also need a few perl modules installed:
- YAML::XS
- File::Basename
- Getopt::Long
- Template
- IO::Handle
- IO::CaptureOutput
- File::Temp
- Path::Tiny
- File::Path
- File::Copy::Recursive
- String::ShellQuote
- Sort::Versions
- Digest::SHA
- Data::UUID
- Data::Dump

If you are running Debian or Ubuntu, you can install them with:

# apt-get install libyaml-libyaml-perl libtemplate-perl \
                  libio-handle-util-perl libio-all-perl \
                  libio-captureoutput-perl libpath-tiny-perl \
                  libstring-shellquote-perl libsort-versions-perl \
                  libdigest-sha-perl libdata-uuid-perl libdata-dump-perl \
                  libfile-copy-recursive-perl git libgtk2.0-dev curl runc

The build system is based on rbm, which is included as a git submodule
in the rbm/ directory. You can fetch the rbm git submodule by running
'make submodule-update'.


Starting a build
----------------

To start a build, run one of the following commands, depending on the
channel you want to build:

  $ make release
  $ make alpha
  $ make nightly
  $ make alpha_nightly

You can find the build result in the directory release/unsigned/$version
or alpha/unsigned/$version for release or alpha builds. The result of
nightly or alpha_nightly can be found in the nightly/$date or
alpha_nightly/$date directory.

The alpha and alpha_nightly make target will build the same thing. The
only difference is the output directory. The alpha_nightly target can be
useful if you want to do a test build without polluting your alpha
directory.

If you want to build for a specific platform only, append the platform
name to the makefile target:

  $ make nightly-linux-x86_64
  $ make nightly-linux-i686
  $ make nightly-windows-i686
  $ make nightly-osx-x86_64

When you want to quickly do a build to test a change, you can use the
testbuild makefile target, and find the build in the testbuild directory.
The build will be the same as regular alpha builds, except that in order
to make the build faster, only the en-US locale will be built, and no
mar file will be created.


Updating git sources
--------------------

You can run "make fetch" to fetch the latest sources from git for all
components included in Tor Browser. You should run this if you want to
make a nightly build with the latest commits, and you disabled automatic
fetching of new commits for nightly builds in rbm.local.conf.


Number of make processes
------------------------

By default the builds are run with 4 processes simultaneously (with
make -j4). If you want to change the number of processes used, you can
set the RBM_NUM_PROCS environment variable:

  $ export RBM_NUM_PROCS=8

You can also set the buildconf/num_procs option in rbm.local.conf.


Automated builds
----------------

If the build fails, a shell will automatically open in the build
container to help you debug the problem. You probably want to disable
this if you want to do automated builds. To disable this, set
the RBM_NO_DEBUG environment variable to 1:

   export RBM_NO_DEBUG=1

Or set the debug option to 0 in the rbm.local.conf file.

If you want to select the output directory, you can use rbm's --output-dir
option. You can look at the Makefile to find the rbm command for what
you want to build, and add the --output-dir option. For example, if you
want to build Tor Browser nightly for linux-x86_64:

   ./rbm/rbm build release --output-dir=/var/builds/nightly/2017-01-23 \
                        --target nightly --target torbrowser-linux-x86_64

The files will be put in the directory selected by --output-dir in a
subdirectory named as the version number (or current date for nightly).
To remove this version subdirectory, add the noversiondir target:

   ./rbm/rbm build release --output-dir=/var/builds/nightly/2017-01-23 \
                        --target nightly --target torbrowser-linux-x86_64 \
                        --target noversiondir


Automated builds using tbb-testsuite
------------------------------------

The Tor Browser testsuite scripts can also be used to do nightly builds
and publish the build logs.

If you want to do that, start by cloning the git repository:

   $ git clone https://git.torproject.org/boklm/tor-browser-bundle-testsuite.git

Install some dependencies:

   # apt-get install -y libdata-dump-perl libfile-slurp-perl \
               libio-captureoutput-perl perlmagick libjson-perl \
               libwww-perl liblwp-protocol-https-perl libtemplate-perl \
               libyaml-syck-perl libdatetime-perl \
               libemail-sender-perl libemail-simple-perl libfile-type-perl \
               libipc-run-perl libxml-libxml-perl

Copy the config/tor-browser_build-boklm file and edit it:

   $ cd tor-browser-bundle-testsuite
   $ cp config/tor-browser_build-boklm config/tor-browser_build-$user
   $ vim config/tor-browser_build-$user

Change the publish_dir and publish_url options. The publish_dir option is
the local directory where the builds will be stored. The publish_url
option is the public URL where the builds will be available.

Copy the tools/tor-browser-builds-boklm file and edit it to change the
--config= option:

   $ cp tools/tor-browser-builds-boklm tools/tor-browser-builds-$user
   $ vim tools/tor-browser-builds-$user

You can now run ./tools/tor-browser-builds-$user to start the build, and
add it to your crontab.

The html build reports will be available in the reports/ directory, and
the build files in the tor-browser-builds/ directory (unless you changed
the publish_dir option).


Signing builds
--------------

If the environment variable RBM_SIGN_BUILD is set to 1, the
sha256sums-unsigned-build.txt file will be signed with gpg.
You can use the RBM_GPG_OPTS environment variable to add some options
to the gpg command used to sign the file. You can also set the
var/sign_build and var/sign_build_gpg_opts options in the rbm.local.conf
file.


Cleaning obsolete files and containers images
---------------------------------------------

You can run 'make clean' to clean old build files and containers that
are no longer used in current builds. Before doing that, you need to
configure the branches and build targets you are using in the
rbm.local.conf file. The cleaning script will check out all the configured
branches to create a list of used build files, and delete the files
from the 'out' directory that are not used. If you want to see the list
of files and containers that would be removed without doing it, you can
use 'make clean-dry-run'.


Common Build Errors
-------------------

You can look at the README.BUILD_ERRORS file for a list of common build
errors and their solutions.


Hacking on the Tor Browser build
--------------------------------

The file README.HACKING tries to list the main things to know when
making changes to the Tor Browser build.

Description of makefile rules
-----------------------------

You can find a description of the makefile rules in the README.MAKEFILE
file.

tor-browser-build's People

Contributors

arthuredelstein avatar boklm avatar gk-tpo avatar hainish avatar isislovecruft avatar patrickod avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.