|
2 | 2 |
|
3 | 3 | # Downloads and builds the Fuchsia operating system using a toolchain installed
|
4 | 4 | # 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 |
5 | 9 |
|
6 | 10 | set -euf -o pipefail
|
7 | 11 |
|
8 | 12 | 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) |
9 | 23 | PICK_REFS=()
|
10 | 24 |
|
| 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 | + |
11 | 29 | checkout=fuchsia
|
12 | 30 | jiri=.jiri_root/bin/jiri
|
13 | 31 |
|
14 | 32 | set -x
|
15 | 33 |
|
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 |
41 | 43 |
|
42 |
| -$jiri update -autoupdate=false |
| 44 | + $jiri init \ |
| 45 | + -partial=true \ |
| 46 | + -analytics-opt=false \ |
| 47 | + . |
43 | 48 |
|
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" |
45 | 55 |
|
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 |
50 | 72 |
|
| 73 | +# Run the script inside the Fuchsia checkout responsible for building Fuchsia. |
| 74 | +# You can change arguments to the build by modifying this script. |
51 | 75 | bash scripts/rust/build_fuchsia_from_rust_ci.sh
|
0 commit comments