This document details design principles and specific technical decisions made that relate to how the Fuchsia build should work. These principles apply to all modes of using the Fuchsia build, for instance whether by interactive engineering workflows or via automated systems such as CI/CQ.
Like any system, the build is often subject to multiple conflicting requirements. When there is a conflict, we generally seek to satisfy these priorities by order of importance:
The following are considered to be good properties for the build:
These are ideals. We aim to meet these ideals and measure our progress against these measures.
Python scripts may be used as build actions.
Please follow the Google style guide for Python.
Fuchsia currently uses Python 3.8. All Python sources are to begin with the following:
#!/usr/bin/env python3.8
Shell scripts may be used as build actions.
Shell scripts are encouraged for tasks that can be expressed with a few simple shell commands. For complex operations, other languages are preferred.
Please follow the Google style guide for shell scripting. Please use shellcheck to find and correct common shell programming errors.
We prefer POSIX (aka Bourne) shell scripts for portability across wide set of host platforms. If you're maintaining an existing Bash script, please restrict the features used to version 3.2, or consider rewriting the script as POSIX shell script. To check whether your script is POSIX compliant, you can use:
shellcheck --shell=sh
Scripts that run on POSIX shell should begin with the following:
#!/bin/sh
Scripts that specifically require Bash should begin with the following:
#!/bin/bash