Fuchsia uses the
jiri tool to manage git repositories. This tool manages a set of repositories specified by a manifest. Jiri is located at https://fuchsia.googlesource.com/jiri.
To understand how the Fuchsia repository is organized, see Source code layout.
To prepare your development environment and build Fuchsia, see Getting started.
To submit your contribution to the Fuchsia project using
jiri commands, see Contribute changes.
Fuchsia provides a bootstrap script that sets up your development environment and syncs with the Fuchsia source repository. It requires that you have the following installed and up to date:
To install these tools, run the following script. This command will install them if they are missing or update if they exist.
sudo apt-get install build-essential curl git python unzip
Go to the directory where you want to set up your workspace for the Fuchsia codebase. This can be anywhere, but this example uses your home directory.
Run the script to bootstrap your development environment. This script automatically creates a
fuchsia directory for the source code:
curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
Downloading Fuchsia source can take up to 60 minutes.
Upon success, the bootstrap script should print a message recommending that you add the
.jiri_root/bin directory to your PATH. This will add
jiri to your PATH, which is recommended and is assumed by other parts of the Fuchsia toolchain.
Another tool in
fx, which helps configuring, building, running and debugging Fuchsia. See
fx help for all available commands.
You can also source
scripts/fx-env.sh, but sourcing
fx-env.sh is not required. It defines a few environment variables that are commonly used in the documentation, such as
$FUCHSIA_DIR, and provides useful shell functions, for instance
fd to change directories effectively. See comments in
scripts/fx-env.sh for more details.
If you don‘t like having to mangle your environment variables, and you want
jiri to “just work” depending on your current working directory, just copy
jiri into your PATH. However, you must have write access (without
sudo) to the directory into which you copy
jiri. If you don’t, then
jiri will not be able to keep itself up-to-date.
cp .jiri_root/bin/jiri ~/bin
To use the
fx tool, you can either symlink it into your
ln -s `pwd`/scripts/fx ~/bin
or just run the tool directly as
scripts/fx. Make sure you have jiri in your PATH.
In the root of every repository and in many other directories are OWNERS files. These list email addresses of individuals who are familiar with and can provide code review for the contents of the containing directory. See owners.md for more discussion.
See the guidelines on writing the metadata for third-party code in README.fuchsia files.
If you see an error when you check out the code warning you about
Invalid authentication credentials, you likely have a cookie in your
$HOME/.gitcookies file that applies to repositories that jiri tries to check out anonymously (likely in the domain
.googlesource.com). You can follow the onscreen directions to get passwords for the specific repositories, or you can delete the offending cookie from your