mirror of https://github.com/briansmith/webpki
CI/CD: Update CI/CD to version used in *ring* main branch.
This commit is contained in:
parent
7f67834712
commit
e12b2ec06e
|
@ -3,6 +3,64 @@ on:
|
|||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
audit:
|
||||
# Don't run duplicate `push` jobs for the repo owner's PRs.
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
steps:
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/cargo-audit
|
||||
~/.cargo/.crates.toml
|
||||
~/.cargo/.crates2.json
|
||||
key: ${{ runner.os }}-v2-cargo-audit-0.13.1
|
||||
|
||||
- run: cargo install cargo-audit --vers "0.13.1"
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- run: cargo generate-lockfile
|
||||
|
||||
- run: cargo audit --deny warnings
|
||||
|
||||
# Verify that documentation builds.
|
||||
rustdoc:
|
||||
# Don't run duplicate `push` jobs for the repo owner's PRs.
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
runs-on: ubuntu-18.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust_channel:
|
||||
- stable
|
||||
- beta
|
||||
# TODO: Fix nightly compatibility
|
||||
# - nightly
|
||||
|
||||
include:
|
||||
- target: x86_64-unknown-linux-gnu
|
||||
|
||||
steps:
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
override: true
|
||||
target: ${{ matrix.target }}
|
||||
toolchain: ${{ matrix.rust_channel }}
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- run: |
|
||||
cargo doc --all-features
|
||||
|
||||
test:
|
||||
# Don't run duplicate `push` jobs for the repo owner's PRs.
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
@ -16,10 +74,13 @@ jobs:
|
|||
|
||||
target:
|
||||
- aarch64-apple-ios
|
||||
- aarch64-apple-darwin
|
||||
- aarch64-linux-android
|
||||
- aarch64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-musl
|
||||
- arm-unknown-linux-gnueabihf
|
||||
- armv7-linux-androideabi
|
||||
- armv7-unknown-linux-musleabihf
|
||||
- i686-pc-windows-msvc
|
||||
- i686-unknown-linux-gnu
|
||||
- i686-unknown-linux-musl
|
||||
|
@ -38,10 +99,21 @@ jobs:
|
|||
- beta
|
||||
- nightly
|
||||
|
||||
exclude:
|
||||
# The stable channel doesn't have aarch64-apple-darwin support yet.
|
||||
- target: aarch64-apple-darwin
|
||||
rust_channel: stable
|
||||
|
||||
include:
|
||||
- target: aarch64-apple-darwin
|
||||
# macos-latest didn't work.
|
||||
host_os: macos-11.0
|
||||
# GitHub Actions doesn't have a way to run this target yet.
|
||||
cargo_options: --no-run
|
||||
|
||||
- target: aarch64-apple-ios
|
||||
host_os: macos-latest
|
||||
# GitHub Actions doesn't have a way to run aarch64-apple-ios.
|
||||
# GitHub Actions doesn't have a way to run this target yet.
|
||||
cargo_options: --no-run
|
||||
|
||||
- target: aarch64-linux-android
|
||||
|
@ -52,6 +124,9 @@ jobs:
|
|||
- target: aarch64-unknown-linux-gnu
|
||||
host_os: ubuntu-18.04
|
||||
|
||||
- target: aarch64-unknown-linux-musl
|
||||
host_os: ubuntu-18.04
|
||||
|
||||
- target: arm-unknown-linux-gnueabihf
|
||||
host_os: ubuntu-18.04
|
||||
|
||||
|
@ -60,6 +135,11 @@ jobs:
|
|||
# TODO: https://github.com/briansmith/ring/issues/838
|
||||
cargo_options: --no-run
|
||||
|
||||
- target: armv7-unknown-linux-musleabihf
|
||||
host_os: ubuntu-18.04
|
||||
# TODO: https://github.com/briansmith/ring/issues/1115
|
||||
cargo_options: --no-run
|
||||
|
||||
- target: i686-pc-windows-msvc
|
||||
host_os: windows-latest
|
||||
|
||||
|
@ -85,6 +165,9 @@ jobs:
|
|||
host_os: ubuntu-18.04
|
||||
|
||||
steps:
|
||||
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
|
||||
run: sudo apt-get update -y
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
||||
|
@ -93,31 +176,136 @@ jobs:
|
|||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
override: true
|
||||
profile: minimal
|
||||
target: ${{ matrix.target }}
|
||||
toolchain: ${{ matrix.rust_channel }}
|
||||
|
||||
- if: ${{ matrix.target == 'aarch64-apple-darwin' }}
|
||||
run: echo "DEVELOPER_DIR=/Applications/Xcode_12.2.app/Contents/Developer" >> $GITHUB_ENV
|
||||
|
||||
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
||||
run: |
|
||||
PATH=${ANDROID_SDK_ROOT}/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH \
|
||||
CC_aarch64_linux_android=aarch64-linux-android21-clang \
|
||||
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang \
|
||||
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -L /usr/aarch64-linux-gnu" \
|
||||
CC_arm_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
|
||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
|
||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \
|
||||
CC_armv7_linux_androideabi=armv7a-linux-androideabi18-clang \
|
||||
CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi18-clang \
|
||||
CC_i686_unknown_linux_gnu=clang \
|
||||
CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang \
|
||||
CC_i686_unknown_linux_musl=clang \
|
||||
CARGO_TARGET_i686_UNKNOWN_LINUX_MUSL_LINKER=clang \
|
||||
CC_x86_64_unknown_linux_musl=clang \
|
||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=clang \
|
||||
cargo test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
||||
mk/cargo.sh test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
||||
|
||||
- if: ${{ contains(matrix.host_os, 'windows') }}
|
||||
run: |
|
||||
cargo test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
||||
|
||||
# The wasm32-unknown-unknown targets have a different set of feature sets and
|
||||
# an additional `webdriver` dimension.
|
||||
test-wasm32:
|
||||
# Don't run duplicate `push` jobs for the repo owner's PRs.
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
runs-on: ${{ matrix.host_os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
features:
|
||||
- # Default
|
||||
host_os:
|
||||
- ubuntu-18.04
|
||||
mode:
|
||||
- # debug
|
||||
- --release
|
||||
rust_channel:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
target:
|
||||
- wasm32-unknown-unknown
|
||||
webdriver:
|
||||
- GECKODRIVER=geckodriver
|
||||
- CHROMEDRIVER=chromedriver
|
||||
|
||||
steps:
|
||||
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
|
||||
run: sudo apt-get update -y
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- run: cargo generate-lockfile
|
||||
|
||||
- run: mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
override: true
|
||||
target: ${{ matrix.target }}
|
||||
toolchain: ${{ matrix.rust_channel }}
|
||||
|
||||
- run: |
|
||||
${{ matrix.webdriver }} mk/cargo.sh test -vv --target=${{ matrix.target }} ${{ matrix.features }} ${{ matrix.mode }}
|
||||
|
||||
coverage:
|
||||
# Don't run duplicate `push` jobs for the repo owner's PRs.
|
||||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
runs-on: ${{ matrix.host_os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
features:
|
||||
- --all-features
|
||||
|
||||
# TODO: targets
|
||||
target:
|
||||
- aarch64-unknown-linux-gnu
|
||||
- i686-unknown-linux-gnu
|
||||
- x86_64-unknown-linux-musl
|
||||
|
||||
mode:
|
||||
- # debug
|
||||
|
||||
# Coverage collection is Nightly-only
|
||||
rust_channel:
|
||||
- nightly
|
||||
|
||||
# TODO: targets
|
||||
include:
|
||||
# TODO: Use the -musl target after
|
||||
# https://github.com/rust-lang/rust/issues/79556 and
|
||||
# https://github.com/rust-lang/rust/issues/79555 are fixed.
|
||||
- target: aarch64-unknown-linux-gnu
|
||||
host_os: ubuntu-18.04
|
||||
|
||||
# TODO: Use the -musl target after
|
||||
# https://github.com/rust-lang/rust/issues/79556 and
|
||||
# https://github.com/rust-lang/rust/issues/79555 are fixed.
|
||||
- target: i686-unknown-linux-gnu
|
||||
host_os: ubuntu-18.04
|
||||
|
||||
- target: x86_64-unknown-linux-musl
|
||||
host_os: ubuntu-18.04
|
||||
|
||||
# TODO: Add an ARM target after
|
||||
# https://github.com/rust-lang/rust/issues/79555 is fixed. This may
|
||||
# require https://github.com/rust-lang/rust/issues/79555 to be fixed
|
||||
# too.
|
||||
|
||||
steps:
|
||||
- if: ${{ contains(matrix.host_os, 'ubuntu') }}
|
||||
run: sudo apt-get update -y
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
||||
run: RING_COVERAGE=1 mk/install-build-tools.sh --target=${{ matrix.target }} ${{ matrix.features }}
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
override: true
|
||||
target: ${{ matrix.target }}
|
||||
toolchain: ${{ matrix.rust_channel }}
|
||||
|
||||
- if: ${{ matrix.target == 'aarch64-apple-darwin' }}
|
||||
run: echo "DEVELOPER_DIR=/Applications/Xcode_12.2.app/Contents/Developer" >> $GITHUB_ENV
|
||||
|
||||
- if: ${{ !contains(matrix.host_os, 'windows') }}
|
||||
run: |
|
||||
RING_COVERAGE=1 mk/cargo.sh +${{ matrix.rust_channel }} test -vv --target=${{ matrix.target }} ${{ matrix.cargo_options }} ${{ matrix.features }} ${{ matrix.mode }}
|
||||
|
||||
- uses: codecov/codecov-action@v1
|
||||
with:
|
||||
directory: ./target/${{ matrix.target }}/debug/coverage/reports
|
||||
fail_ci_if_error: true
|
||||
verbose: true
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright 2020 Brian Smith.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
||||
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
set -eux -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
rustflags_self_contained="-Clink-self-contained=yes -Clinker=rust-lld"
|
||||
qemu_aarch64="qemu-aarch64 -L /usr/aarch64-linux-gnu"
|
||||
qemu_arm="qemu-arm -L /usr/arm-linux-gnueabihf"
|
||||
|
||||
# Avoid putting the Android tools in `$PATH` because there are tools in this
|
||||
# directory like `clang` that would conflict with the same-named tools that may
|
||||
# be needed to compile the build script, or to compile for other targets.
|
||||
if [ -n "${ANDROID_SDK_ROOT-}" ]; then
|
||||
android_tools=$ANDROID_SDK_ROOT/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
|
||||
fi
|
||||
|
||||
for arg in $*; do
|
||||
case $arg in
|
||||
--target=*)
|
||||
target=${arg#*=}
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# See comments in install-build-tools.sh.
|
||||
llvm_version=10
|
||||
if [ -n "${RING_COVERAGE-}" ]; then
|
||||
llvm_version=11
|
||||
fi
|
||||
|
||||
case $target in
|
||||
aarch64-linux-android)
|
||||
export CC_aarch64_linux_android=$android_tools/aarch64-linux-android21-clang
|
||||
export AR_aarch64_linux_android=$android_tools/aarch64-linux-android-ar
|
||||
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$android_tools/aarch64-linux-android21-clang
|
||||
;;
|
||||
aarch64-unknown-linux-gnu)
|
||||
export CC_aarch64_unknown_linux_gnu=clang-$llvm_version
|
||||
export AR_aarch64_unknown_linux_gnu=llvm-ar-$llvm_version
|
||||
export CFLAGS_aarch64_unknown_linux_gnu="--sysroot=/usr/aarch64-linux-gnu"
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="$qemu_aarch64"
|
||||
;;
|
||||
aarch64-unknown-linux-musl)
|
||||
export CC_aarch64_unknown_linux_musl=clang-$llvm_version
|
||||
export AR_aarch64_unknown_linux_musl=llvm-ar-$llvm_version
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained"
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER="$qemu_aarch64"
|
||||
;;
|
||||
arm-unknown-linux-gnueabihf)
|
||||
export CC_arm_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc
|
||||
export AR_arm_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc-ar
|
||||
export CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
|
||||
export CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER="$qemu_arm"
|
||||
;;
|
||||
armv7-linux-androideabi)
|
||||
export CC_armv7_linux_androideabi=$android_tools/armv7a-linux-androideabi18-clang
|
||||
export AR_armv7_linux_androideabi=$android_tools/arm-linux-androideabi-ar
|
||||
export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=$android_tools/armv7a-linux-androideabi18-clang
|
||||
;;
|
||||
armv7-unknown-linux-musleabihf)
|
||||
export CC_armv7_unknown_linux_musleabihf=clang-$llvm_version
|
||||
export AR_armv7_unknown_linux_musleabihf=llvm-ar-$llvm_version
|
||||
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_RUSTFLAGS="$rustflags_self_contained"
|
||||
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="$qemu_arm"
|
||||
;;
|
||||
i686-unknown-linux-gnu)
|
||||
export CC_i686_unknown_linux_gnu=clang-$llvm_version
|
||||
export AR_i686_unknown_linux_gnu=llvm-ar-$llvm_version
|
||||
export CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang-$llvm_version
|
||||
;;
|
||||
i686-unknown-linux-musl)
|
||||
export CC_i686_unknown_linux_musl=clang-$llvm_version
|
||||
export AR_i686_unknown_linux_musl=llvm-ar-$llvm_version
|
||||
export CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained"
|
||||
;;
|
||||
x86_64-unknown-linux-musl)
|
||||
export CC_x86_64_unknown_linux_musl=clang-$llvm_version
|
||||
export AR_x86_64_unknown_linux_musl=llvm-ar-$llvm_version
|
||||
# XXX: Work around https://github.com/rust-lang/rust/issues/79555.
|
||||
if [ -n "${RING_COVERAGE-}" ]; then
|
||||
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=clang-$llvm_version
|
||||
else
|
||||
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained"
|
||||
fi
|
||||
;;
|
||||
wasm32-unknown-unknown)
|
||||
# The first two are only needed for when the "wasm_c" feature is enabled.
|
||||
export CC_wasm32_unknown_unknown=clang-$llvm_version
|
||||
export AR_wasm32_unknown_unknown=llvm-ar-$llvm_version
|
||||
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "${RING_COVERAGE-}" ]; then
|
||||
# XXX: Collides between release and debug.
|
||||
coverage_dir=$PWD/target/$target/debug/coverage
|
||||
mkdir -p "$coverage_dir"
|
||||
rm -f "$coverage_dir/*.profraw"
|
||||
|
||||
export RING_BUILD_EXECUTABLE_LIST="$coverage_dir/executables"
|
||||
truncate --size=0 "$RING_BUILD_EXECUTABLE_LIST"
|
||||
|
||||
# This doesn't work when profiling under QEMU. Instead mk/runner does
|
||||
# something similar but different.
|
||||
# export LLVM_PROFILE_FILE="$coverage_dir/%m.profraw"
|
||||
|
||||
# ${target} with hyphens replaced by underscores, lowercase and uppercase.
|
||||
target_lower=${target//-/_}
|
||||
target_upper=${target_lower^^}
|
||||
|
||||
cflags_var=CFLAGS_${target_lower}
|
||||
declare -x "${cflags_var}=-fprofile-instr-generate -fcoverage-mapping ${!cflags_var-}"
|
||||
|
||||
runner_var=CARGO_TARGET_${target_upper}_RUNNER
|
||||
declare -x "${runner_var}=mk/runner ${!runner_var-}"
|
||||
|
||||
rustflags_var=CARGO_TARGET_${target_upper}_RUSTFLAGS
|
||||
declare -x "${rustflags_var}=-Zinstrument-coverage ${!rustflags_var-}"
|
||||
fi
|
||||
|
||||
cargo "$@"
|
||||
|
||||
if [ -n "${RING_COVERAGE-}" ]; then
|
||||
while read executable; do
|
||||
basename=$(basename "$executable")
|
||||
llvm-profdata-$llvm_version merge -sparse ""$coverage_dir"/$basename.profraw" -o "$coverage_dir"/$basename.profdata
|
||||
mkdir -p "$coverage_dir"/reports
|
||||
llvm-cov-$llvm_version export \
|
||||
--instr-profile "$coverage_dir"/$basename.profdata \
|
||||
--format lcov \
|
||||
"$executable" \
|
||||
> "$coverage_dir"/reports/coverage-$basename.txt
|
||||
done < "$RING_BUILD_EXECUTABLE_LIST"
|
||||
fi
|
|
@ -24,6 +24,7 @@ function install_packages {
|
|||
sudo apt-get -yq --no-install-suggests --no-install-recommends install "$@"
|
||||
}
|
||||
|
||||
use_clang=
|
||||
case $target in
|
||||
--target*android*)
|
||||
mkdir -p "${ANDROID_SDK_ROOT}/licenses"
|
||||
|
@ -37,32 +38,40 @@ esac
|
|||
|
||||
case $target in
|
||||
--target=aarch64-unknown-linux-gnu)
|
||||
# Clang is needed for code coverage.
|
||||
use_clang=1
|
||||
install_packages \
|
||||
qemu-user \
|
||||
gcc-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross
|
||||
;;
|
||||
--target=aarch64-unknown-linux-musl|--target=armv7-unknown-linux-musleabihf)
|
||||
use_clang=1
|
||||
install_packages \
|
||||
qemu-user
|
||||
;;
|
||||
--target=arm-unknown-linux-gnueabihf)
|
||||
install_packages \
|
||||
qemu-user \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
libc6-dev-armhf-cross
|
||||
;;
|
||||
--target=i686-unknown-linux-gnu|--target=i686-unknown-linux-musl)
|
||||
# TODO: musl i686 shouldn't be using gcc-multilib or libc6-dev-i386.
|
||||
--target=i686-unknown-linux-gnu)
|
||||
use_clang=1
|
||||
install_packages \
|
||||
gcc-multilib \
|
||||
libc6-dev-i386
|
||||
;;
|
||||
--target=i686-unknown-linux-musl|--target=x86_64-unknown-linux-musl)
|
||||
use_clang=1
|
||||
;;
|
||||
--target=wasm32-unknown-unknown)
|
||||
cargo install wasm-bindgen-cli --vers "0.2.68" --bin wasm-bindgen-test-runner
|
||||
# The version of wasm-bindgen-cli must match the wasm-bindgen version.
|
||||
wasm_bindgen_version=$(cargo metadata --format-version 1 | jq -r '.packages | map(select( .name == "wasm-bindgen")) | map(.version) | .[0]')
|
||||
cargo install wasm-bindgen-cli --vers "$wasm_bindgen_version" --bin wasm-bindgen-test-runner
|
||||
case ${features-} in
|
||||
*wasm32_c*)
|
||||
# "wasm_c" has only been tested with clang-10 and llvm-ar-10. The build
|
||||
# will fail when using some older versions.
|
||||
install_packages \
|
||||
clang-10 \
|
||||
llvm-10
|
||||
use_clang=1
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
|
@ -71,3 +80,16 @@ case $target in
|
|||
--target=*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$use_clang" ]; then
|
||||
llvm_version=10
|
||||
if [ -n "${RING_COVERAGE-}" ]; then
|
||||
# https://github.com/rust-lang/rust/pull/79365 upgraded the coverage file
|
||||
# format to one that only LLVM 11+ can use
|
||||
llvm_version=11
|
||||
sudo apt-key add mk/llvm-snapshot.gpg.key
|
||||
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$llvm_version main"
|
||||
sudo apt-get update
|
||||
fi
|
||||
install_packages clang-$llvm_version llvm-$llvm_version
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.12 (GNU/Linux)
|
||||
Comment: See https://apt.llvm.org/.
|
||||
Comment: Fingerprint: 6084 F3CF 814B 57C1 CF12 EFD5 15CF 4D18 AF4F 7421
|
||||
|
||||
mQINBFE9lCwBEADi0WUAApM/mgHJRU8lVkkw0CHsZNpqaQDNaHefD6Rw3S4LxNmM
|
||||
EZaOTkhP200XZM8lVdbfUW9xSjA3oPldc1HG26NjbqqCmWpdo2fb+r7VmU2dq3NM
|
||||
R18ZlKixiLDE6OUfaXWKamZsXb6ITTYmgTO6orQWYrnW6ckYHSeaAkW0wkDAryl2
|
||||
B5v8aoFnQ1rFiVEMo4NGzw4UX+MelF7rxaaregmKVTPiqCOSPJ1McC1dHFN533FY
|
||||
Wh/RVLKWo6npu+owtwYFQW+zyQhKzSIMvNujFRzhIxzxR9Gn87MoLAyfgKEzrbbT
|
||||
DhqqNXTxS4UMUKCQaO93TzetX/EBrRpJj+vP640yio80h4Dr5pAd7+LnKwgpTDk1
|
||||
G88bBXJAcPZnTSKu9I2c6KY4iRNbvRz4i+ZdwwZtdW4nSdl2792L7Sl7Nc44uLL/
|
||||
ZqkKDXEBF6lsX5XpABwyK89S/SbHOytXv9o4puv+65Ac5/UShspQTMSKGZgvDauU
|
||||
cs8kE1U9dPOqVNCYq9Nfwinkf6RxV1k1+gwtclxQuY7UpKXP0hNAXjAiA5KS5Crq
|
||||
7aaJg9q2F4bub0mNU6n7UI6vXguF2n4SEtzPRk6RP+4TiT3bZUsmr+1ktogyOJCc
|
||||
Ha8G5VdL+NBIYQthOcieYCBnTeIH7D3Sp6FYQTYtVbKFzmMK+36ERreL/wARAQAB
|
||||
tD1TeWx2ZXN0cmUgTGVkcnUgLSBEZWJpYW4gTExWTSBwYWNrYWdlcyA8c3lsdmVz
|
||||
dHJlQGRlYmlhbi5vcmc+iQI4BBMBAgAiBQJRPZQsAhsDBgsJCAcDAgYVCAIJCgsE
|
||||
FgIDAQIeAQIXg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|
||||
1GBGvpHvL2WizEwdk+nfk8LtrLzej+9FtIcq3uIrYnsac47Pf7p0otcFeTJTjSq3
|
||||
krCaoG4Hx0zGQG2ZFpHrSrZTVy6lxvIdfi0beMgY6h78p6M9eYZHQHc02DjFkQXN
|
||||
bXb5c6gCHESH5PXwPU4jQEE7Ib9J6sbk7ZT2Mw==
|
||||
=j+4q
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
set -eux -o pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
for arg in $*; do
|
||||
# There can be some arguments prefixed in front of the executable, e.g.
|
||||
# when qemu-user is used. There can be arguments after the executable,
|
||||
# e.g. `cargo test` arguments like `TESTNAME`.
|
||||
if [[ $arg = */deps/* ]]; then
|
||||
executable=$arg
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
export LLVM_PROFILE_FILE=$(dirname "$RING_BUILD_EXECUTABLE_LIST")/$(basename "$executable").profraw
|
||||
|
||||
if [ -n "$RING_BUILD_EXECUTABLE_LIST" ]; then
|
||||
echo "$executable" >> "$RING_BUILD_EXECUTABLE_LIST"
|
||||
fi
|
||||
|
||||
$*
|
Loading…
Reference in New Issue