Skip to content

Commit 07a14b4

Browse files
committed
WIP: TVOS Build
Change-Id: Ibc15083c110f10095c17a757532253e9d878ce9b
1 parent 28d6cd1 commit 07a14b4

6 files changed

Lines changed: 82 additions & 2 deletions

File tree

.github/actions/build/action.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,26 @@ runs:
2020
- name: GN gen
2121
run: |
2222
cd cobalt/src
23-
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }}
23+
if [[ "${{ matrix.platform }}" == "tvos" ]]; then
24+
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }} --no-rbe --cc_wrapper=ccache
25+
else
26+
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }}
27+
fi
28+
shell: bash
29+
- name: Install sccache
30+
if: ${{ matrix.platform == 'tvos' }}
31+
run: brew install sccache
32+
- name: Configure sccache
33+
if: ${{ matrix.platform == 'tvos' }}
2434
shell: bash
35+
run: |
36+
set -x
37+
echo "${{ secrets.SCCACHE_GCS_KEY_MAC }}" | base64 --decode > "${HOME}/gcloud.json"
38+
echo "SCCACHE_GCS_KEY_PATH=${HOME}/gcloud.json" >> $GITHUB_ENV
39+
echo "SCCACHE=1" >> $GITHUB_ENV
40+
echo "SCCACHE_GCS_BUCKET=cobalt-kokoro-sccache-mac" >> $GITHUB_ENV
41+
echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV
42+
echo "SCCACHE_IDLE_TIMEOUT=0" >> $GITHUB_ENV
2543
- name: List GN args
2644
run: |
2745
cd cobalt/src

.github/actions/depot_tools/action.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ runs:
6464
gclient validate
6565
shell: bash
6666

67+
- name: Set target OS for TvOS
68+
if: contains(matrix.platform, 'tvos')
69+
run: |
70+
cd cobalt
71+
echo "target_os=['ios']" >> .gclient
72+
gclient validate
73+
shell: bash
74+
6775
- name: Run gclient sync
6876
if: inputs.run_sync == 'true'
6977
run: |

.github/config/tvos.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"docker_service": "tvos",
3+
"platforms": [
4+
"chromium_mac-arm64"
5+
],
6+
"build_configs": [
7+
"devel"
8+
],
9+
"targets": [
10+
"content_shell"
11+
],
12+
"includes": [
13+
{
14+
"name": "mac",
15+
"platform": "chromium_mac-arm64"
16+
}
17+
]
18+
}

.github/workflows/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ on:
2121
secrets:
2222
datadog_api_key:
2323
required: false
24+
SCCACHE_GCS_KEY_MAC:
25+
required: false
2426

2527
concurrency:
2628
# Cancel existing jobs on the same workflow, platform, and branch (or sha if merged).

.github/workflows/tvos.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: tvos
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
nightly:
7+
description: 'Nightly workflow.'
8+
required: true
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
# This is default Chromium build config
14+
tvos-x64:
15+
uses: ./.github/workflows/main.yaml
16+
permissions:
17+
packages: write
18+
pull-requests: write
19+
with:
20+
platform: tvos
21+
nightly: ${{ github.event.inputs.nightly }}
22+
secrets:
23+
datadog_api_key: ${{ secrets.DD_API_KEY }}
24+
SCCACHE_GCS_KEY_MAC: ${{ secrets.SCCACHE_GCS_KEY_MAC }}

cobalt/build/gn.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
]
8080

8181

82-
def write_build_args(build_args_path, platform_args_path, build_type, use_rbe,
82+
def write_build_args(build_args_path, platform_args_path, build_type, use_rbe,
8383
use_coverage):
8484
""" Write args file, modifying settings for config"""
8585
gen_comment = '# Set by gn.py'
@@ -89,6 +89,7 @@ def write_build_args(build_args_path, platform_args_path, build_type, use_rbe,
8989
f.write(f'use_remoteexec = true {gen_comment}\n')
9090
f.write(
9191
f'rbe_cfg_dir = rebase_path("//cobalt/reclient_cfgs") {gen_comment}\n')
92+
# f.write('cc_wrapper = "sccache"')
9293
f.write(f'build_type = "{build_type}" {gen_comment}\n')
9394
for key, value in _BUILD_TYPES[build_type].items():
9495
f.write(f'{key} = {value} {gen_comment}\n')
@@ -162,6 +163,12 @@ def parse_args():
162163
default=False,
163164
action='store_true',
164165
help='Pass this flag to enable code coverage instrumentation.')
166+
# parser.add_argument(
167+
# '--cc_wrapper',
168+
# type=str,
169+
# default='',
170+
# action='store_true',
171+
# help='Compiler wrapper to use (e.g., sccache).')
165172

166173
# Consume --args to avoid passing to gn gen, overriding args.gn file.
167174
parser.add_argument('--args', help=argparse.SUPPRESS)
@@ -174,6 +181,9 @@ def parse_args():
174181
if not script_args.no_check:
175182
gen_args.append('--check')
176183

184+
# if script_args.cc_wrapper:
185+
# gen_args.append(script_args.cc_wrapper)
186+
177187
if script_args.args:
178188
print('WARNING: \'--args\' was ignored to avoid overriding args.gn file.')
179189

0 commit comments

Comments
 (0)