summaryrefslogtreecommitdiff
path: root/chromium/docs/website/site/chromium-os/build/add-sdk-package/index.md
blob: 39781ae2e096cb723c6eb96e4c5dcfc3dab045d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
breadcrumbs:
- - /chromium-os
  - Chromium OS
- - /chromium-os/build
  - Chromium OS Build
page_name: add-sdk-package
title: Adding a Package to the SDK
---

[TOC]

## Add the Package

When adding a package to the SDK, for third-party packages not yet in the source
tree, start by following the
[New & Upgrade Package Process](https://chromium.googlesource.com/chromiumos/docs/+/HEAD/portage/package_upgrade_process.md)
guide (short version: use `cros_portage_upgrade` to pull the package from
upstream). For new cros-workon packages, see
[Adding a New Package](/chromium-os/how-tos-and-troubleshooting/add-a-new-package).
Once the package is in place, add it as a dependency to the
[virtual/target-chromium-os-sdk](https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/HEAD/virtual/target-chromium-os-sdk/target-chromium-os-sdk-9999.ebuild)
ebuild to be automatically installed as part of the SDK.

Do note that because virtual/target-chromium-os-sdk is a cros-workon package,
before adding the dependency, run:

```
cros-workon --host start virtual/target-chromium-os-sdk
```

## Test the Package

To install the new package to test against (e.g. to run commands/tools, check
behavior, etc.):

```
sudo emerge <package name>
```

To test the new package is installed correctly as part of the SDK, update the
chroot:

```
update_chroot
```

### Unit testing

To run the unit tests for the new package, run:

```
cros_run_unit_tests --host --packages <package name>
```

For cros-workon packages, as long as the package is in the
virtual/target-chromium-os-sdk dependency tree, the unit tests will
automatically be run on the SDK as part of the host-packages-cq builder in CQ
and are required to pass. For third-party packages, unit tests can be run with
the `cros_run_unit_tests` command above to get feedback locally, but they are
not run as part of CQ and are not required to pass as it is expected that
upstream releases have already been tested.

### Test with the SDK Builder

For more information on the SDK Builder, see
[Chromium OS SDK Creation](/chromium-os/build/sdk-creation).

To test building the SDK itself with the new package, by running the entire SDK
builder process, launch an SDK builder tryjob:

```
cros tryjob -g <cl 1> [-g ...] chromiumos-sdk-tryjob
```

Or, to just build the SDK board locally:

```
~/chromiumos/src/scripts/build_sdk_board
```