Skip to content

Commit

Permalink
ci(linux): move bindgen-cli installation into run.bash
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Dec 21, 2024
1 parent 759ad7d commit 66269c4
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ jobs:
--env LIBZ_SYS_STATIC=1 \
--env SKIP_TESTS="${SKIP_TESTS}" \
--env TARGET="${TARGET}" \
--env INSTALL_BINDGEN=1 \
--init \
--rm \
--tty \
Expand Down Expand Up @@ -785,6 +786,7 @@ jobs:
--env LIBZ_SYS_STATIC=1 \
--env SKIP_TESTS="${SKIP_TESTS}" \
--env TARGET="${TARGET}" \
--env INSTALL_BINDGEN=1 \
--init \
--rm \
--tty \
Expand Down Expand Up @@ -971,6 +973,7 @@ jobs:
--env LIBZ_SYS_STATIC=1 \
--env SKIP_TESTS="${SKIP_TESTS}" \
--env TARGET="${TARGET}" \
--env INSTALL_BINDGEN=1 \
--init \
--rm \
--tty \
Expand Down
1 change: 1 addition & 0 deletions ci/actions-templates/linux-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs: # skip-master skip-pr skip-stable
--env LIBZ_SYS_STATIC=1 \
--env SKIP_TESTS="${SKIP_TESTS}" \
--env TARGET="${TARGET}" \
--env INSTALL_BINDGEN=1 \
--init \
--rm \
--tty \
Expand Down
4 changes: 1 addition & 3 deletions ci/docker/aarch64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-aarch64-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnu-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-unknown-linux-gnu-gcc
4 changes: 1 addition & 3 deletions ci/docker/aarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-aarch64-unknown-linux-musl

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc \
Expand Down
4 changes: 1 addition & 3 deletions ci/docker/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-android

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV PATH=$PATH:/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin \
ANDROID_NDK=/android/ndk/ \
Expand Down
4 changes: 1 addition & 3 deletions ci/docker/arm-unknown-linux-gnueabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-arm-unknown-linux-gnueabi

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABI_LINKER=arm-unknown-linux-gnueabi-gcc
4 changes: 1 addition & 3 deletions ci/docker/arm-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-arm-unknown-linux-gnueabihf

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-unknown-linux-gnueabihf-gcc
4 changes: 1 addition & 3 deletions ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-armv7-unknown-linux-gnueabihf

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc
17 changes: 7 additions & 10 deletions ci/docker/i686-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
FROM rust-i686-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin

# Install `perl-IPC-Cmd` to make OpenSSL v3 happy.
# See: <https://github.com/sfackler/rust-openssl/issues/1550>
RUN yum upgrade -y && \
yum install -y perl-IPC-Cmd
# Install `perl-IPC-Cmd` to make OpenSSL v3 happy.
# See: <https://github.com/sfackler/rust-openssl/issues/1550>
RUN yum upgrade -y && \
yum install -y perl-IPC-Cmd \
# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
glibc-devel.i686 clang-libs
4 changes: 1 addition & 3 deletions ci/docker/loongarch64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-loongarch64-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-gcc \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_GNU_LINKER=loongarch64-unknown-linux-gnu-gcc
4 changes: 1 addition & 3 deletions ci/docker/loongarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-loongarch64-unknown-linux-musl

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER=loongarch64-unknown-linux-musl-gcc
4 changes: 1 addition & 3 deletions ci/docker/powerpc-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-powerpc-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_powerpc_unknown_linux_gnu=powerpc-unknown-linux-gnu-gcc \
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-unknown-linux-gnu-gcc
4 changes: 1 addition & 3 deletions ci/docker/powerpc64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-powerpc64-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_powerpc64_unknown_linux_gnu=powerpc64-unknown-linux-gnu-gcc \
CARGO_TARGET_POWERPC64_UNKNOWN_LINUX_GNU_LINKER=powerpc64-unknown-linux-gnu-gcc
4 changes: 1 addition & 3 deletions ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-powerpc64le-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-gcc \
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc
4 changes: 1 addition & 3 deletions ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-riscv64gc-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \
CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-unknown-linux-gnu-gcc
4 changes: 1 addition & 3 deletions ci/docker/s390x-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM rust-s390x-unknown-linux-gnu

# Building `aws-lc-rs` for Linux depends on `gcc-multilib`, `libclang` and `bindgen`.
# See: https://aws.github.io/aws-lc-rs/requirements/linux
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev \
&& curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh \
&& mv $HOME/.cargo/bin/bindgen /usr/bin
RUN apt-get update && apt-get install -qy gcc-multilib libclang-dev

ENV CC_s390x_unknown_linux_gnu=s390x-ibm-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-ibm-linux-gnu-gcc
12 changes: 12 additions & 0 deletions ci/run.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ export RUST_BACKTRACE=1
rustc -vV
cargo -vV

if [ -n "$INSTALL_BINDGEN" ]; then
if ! curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rust-lang/rust-bindgen/releases/latest/download/bindgen-cli-installer.sh | sh -s -- --no-modify-path \
| grep "everything's installed!";
# Ignoring exit code since the script might fail to write the receipt after a successful installation.
then
cargo install --force --locked bindgen-cli
fi
mkdir "$CARGO_HOME"/bin/bindgen-cli
mv "$CARGO_HOME"/bin/bindgen "$CARGO_HOME"/bin/bindgen-cli/
export PATH="$CARGO_HOME/bin/bindgen-cli:$PATH"
fi


FEATURES=('--no-default-features' '--features' 'curl-backend,reqwest-native-tls')
case "$(uname -s)" in
Expand Down

0 comments on commit 66269c4

Please sign in to comment.