Fuchsia uses the
jiri tool to manage git repositories. This tool manages
a set of repositories specified by a manifest. Jiri is located at
See Source code layout for an overview of how the Fuchsia repository is organized.
For how to prepare your developer environment and build Fuchsia, see Fuchsia's Getting Started doc.
Creating a new Fuchsia checkout
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
fuchsiadirectory 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.
Setting up environment variables
Upon success, the bootstrap script should print a message recommending that you
.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
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
fd to change directories effectively. See comments in
scripts/fx-env.sh for more details.
Working without altering your PATH
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
to the directory into which you copy
jiri. If you don't, then
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
Who works on the code
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.
How to handle third-party code
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
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.