Skip to content

Commit

Permalink
Update external setup guide (#854)
Browse files Browse the repository at this point in the history
* Update external setup guide
* Trim package list
* Update ccache instructions

b/286653238
  • Loading branch information
oxve committed Jul 12, 2023
1 parent 90ccb8d commit aa2bf10
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
8 changes: 4 additions & 4 deletions cobalt/site/docs/development/setup-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Set up your environment - Docker"
---

We provide <a
href="https://cobalt.googlesource.com/cobalt/+/refs/heads/22.lts.stable/src/docker/linux/">Docker image definitions</a> to simplify managing build environments.
href="https://github.com/youtube/cobalt/tree/main/docker/linux/">Docker image definitions</a> to simplify managing build environments.

The instructions below assume Docker is installed and is able to run basic
hello-world verification. `docker-compose` command is expected to be available as well.
Expand All @@ -15,7 +15,7 @@ Clone the Cobalt code repository. The following `git` command creates a
`cobalt` directory that contains the repository:

```
$ git clone https://cobalt.googlesource.com/cobalt
$ git clone https://github.com/youtube/cobalt.git
$ cd cobalt
```

Expand All @@ -38,7 +38,7 @@ where config is one of the four optimization levels, `debug`, `devel`,
`qa` and `gold`, and target is the build target passed to ninja

See <a
href="https://cobalt.googlesource.com/cobalt/+/refs/heads/22.lts.stable/src/README.md#build-types">Cobalt README</a> for full details.
href="https://github.com/youtube/cobalt#building-and-running-the-code">Cobalt README</a> for full details.

Builds will be available in your `${COBALT_SRC}/out` directory.

Expand Down Expand Up @@ -90,4 +90,4 @@ docker-compose run linux-x64x11 /bin/bash
```

and try to build Cobalt with the <a
href="https://cobalt.googlesource.com/cobalt/+/refs/heads/22.lts.stable/src/README.md#building-and-running-the-code">usual GN / ninja flow.</a>
href="https://github.com/youtube/cobalt#building-and-running-the-code">usual GN / ninja flow.</a>
44 changes: 18 additions & 26 deletions cobalt/site/docs/development/setup-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ binary. Note that the binary has a graphical client and must be run locally
on the machine that you are using to view the client. For example, you cannot
SSH into another machine and run the binary on that machine.

These instructions were tested on a fresh ubuntu:20.04 Docker image. (1/12/22)
These instructions were tested on a clean ubuntu:20.04 Docker image. (7/11/23)
Required libraries can differ depending on your Linux distribution and version.

## Set up your workstation
Expand All @@ -19,10 +19,22 @@ Required libraries can differ depending on your Linux distribution and version.

```
$ sudo apt update && sudo apt install -qqy --no-install-recommends \
pkgconf ninja-build bison nasm yasm binutils clang libgles2-mesa-dev \
mesa-common-dev libpulse-dev libavresample-dev libasound2-dev \
libxrender-dev libxcomposite-dev libxml2-dev curl git \
python3.8-venv libxi-dev
bison clang libasound2-dev libgles2-mesa-dev libglib2.0-dev \
libxcomposite-dev libxi-dev libxrender-dev nasm ninja-build \
python3.8-venv
```

1. Install ccache to support build acceleration. Build acceleration is \
enabled by default and must be disabled if ccache is not installed.

```
$ sudo apt install -qqy --no-install-recommends ccache
```

We recommend adjusting the cache size as needed to increase cache hits:

```
$ ccache --max-size=20G
```

1. Install Node.js via `nvm`:
Expand All @@ -39,19 +51,6 @@ Required libraries can differ depending on your Linux distribution and version.
&& nvm use default
```

1. Install ccache to support build acceleration. ccache is automatically used
when available, otherwise defaults to unaccelerated building:

```
$ sudo apt install -qqy --no-install-recommends ccache
```

We recommend adjusting the cache size as needed to increase cache hits:

```
$ ccache --max-size=20G
```

1. Install GN, which we use for our build system code. There are a few ways to
get the binary, follow the instructions for whichever way you prefer
[here](https://cobalt.googlesource.com/third_party/gn/+/refs/heads/main/#getting-a-binary).
Expand All @@ -60,7 +59,7 @@ Required libraries can differ depending on your Linux distribution and version.
`cobalt` directory that contains the repository:

```
$ git clone https://cobalt.googlesource.com/cobalt
$ git clone https://github.com/youtube/cobalt.git
```

1. Set `PYTHONPATH` environment variable to include the full path to the
Expand Down Expand Up @@ -200,10 +199,3 @@ to debug application performance, but also a great way to debug issues and
better understand Cobalt's execution flow in general.

Simply build and run one of these configs and observe the terminal output.
<!--
<aside class="note">
<b>Note:</b> If you plan to upload reviews to the Cobalt repository, you
also need to <a href="/development/setup-gitcookies.html">follow these
instructions</a> to set up a <code>.gitcookies</code> file.
</aside>
-->
4 changes: 2 additions & 2 deletions cobalt/site/docs/development/setup-raspi.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ Raspberry Pi.

```
$ sudo apt install -qqy --no-install-recommends g++-multilib \
wget xz-utils libxml2 binutils-aarch64-linux-gnu \
binutils-arm-linux-gnueabi libglib2.0-dev
wget xz-utils libxml2 binutils-aarch64-linux-gnu \
binutils-arm-linux-gnueabi libglib2.0-dev
```

1. Choose a location for the installed toolchain &ndash; e.g. `raspi-tools`
Expand Down

0 comments on commit aa2bf10

Please sign in to comment.