Skip to content

Commit 76d6219

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 + d3bdc64 commit 76d6219

File tree

2 files changed

+58
-31
lines changed

2 files changed

+58
-31
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

+55-31
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,74 @@
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

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

25+
# The commit hash of integration.git to check out (this controls the commit hash
26+
# of fuchsia.git too).
27+
INTEGRATION_SHA=56310bca298872ffb5ea02e665956d9b6dc41171
28+
1129
checkout=fuchsia
1230
jiri=.jiri_root/bin/jiri
1331

1432
set -x
1533

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
34+
if [ -z "$KEEP_CHECKOUT" ]; then
35+
# This script will:
36+
# - create a directory named "fuchsia" if it does not exist
37+
# - download "jiri" to "fuchsia/.jiri_root/bin"
38+
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \
39+
| base64 --decode \
40+
| bash -s $checkout
41+
42+
cd $checkout
4143

42-
$jiri update -autoupdate=false
44+
$jiri init \
45+
-partial=true \
46+
-analytics-opt=false \
47+
.
4348

44-
echo integration commit = $(git -C integration rev-parse HEAD)
49+
$jiri import \
50+
-name=integration \
51+
-revision=$INTEGRATION_SHA \
52+
-overwrite=true \
53+
flower \
54+
"https://fuchsia.googlesource.com/integration"
4555

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
56+
if [ -d ".git" ]; then
57+
# Wipe out any local changes if we're reusing a checkout.
58+
git checkout --force JIRI_HEAD
59+
fi
60+
61+
$jiri update -autoupdate=false
62+
63+
echo integration commit = $(git -C integration rev-parse HEAD)
64+
65+
for git_ref in "${PICK_REFS[@]}"; do
66+
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref
67+
git cherry-pick --no-commit FETCH_HEAD
68+
done
69+
else
70+
cd $checkout
71+
fi
5072

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

0 commit comments

Comments
 (0)