|
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 |
| -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) |
9 | 21 | PICK_REFS=()
|
10 | 22 |
|
| 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 | + |
11 | 27 | checkout=fuchsia
|
12 | 28 | jiri=.jiri_root/bin/jiri
|
13 | 29 |
|
14 | 30 | set -x
|
15 | 31 |
|
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 |
41 | 39 |
|
42 |
| -$jiri update -autoupdate=false |
| 40 | + cd $checkout |
43 | 41 |
|
44 |
| -echo integration commit = $(git -C integration rev-parse HEAD) |
| 42 | + $jiri init \ |
| 43 | + -partial=true \ |
| 44 | + -analytics-opt=false \ |
| 45 | + . |
45 | 46 |
|
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 |
50 | 70 |
|
| 71 | +# Run the script inside the Fuchsia checkout responsible for building Fuchsia. |
| 72 | +# You can change arguments to the build by modifying this script. |
51 | 73 | bash scripts/rust/build_fuchsia_from_rust_ci.sh
|
0 commit comments