Skip to content

Commit 09ce085

Browse files
committed
Auto merge of #126105 - tmandry:fuchsia-scripts, r=<try>
Add debugging utils and comments to Fuchsia scripts This should help when debugging a failure in the Fuchsia build in CI. I plan to follow up with a PR to the testing section of the dev guide with more details, along with more improvements happening in the Fuchsia repo itself. try-job: x86_64-gnu-integration
2 parents e1ac0fa + 168d23d commit 09ce085

File tree

2 files changed

+57
-32
lines changed

2 files changed

+57
-32
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-integration/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This job builds Fuchsia. See docs at XXX TODO and the build-fuchsia.sh script
2+
# in this directory for more details.
3+
14
FROM ubuntu:22.04
25

36
ARG DEBIAN_FRONTEND=noninteractive

src/ci/docker/host-x86_64/x86_64-gnu-integration/build-fuchsia.sh

+54-32
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,72 @@
22

33
# Downloads and builds the Fuchsia operating system using a toolchain installed
44
# in $RUST_INSTALL_DIR.
5+
#
6+
# You may run this script locally using Docker with the following command:
7+
#
8+
# $ src/ci/docker/run.sh x86_64-gnu-integration
59

610
set -euf -o pipefail
711

8-
INTEGRATION_SHA=1011e3298775ee7cdf6f6dc73e808d6a86e33bd6
12+
# Set this variable to disable updating the Fuchsia checkout. This is useful for
13+
# making local changes. You can find the Fuchsia checkout in `obj/fuchsia` in
14+
# your local checkout after running this job for the first time.
15+
KEEP_CHECKOUT=
16+
17+
# Any upstream refs that should be cherry-picked. This can be used to include
18+
# Gerrit changes from https://fxrev.dev during development (click the "Download"
19+
# button on a changelist to see the cherry pick ref). Example:
20+
# PICK_REFS=(refs/changes/71/1054071/2 refs/changes/74/1054574/2)
921
PICK_REFS=()
1022

23+
# The commit hash of integration.git to check out (this controls the commit hash
24+
# of fuchsia.git too).
25+
INTEGRATION_SHA=1011e3298775ee7cdf6f6dc73e808d6a86e33bd6
26+
1127
checkout=fuchsia
1228
jiri=.jiri_root/bin/jiri
1329

1430
set -x
1531

16-
# This script will:
17-
# - create a directory named "fuchsia" if it does not exist
18-
# - download "jiri" to "fuchsia/.jiri_root/bin"
19-
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \
20-
| base64 --decode \
21-
| bash -s $checkout
22-
23-
cd $checkout
24-
25-
$jiri init \
26-
-partial=true \
27-
-analytics-opt=false \
28-
.
29-
30-
$jiri import \
31-
-name=integration \
32-
-revision=$INTEGRATION_SHA \
33-
-overwrite=true \
34-
flower \
35-
"https://fuchsia.googlesource.com/integration"
36-
37-
if [ -d ".git" ]; then
38-
# Wipe out any local changes if we're reusing a checkout.
39-
git checkout --force JIRI_HEAD
40-
fi
32+
if [ -z "$KEEP_CHECKOUT" ]; then
33+
# This script will:
34+
# - create a directory named "fuchsia" if it does not exist
35+
# - download "jiri" to "fuchsia/.jiri_root/bin"
36+
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \
37+
| base64 --decode \
38+
| bash -s $checkout
4139

42-
$jiri update -autoupdate=false
40+
cd $checkout
4341

44-
echo integration commit = $(git -C integration rev-parse HEAD)
42+
$jiri init \
43+
-partial=true \
44+
-analytics-opt=false \
45+
.
4546

46-
for git_ref in "${PICK_REFS[@]}"; do
47-
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref
48-
git cherry-pick --no-commit FETCH_HEAD
49-
done
47+
$jiri import \
48+
-name=integration \
49+
-revision=$INTEGRATION_SHA \
50+
-overwrite=true \
51+
flower \
52+
"https://fuchsia.googlesource.com/integration"
53+
54+
if [ -d ".git" ]; then
55+
# Wipe out any local changes if we're reusing a checkout.
56+
git checkout --force JIRI_HEAD
57+
fi
58+
59+
$jiri update -autoupdate=false
60+
61+
echo integration commit = $(git -C integration rev-parse HEAD)
62+
63+
for git_ref in "${PICK_REFS[@]}"; do
64+
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref
65+
git cherry-pick --no-commit FETCH_HEAD
66+
done
67+
else
68+
cd $checkout
69+
fi
5070

71+
# Run the script inside the Fuchsia checkout responsible for building Fuchsia.
72+
# You can change arguments to the build by modifying this script.
5173
bash scripts/rust/build_fuchsia_from_rust_ci.sh

0 commit comments

Comments
 (0)