Skip to content

Commit b06b7d4

Browse files
committed
WIP:mac sccache
Change-Id: Ie0ee0d86efca90dfcf2fe02e46ab8a92ddbec62e
1 parent dea0857 commit b06b7d4

22 files changed

Lines changed: 209 additions & 1313 deletions

.github/actions/build/action.yaml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,31 @@ runs:
1515
steps:
1616
- name: Clean out dir from previous runner
1717
run: |
18-
rm -rf cobalt/src/out
18+
rm -rf src/out
1919
shell: bash
2020
- name: GN gen
2121
run: |
22-
cd cobalt/src
23-
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }}
22+
cd src
23+
if [[ "${{ matrix.platform }}" == *"mac"* ]]; then
24+
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }} --no-rbe --cc_wrapper=sccache
25+
else
26+
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }}
27+
fi
28+
shell: bash
29+
- name: Set sccache debug env variable
30+
run: |
31+
echo "SCCACHE_ERROR_LOG=$HOME/tmp/sccache.log" >> $GITHUB_ENV
32+
echo "SCCACHE_LOG=debug" >> $GITHUB_ENV
2433
shell: bash
25-
- name: List GN args
34+
- name: List GN args and sccache
2635
run: |
27-
cd cobalt/src
36+
cd src
37+
echo "$SCCACHE_GCS_KEY_PATH"
38+
echo "$SCCACHE"
39+
echo "$SCCACHE_GCS_BUCKET"
40+
echo "$SCCACHE_GCS_RW_MODE"
41+
echo "$SCCACHE_IDLE_TIMEOUT"
42+
sccache --show-stats
2843
gn args --list --short --overrides-only out/${{ matrix.platform }}_${{ matrix.config }}
2944
shell: bash
3045
- name: Get list of changed files
@@ -34,7 +49,7 @@ runs:
3449
CHANGED_FILES_LIST: changed_files.txt
3550
run: |
3651
set -x
37-
cd cobalt/src
52+
cd src
3853
# GitHub's actions/checkout action, by default, checks out the merge commit when
3954
# a pull request event triggers a workflow. This merge commit represents the state
4055
# of the code as if the pull request had been merged into the base branch.
@@ -55,7 +70,7 @@ runs:
5570
DYN_TEST_TARGETS_JSON_FILE: out/${{ matrix.platform }}_${{ matrix.config }}/dyn_targets.json
5671
run: |
5772
set -x
58-
cd cobalt/src
73+
cd src
5974
6075
if [[ ! -f "${STATIC_TEST_TARGETS_JSON_FILE}" ]]; then
6176
echo "Static test targets file not found at ${STATIC_TEST_TARGETS_JSON_FILE}. Skipping step."
@@ -95,13 +110,13 @@ runs:
95110
uses: actions/upload-artifact@v4
96111
with:
97112
name: ${{ matrix.platform }}_test_targets_json
98-
path: cobalt/src/out/${{ matrix.platform }}_${{ matrix.config }}/test_targets.json
113+
path: src/out/${{ matrix.platform }}_${{ matrix.config }}/test_targets.json
99114
- name: Ninja build test targets
100115
if: ${{ matrix.config == 'devel' && fromJSON(steps.calculate-test-targets.outputs.test_targets_count || 0) > 0 }}
101116
id: build-test-targets
102117
run: |
103118
set -ex
104-
cd cobalt/src
119+
cd src
105120
test_targets=$(echo '${{ steps.calculate-test-targets.outputs.test_targets_json }}' | jq -cr 'join(" ")')
106121
time autoninja -C out/${{ matrix.platform }}_${{ matrix.config }} ${test_targets}
107122
shell: bash
@@ -110,7 +125,7 @@ runs:
110125
TARGETS_JSON: ${{ inputs.targets }}
111126
run: |
112127
set -ex
113-
cd cobalt/src
128+
cd src
114129
TARGETS=$(echo "${TARGETS_JSON}" | jq -cr '. | join(" ")')
115130
time autoninja -C out/${{ matrix.platform }}_${{ matrix.config }} ${TARGETS}
116131
shell: bash
@@ -120,12 +135,12 @@ runs:
120135
with:
121136
name: ${{ matrix.platform }} APKs
122137
path: |
123-
cobalt/src/out/${{ matrix.platform }}_qa/apks/*.apk
124-
cobalt/src/out/${{ matrix.platform }}_qa/*_apk/*.apk
125-
cobalt/src/out/${{ matrix.platform }}_qa/gen/build_info.json
138+
src/out/${{ matrix.platform }}_qa/apks/*.apk
139+
src/out/${{ matrix.platform }}_qa/*_apk/*.apk
140+
src/out/${{ matrix.platform }}_qa/gen/build_info.json
126141
- name: Upload Test Artifacts
127142
if: steps.build-test-targets.outcome == 'success'
128-
uses: ./cobalt/src/.github/actions/upload_test_artifacts
143+
uses: ./src/.github/actions/upload_test_artifacts
129144
with:
130145
test_artifacts_key: ${{ inputs.test_artifacts_key }}
131146
upload_on_host_test_artifacts: ${{ inputs.upload_on_host_test_artifacts == 'true' || inputs.upload_web_test_artifacts == 'true' }}

.github/actions/depot_tools/action.yaml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,22 @@ runs:
1717
- name: Clear Cache and Clone Depot Tools
1818
if: inputs.use_cache != 'true'
1919
run: |
20-
rm -rf /runner-cache/depot_tools /runner-cache/cobalt/.cipd_cache
21-
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /runner-cache/depot_tools
22-
git -C /runner-cache/cobalt/src clean -ffdx
23-
shell: bash
20+
# Use $HOME instead of a root / path
21+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $HOME/depot_tools
2422
25-
- name: Reset Cached Depot Tools
26-
if: inputs.use_cache == 'true'
27-
run: git -C /runner-cache/depot_tools reset --hard origin/main
23+
# Add to PATH for subsequent steps
24+
echo "$HOME/depot_tools" >> $GITHUB_PATH
2825
shell: bash
2926

30-
- name: Add Depot Tools to PATH
31-
run: echo "/runner-cache/depot_tools" >> $GITHUB_PATH
32-
shell: bash
27+
# - name: Reset Cached Depot Tools
28+
# if: inputs.use_cache == 'true'
29+
# run: git -C /runner-cache/depot_tools reset --hard origin/main
30+
# shell: bash
3331

3432
- name: Bootstrap Bundled python3
3533
run: |
3634
# Must be run manually as $DEPOT_TOOLS_UPDATE is 0 in CI, skipping the bootstrap.
37-
source /runner-cache/depot_tools/bootstrap_python3 && bootstrap_python3
35+
source $HOME/depot_tools/bootstrap_python3 && bootstrap_python3
3836
shell: bash
3937

4038
- name: Disable Chromium client side build telemetry
@@ -43,26 +41,32 @@ runs:
4341

4442
- name: Run gclient config
4543
run: |
46-
cd cobalt
4744
gclient config \
4845
--name=src \
4946
--custom-var=download_remoteexec_cfg=True \
5047
--custom-var='rbe_instance="${{ inputs.rbe_instance }}"' \
5148
https://github.com/${{ github.repository }}
5249
shell: bash
5350

54-
- name: Set target OS for Android
55-
if: contains(matrix.platform, 'android')
51+
# - name: Set target OS for Android
52+
# if: contains(matrix.platform, 'android')
53+
# run: |
54+
# cd cobalt
55+
# echo "target_os=['android']" >> .gclient
56+
# gclient validate
57+
# shell: bash
58+
59+
- name: Set target OS for Mac
60+
if: ${{ contains(matrix.platform, 'mac') }}
5661
run: |
57-
cd cobalt
58-
echo "target_os=['android']" >> .gclient
62+
echo "target_os=['mac']" >> .gclient
5963
gclient validate
6064
shell: bash
6165

6266
- name: Run gclient sync
6367
if: inputs.run_sync == 'true'
6468
run: |
65-
cd cobalt
69+
cd src
6670
gclient sync \
6771
--verbose \
6872
--shallow \
@@ -75,9 +79,9 @@ runs:
7579

7680
- name: Run gclient runhooks
7781
if: inputs.run_sync == 'true'
78-
env:
79-
CIPD_CACHE_DIR: "/runner-cache/cobalt/.cipd_cache"
82+
# env:
83+
# CIPD_CACHE_DIR: "/runner-cache/cobalt/.cipd_cache"
8084
run: |
81-
cd cobalt
85+
cd src
8286
gclient runhooks --verbose
8387
shell: bash

.github/config/mac.json

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

.github/workflows/android.yaml

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)