Install xargo once (#4753)
This commit is contained in:
@ -10,23 +10,17 @@ if [ ! -f "$1/Cargo.toml" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Building $1"
|
echo "Building $1"
|
||||||
|
|
||||||
pushd "$(dirname "$0")"
|
|
||||||
bpf_sdk="$PWD/.."
|
|
||||||
popd
|
|
||||||
|
|
||||||
cd "$1"
|
|
||||||
|
|
||||||
cargo install xargo
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")" && bpf_sdk="$PWD/.."
|
||||||
|
|
||||||
# Ensure the sdk is installed
|
# Ensure the sdk is installed
|
||||||
"$bpf_sdk"/scripts/install.sh
|
"$bpf_sdk"/scripts/install.sh
|
||||||
|
|
||||||
# Use the SDK's version of llvm to build the compiler-builtins for BPF
|
# Use the SDK's version of llvm to build the compiler-builtins for BPF
|
||||||
export CC="$bpf_sdk/dependencies/llvm-native/bin/clang"
|
export CC="$bpf_sdk/dependencies/llvm-native/bin/clang"
|
||||||
export AR="$bpf_sdk/dependencies/llvm-native/bin/llvm-ar"
|
export AR="$bpf_sdk/dependencies/llvm-native/bin/llvm-ar"
|
||||||
|
|
||||||
# Use the SDK's version of Rust to build for BPF
|
# Use the SDK's version of Rust to build for BPF
|
||||||
export RUSTUP_TOOLCHAIN=bpf
|
export RUSTUP_TOOLCHAIN=bpf
|
||||||
export RUSTFLAGS="
|
export RUSTFLAGS="
|
||||||
@ -38,8 +32,12 @@ export RUSTFLAGS="
|
|||||||
-C link-arg=-shared \
|
-C link-arg=-shared \
|
||||||
-C link-arg=--entry=entrypoint \
|
-C link-arg=--entry=entrypoint \
|
||||||
-C linker=$bpf_sdk/dependencies/llvm-native/bin/ld.lld"
|
-C linker=$bpf_sdk/dependencies/llvm-native/bin/ld.lld"
|
||||||
|
|
||||||
|
# Setup xargo
|
||||||
export XARGO_HOME="$bpf_sdk/dependencies/xargo"
|
export XARGO_HOME="$bpf_sdk/dependencies/xargo"
|
||||||
export XARGO_RUST_SRC="$bpf_sdk/dependencies/rust-bpf-sysroot/src"
|
export XARGO_RUST_SRC="$bpf_sdk/dependencies/rust-bpf-sysroot/src"
|
||||||
|
|
||||||
|
cd "$1"
|
||||||
xargo build --target bpfel-unknown-unknown --release
|
xargo build --target bpfel-unknown-unknown --release
|
||||||
|
|
||||||
{ { set +x; } 2>/dev/null; echo Success; }
|
{ { set +x; } 2>/dev/null; echo Success; }
|
||||||
|
@ -22,6 +22,12 @@ download() {
|
|||||||
wget "${args[@]}"
|
wget "${args[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Install xargo
|
||||||
|
if [[ ! -r xargo.md ]]; then
|
||||||
|
cargo install xargo
|
||||||
|
xargo --version > xargo.md 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
# Install Criterion
|
# Install Criterion
|
||||||
version=v2.3.2
|
version=v2.3.2
|
||||||
if [[ ! -r criterion-$machine-$version.md ]]; then
|
if [[ ! -r criterion-$machine-$version.md ]]; then
|
||||||
|
Reference in New Issue
Block a user