diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 37a441628b..4df0075258 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 \ @@ -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 \ @@ -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 \ diff --git a/ci/actions-templates/linux-builds-template.yaml b/ci/actions-templates/linux-builds-template.yaml index 97ccba5a3d..98320f6d66 100644 --- a/ci/actions-templates/linux-builds-template.yaml +++ b/ci/actions-templates/linux-builds-template.yaml @@ -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 \ diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index 5bfc6622e8..85ed7668f6 100644 --- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/ci/docker/aarch64-unknown-linux-musl/Dockerfile index a83a3a6bfb..a99ae4e21e 100644 --- a/ci/docker/aarch64-unknown-linux-musl/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-musl/Dockerfile @@ -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 \ diff --git a/ci/docker/android/Dockerfile b/ci/docker/android/Dockerfile index b80dd39d08..77dc569ee5 100644 --- a/ci/docker/android/Dockerfile +++ b/ci/docker/android/Dockerfile @@ -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/ \ diff --git a/ci/docker/arm-unknown-linux-gnueabi/Dockerfile b/ci/docker/arm-unknown-linux-gnueabi/Dockerfile index 7f6f9e99a4..fb8b137d94 100644 --- a/ci/docker/arm-unknown-linux-gnueabi/Dockerfile +++ b/ci/docker/arm-unknown-linux-gnueabi/Dockerfile @@ -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 diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile index bcd01b54f7..ba60e28202 100644 --- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -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 diff --git a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile index 10ab476849..c2aee75771 100644 --- a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile @@ -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 diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile index a634c8439d..f99f4e3870 100644 --- a/ci/docker/i686-unknown-linux-gnu/Dockerfile +++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -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: - RUN yum upgrade -y && \ - yum install -y perl-IPC-Cmd +# Install `perl-IPC-Cmd` to make OpenSSL v3 happy. +# See: +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 diff --git a/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile b/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile index cc1abc93a3..7a73233fbe 100644 --- a/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/loongarch64-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/loongarch64-unknown-linux-musl/Dockerfile b/ci/docker/loongarch64-unknown-linux-musl/Dockerfile index 2dd576729e..605a695d46 100644 --- a/ci/docker/loongarch64-unknown-linux-musl/Dockerfile +++ b/ci/docker/loongarch64-unknown-linux-musl/Dockerfile @@ -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 diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index 1c181e6944..62b0aacb6c 100644 --- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index 4256deec46..cb757b49ca 100644 --- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index 38bd77aec7..31c31a5dbc 100644 --- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile index ecb8e2e12e..b65c26939c 100644 --- a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile index 63078b25cf..d9adbe6c60 100644 --- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -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 diff --git a/ci/run.bash b/ci/run.bash index af7e7f8820..978ab6af26 100644 --- a/ci/run.bash +++ b/ci/run.bash @@ -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-backend,reqwest-native-tls') case "$(uname -s)" in