Skip to content

Commit

Permalink
Fix CI cache (#411)
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <overvenus@gmail.com>
  • Loading branch information
overvenus authored Nov 28, 2019
1 parent 0f561dc commit 12c96ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cache:
directories:
- $HOME/.cargo
- $HOME/.cache
- $TRAVIS_BUILD_DIR/target
before_cache:
- find $TRAVIS_BUILD_DIR/target/debug -maxdepth 1 -type f -delete

env:
global:
Expand All @@ -26,12 +29,13 @@ before_script:
- export PATH="$PATH:$HOME/.cache/bin:$HOME/.cargo/bin"
- GRPC_HEADER="$HOME/.cache/include/grpc/grpc.h"
- if [[ $TRAVIS_OS_NAME == "osx" ]] && [[ ! -f $GRPC_HEADER ]]; then
export CC=clang;
brew update && brew install autoconf libtool shtool;
fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
brew update && brew install openssl -f;
export OPENSSL_ROOT_DIR=$(brew --prefix openssl);
export LIBRARY_PATH="$(brew --prefix openssl)/lib";
export CC=clang;
else
sudo apt-get update && sudo apt-get -y install libssl-dev;
fi
Expand All @@ -46,7 +50,7 @@ before_script:
- export CPLUS_INCLUDE_PATH="$HOME/.cache/include"
- export LD_LIBRARY_PATH="$HOME/.cache/lib"
- export DYLD_LIBRARY_PATH="$HOME/.cache/lib"
- export LIBRARY_PATH="$HOME/.cache/lib"
- export LIBRARY_PATH="$HOME/.cache/lib":$LIBRARY_PATH
- export PKG_CONFIG_PATH="$HOME/.cache/lib/pkgconfig"

script:
Expand Down
7 changes: 4 additions & 3 deletions grpc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ fn build_grpc(cc: &mut Build, library: &str) {
config.define("gRPC_BENCHMARK_PROVIDER", "none");
if cfg!(feature = "openssl") {
config.define("gRPC_SSL_PROVIDER", "package");
config.define("EMBED_OPENSSL", "false");
// Problem is: Ubuntu Trusty shipped with openssl 1.0.1f. Which doesn't
// support alpn. And Google's gRPC checks for support of ALPN in plane
// old Makefile, but not in CMake.
Expand Down Expand Up @@ -222,8 +221,10 @@ fn figure_ssl_path(build_dir: &str) {
}
if cnt != 2 {
panic!(
"CMake cache invalid, file {} contains {} ssl keys!",
path, cnt
"CMake cache invalid, file {} contains {} ssl keys!\nCMakeCache.txt:\n{}",
path,
cnt,
std::fs::read_to_string(&path).unwrap()
);
}
println!("cargo:rustc-link-lib=ssl");
Expand Down

0 comments on commit 12c96ca

Please sign in to comment.