Skip to content

Commit e116844

Browse files
authored
Unrolled build for rust-lang#126105
Rollup merge of rust-lang#126105 - tmandry:fuchsia-scripts, r=lqd 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 8fb1930 + 63ba3f3 commit e116844

File tree

2 files changed

+72
-32
lines changed

2 files changed

+72
-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 a toolchain capable of building Fuchsia, and then builds
2+
# Fuchsia. See the build-fuchsia.sh script 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

+69-32
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,87 @@
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
9+
#
10+
# Alternatively, from within the container with --dev, assuming you have made it
11+
# as far as building the toolchain with the above command:
12+
#
13+
# $ src/ci/docker/run.sh --dev x86_64-gnu-integration
14+
# docker# git config --global --add safe.directory /checkout/obj/fuchsia
15+
# docker# ../src/ci/docker/host-x86_64/x86_64-gnu-integration/build-fuchsia.sh
16+
#
17+
# Also see the docs in the rustc-dev-guide for more info:
18+
# https://github.com/rust-lang/rustc-dev-guide/pull/1989
519

620
set -euf -o pipefail
721

8-
INTEGRATION_SHA=1011e3298775ee7cdf6f6dc73e808d6a86e33bd6
22+
# Set this variable to 1 to disable updating the Fuchsia checkout. This is
23+
# useful for making local changes. You can find the Fuchsia checkout in
24+
# `obj/x86_64-gnu-integration/fuchsia` in your local checkout after running this
25+
# job for the first time.
26+
KEEP_CHECKOUT=
27+
28+
# Any upstream refs that should be cherry-picked. This can be used to include
29+
# Gerrit changes from https://fxrev.dev during development (click the "Download"
30+
# button on a changelist to see the cherry pick ref). Example:
31+
# PICK_REFS=(refs/changes/71/1054071/2 refs/changes/74/1054574/2)
932
PICK_REFS=()
1033

34+
# The commit hash of Fuchsia's integration.git to check out. This controls the
35+
# commit hash of fuchsia.git and some other repos in the "monorepo" checkout, in
36+
# addition to versions of prebuilts. It should be bumped regularly by the
37+
# Fuchsia team – we aim for every 1-2 months.
38+
INTEGRATION_SHA=1011e3298775ee7cdf6f6dc73e808d6a86e33bd6
39+
1140
checkout=fuchsia
1241
jiri=.jiri_root/bin/jiri
1342

1443
set -x
1544

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
45+
if [ -z "$KEEP_CHECKOUT" ]; then
46+
# This script will:
47+
# - create a directory named "fuchsia" if it does not exist
48+
# - download "jiri" to "fuchsia/.jiri_root/bin"
49+
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \
50+
| base64 --decode \
51+
| bash -s $checkout
4152

42-
$jiri update -autoupdate=false
53+
cd $checkout
4354

44-
echo integration commit = $(git -C integration rev-parse HEAD)
55+
$jiri init \
56+
-partial=true \
57+
-analytics-opt=false \
58+
.
4559

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
60+
$jiri import \
61+
-name=integration \
62+
-revision=$INTEGRATION_SHA \
63+
-overwrite=true \
64+
flower \
65+
"https://fuchsia.googlesource.com/integration"
66+
67+
if [ -d ".git" ]; then
68+
# Wipe out any local changes if we're reusing a checkout.
69+
git checkout --force JIRI_HEAD
70+
fi
71+
72+
$jiri update -autoupdate=false
73+
74+
echo integration commit = $(git -C integration rev-parse HEAD)
75+
76+
for git_ref in "${PICK_REFS[@]}"; do
77+
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref
78+
git cherry-pick --no-commit FETCH_HEAD
79+
done
80+
else
81+
echo Reusing existing Fuchsia checkout
82+
cd $checkout
83+
fi
5084

85+
# Run the script inside the Fuchsia checkout responsible for building Fuchsia.
86+
# You can change arguments to the build by setting KEEP_CHECKOUT=1 above and
87+
# modifying them in build_fuchsia_from_rust_ci.sh.
5188
bash scripts/rust/build_fuchsia_from_rust_ci.sh

0 commit comments

Comments
 (0)