From becfd1e9faa0e4477a59e9ed0681c2a0b63cf15b Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 20 Dec 2018 14:37:34 -0800 Subject: [PATCH] ci/test-stable-perf.sh now runs on macOS --- build-perf-libs.sh | 19 +++++++++++++++++++ build.rs | 18 ++++++++++++++++-- ci/test-stable-perf.sh | 14 +++++++++----- 3 files changed, 44 insertions(+), 7 deletions(-) create mode 100755 build-perf-libs.sh diff --git a/build-perf-libs.sh b/build-perf-libs.sh new file mode 100755 index 000000000..756ce510f --- /dev/null +++ b/build-perf-libs.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Builds perf-libs from the upstream source and installs them into the correct +# location in the tree +# +set -e +cd "$(dirname "$0")" + +if [[ -d target/perf-libs ]]; then + echo "target/perf-libs/ already exists, to continue run:" + echo "$ rm -rf target/perf-libs" + exit 1 +fi + +set -x +git clone git@github.com:solana-labs/solana-perf-libs.git target/perf-libs +cd target/perf-libs +make -j"$(nproc)" +make DESTDIR=. install diff --git a/build.rs b/build.rs index ec692364b..72d2686e4 100644 --- a/build.rs +++ b/build.rs @@ -38,8 +38,22 @@ fn main() { println!("cargo:rustc-link-lib=dylib=cudadevrt"); } if erasure { - println!("cargo:rerun-if-changed=target/perf-libs/libgf_complete.so"); - println!("cargo:rerun-if-changed=target/perf-libs/libJerasure.so"); + #[cfg(any(target_os = "macos", target_os = "ios"))] + { + println!("cargo:rerun-if-changed=target/perf-libs/libgf_complete.dylib"); + println!("cargo:rerun-if-changed=target/perf-libs/libJerasure.dylib"); + } + #[cfg(all(unix, not(any(target_os = "macos", target_os = "ios"))))] + { + println!("cargo:rerun-if-changed=target/perf-libs/libgf_complete.so"); + println!("cargo:rerun-if-changed=target/perf-libs/libJerasure.so"); + } + #[cfg(windows)] + { + println!("cargo:rerun-if-changed=target/perf-libs/libgf_complete.dll"); + println!("cargo:rerun-if-changed=target/perf-libs/libJerasure.dll"); + } + println!("cargo:rustc-link-lib=dylib=Jerasure"); println!("cargo:rustc-link-lib=dylib=gf_complete"); } diff --git a/ci/test-stable-perf.sh b/ci/test-stable-perf.sh index 8e71e334a..0c4008ec0 100755 --- a/ci/test-stable-perf.sh +++ b/ci/test-stable-perf.sh @@ -18,10 +18,14 @@ ci/affects-files.sh \ exit 0 } +FEATURES=bpf_c,erasure,chacha +if [[ $(uname) = Darwin ]]; then + ./build-perf-libs.sh +else + ./fetch-perf-libs.sh + # shellcheck source=/dev/null + source ./target/perf-libs/env.sh + FEATURES=$FEATURES,cuda +fi -./fetch-perf-libs.sh -# shellcheck source=/dev/null -source ./target/perf-libs/env.sh - -FEATURES=bpf_c,cuda,erasure,chacha exec ci/test-stable.sh "$FEATURES"