-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Fuchsia in CI #117771
Merged
Merged
Build Fuchsia in CI #117771
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/ci/docker/host-x86_64/x86_64-gnu-integration/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
g++ \ | ||
make \ | ||
ninja-build \ | ||
file \ | ||
curl \ | ||
ca-certificates \ | ||
python3 \ | ||
git \ | ||
cmake \ | ||
libssl-dev \ | ||
sudo \ | ||
xz-utils \ | ||
pkg-config \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Duplicated in dist-various-2 Dockerfile. | ||
# FIXME: Move to canonical triple | ||
ENV \ | ||
AR_x86_64_fuchsia=x86_64-unknown-fuchsia-ar \ | ||
CC_x86_64_fuchsia=x86_64-unknown-fuchsia-clang \ | ||
CFLAGS_x86_64_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \ | ||
CXX_x86_64_fuchsia=x86_64-unknown-fuchsia-clang++ \ | ||
CXXFLAGS_x86_64_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \ | ||
LDFLAGS_x86_64_fuchsia="--target=x86_64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib" | ||
|
||
WORKDIR /tmp | ||
COPY scripts/shared.sh /tmp/ | ||
COPY scripts/build-fuchsia-toolchain.sh /tmp/ | ||
RUN /tmp/build-fuchsia-toolchain.sh | ||
|
||
ENV CARGO_TARGET_X86_64_FUCHSIA_AR /usr/local/bin/llvm-ar | ||
ENV CARGO_TARGET_X86_64_FUCHSIA_RUSTFLAGS \ | ||
-C panic=abort \ | ||
-C force-unwind-tables=yes \ | ||
-C link-arg=--sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot \ | ||
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/sysroot/lib \ | ||
-Lnative=/usr/local/core-linux-amd64-fuchsia-sdk/arch/x64/lib | ||
|
||
ENV TARGETS=x86_64-fuchsia | ||
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnu | ||
|
||
COPY scripts/sccache.sh /scripts/ | ||
RUN sh /scripts/sccache.sh | ||
|
||
ENV RUST_INSTALL_DIR /checkout/obj/install | ||
RUN mkdir -p $RUST_INSTALL_DIR/etc | ||
|
||
ENV RUST_CONFIGURE_ARGS \ | ||
--prefix=$RUST_INSTALL_DIR \ | ||
--sysconfdir=etc \ | ||
--enable-lld \ | ||
--llvm-libunwind=in-tree \ | ||
--enable-extended \ | ||
--disable-docs \ | ||
--set target.x86_64-fuchsia.cc=/usr/local/bin/clang \ | ||
--set target.x86_64-fuchsia.cxx=/usr/local/bin/clang++ \ | ||
--set target.x86_64-fuchsia.ar=/usr/local/bin/llvm-ar \ | ||
--set target.x86_64-fuchsia.ranlib=/usr/local/bin/llvm-ranlib \ | ||
--set target.x86_64-fuchsia.linker=/usr/local/bin/ld.lld | ||
ENV SCRIPT \ | ||
python3 ../x.py install --target $TARGETS compiler/rustc library/std clippy && \ | ||
bash ../src/ci/docker/host-x86_64/x86_64-gnu-integration/build-fuchsia.sh |
51 changes: 51 additions & 0 deletions
51
src/ci/docker/host-x86_64/x86_64-gnu-integration/build-fuchsia.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Downloads and builds the Fuchsia operating system using a toolchain installed | ||
# in $RUST_INSTALL_DIR. | ||
|
||
set -euf -o pipefail | ||
|
||
INTEGRATION_SHA=66793c4894bf6204579bbee3b79956335f31c768 | ||
PICK_REFS=() | ||
|
||
checkout=fuchsia | ||
jiri=.jiri_root/bin/jiri | ||
|
||
set -x | ||
|
||
# This script will: | ||
# - create a directory named "fuchsia" if it does not exist | ||
# - download "jiri" to "fuchsia/.jiri_root/bin" | ||
curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" \ | ||
| base64 --decode \ | ||
| bash -s $checkout | ||
|
||
cd $checkout | ||
|
||
$jiri init \ | ||
-partial=true \ | ||
-analytics-opt=false \ | ||
. | ||
|
||
$jiri import \ | ||
-name=integration \ | ||
-revision=$INTEGRATION_SHA \ | ||
-overwrite=true \ | ||
flower \ | ||
"https://fuchsia.googlesource.com/integration" | ||
|
||
if [ -d ".git" ]; then | ||
# Wipe out any local changes if we're reusing a checkout. | ||
git checkout --force JIRI_HEAD | ||
fi | ||
|
||
$jiri update -autoupdate=false | ||
|
||
echo integration commit = $(git -C integration rev-parse HEAD) | ||
|
||
for git_ref in "${PICK_REFS[@]}"; do | ||
git fetch https://fuchsia.googlesource.com/fuchsia $git_ref | ||
git cherry-pick --no-commit FETCH_HEAD | ||
done | ||
|
||
bash scripts/rust/build_fuchsia_from_rust_ci.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: We should try to reduce builder sizes where it's not adding value. Historically 16 core builders rarely make things that much faster -- once this lands and we collect a few dozen builds we can re-evaluate, perhaps at the next bump point for the pinned commit.