Contents |
fbuild is flock build, it is the framework surrounding building flock
You can expect flock developers to refer to variables in fbuild when describing where peices of code are.
There are 3 major parts to fbuild. fbuild is ambigious and refers both the developer environment code and the related services (builder servers and release tools)
Like many large projects, the Mozilla development environment is complex. If you are having difficulty, we are here to help.
Building by hand or on other OS
Download fbuild-initialsetup.sh
$ svn export svn://svn-mirror.flock.com/master/tools/trunk/fbuild/bin/fbuild-initialsetup.sh fbuild-initialsetup.sh
If you wish to build from anonymous add the --anonymous argument to fbuild-initialsetup.sh
Run
$ sh fbuild-initialsetup.sh $ . ~/.bashrc $ fenv $ flaunch
By default, this builds the browser in ~/fbuild or on MSWIn /cygdrive/C/fbuild.(i.e, C:\fbuild) It also modifies your .bashrc, and from now on you have the command fenv to initialize this new environment.
This runs an interactive script that sets up your environment and offers to do a build of Flock for you.
usage
usage: ./fbuild-initialsetup.sh [--user scm_user] [--anonymous|--mirror]
[--branch branch_name] [--no-prompt] [--buildbase directory] [ENVIRONMENT_NAME]
--user scm_user, sets the username for connecting to the repository
--anonymous, sets default branch, and src repository to the public mirror
--mirror, is a synonym for anonymous
--branch branch_name, ie 'branches/buzzard' sets the branch to checkout
--no-prompt, do not ask the user to verify the buildbase just use default echo "
--buildbase fullpath, where fullpath is fp to the directory to build flock in aka \$b"
ENVIRONMENT_NAME, is label appended to buildbase dir and shell function
--help, is this mesage
Instructions for using this script:
Run this file from a blank slate. You are prompted to enter the directory in which you want to create the build environment.
The script then checks the Flock build tools, loads the build environment, and installs a helper function in your ~/.bashrc file to load the environment.
After that, the script checks out all Flock browser code and begins the build process. Much time will pass.
There is one command-line option: If a string is passed to the script, it will be assigned to the F_BRANCH variable and function to distinguish the current build from a previous one. For example, if your default build is at /fbuild, but you want to try out something new, you can pass '-test' to this script and it will suggest that defaults use /fbuild-test).
There are many configuration options -- variables you can set in your environment to control aspects of this script and customize it to your own development habits.
Here is a brief description of each of those variables:
F_BUILDBASE -- The default directory where everything is built.
If a command line argument is passed to the script,
it is appended to this variable.
F_SCMBASE -- The repository to pull from. You should change
this if you are working with a special repository.
F_FORCE_CLEAN -- When the script checks out the build tools, if the
folder is already under SVN source control the script
automatically updates it. However, if this variable
is set to "1k" the script wipes out the directory and
checks it out again.
F_INSTALL_FUNCTIONS
-- By default, the script appends a helper function
to your .bashrc. To prevent this, set this variable
to "0".
F_CREATE_HELPER_SCRIPTS
-- If you set this to "1" (default is "0"), the script
creates an executable script and a configuration
file that help you launch a new bash shell with
proper configuration for the build environment you
are setting up.
F_INTERACTIVE_SETUP
-- If you set this to "0" (default is "1"), the script
doesn't ask you any questions and just goes with
defaults.
F_SCM_BRANCH
-- branch for flock source
default is determined by scm, i.e. trunk for svn
T_SCM_BRANCH
-- branch for tools source
default is determined by scm, i.e. trunk for svn
V_SCM_BRANCH
-- branch for vendor/code source
default is determined by scm, i.e. trunk for svn
The branch for "Cardinal" (a.k.a. the 0.7.x family) is branches/cardinal.
To setup an environment to work on Cardinal:
$ svn export svn://svn-mirror.flock.com/master/tools/trunk/fbuild/bin/fbuild-initialsetup.sh fbuild-initialsetup.sh $ ./fbuild-initialsetup.sh --branch branches/cardinal -cardinal
Then you will have a new working environment for Cardinal that can be initialized with 'fenv-cardinal'.
You can turn on localization mode with locale_set ab-CD, where ab-CD is a locale name.
The script pulls the locales to $s/flock/l10n, and adds an entry to .mozconfig. The next time you build Flock, an ab-CD version is created.
locale_set --off turns it off, so the next fbuild will create an en-US version.
fenv: A shell function that sources $FBUILD_HOME/lib/build-common.sh
~/.fbuild/defaults: Defines your personal overrides to the build system, or to any other environment variables you want set in the build system for you alone.
$s/scripts/lib/build-platform.sh: Contains platform specific settings. It determines the platform with uname and then runs these scripts in your environment.
$s/scripts/lib/build-Linux.sh: This is for Linux specific stuff. It is currently empty.
$s/scripts/lib/build-Win32.sh: This is for Windows/Cygwin specific settings. It does several things:
$s/scripts/lib/build-Darwin.sh: Initializes the fink environment and fixes your path. It adds elements to the front, and makes sure you have the windows paths in the correct place.
There is a script clean_path.pl that removes duplicate entries from your path, working on first appearance precedence. If /bin is at the beginning of your path it remains at the beginning, no matter how many times it appears later in your path.
needs updating
$s/tools/fbuild/lib/build-common.sh: This is the core file. TEST your changes before checking in because they can affect everybody.
On Debian-based systems (also tested on Ubuntu Dapper, perhaps it works on all unix-based systems?), this script appears to work to start Flock built in the above manner and can be included in a menu item for easy access.
#!/bin/bash # A script to start Flock Browser . ~/.bashrc b="$HOME/fbuild" FBUILD_HOME="$b/src/tools/fbuild"; export FBUILD_HOME if [ -f "$FBUILD_HOME/lib/build-common.sh" ]; then # echo ". \"$FBUILD_HOME/lib/build-common.sh\"" # for debugging . "$FBUILD_HOME/lib/build-common.sh" flaunch else echo "cannot find $FBUILD_HOME/lib/build-common.sh" echo "is FBUILD_HOME defined correctly?" fi