summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/ci/fetch-smoke-test.sh
blob: 17993d1fdb707f45daec8dd6b5b030bf9fa82dc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# This script builds with static curl, and verifies that fetching works.

set -ex

if [[ -z "$RUNNER_TEMP" ]]
then
    echo "RUNNER_TEMP must be set"
    exit 1
fi

if [ ! -f Cargo.toml ]; then
    echo "Must be run from root of project."
    exit 1
fi


# Building openssl on Windows is a pain.
if [[ $(rustc -Vv | grep host:) != *windows* ]]; then
    FEATURES='vendored-openssl,curl-sys/static-curl,curl-sys/force-system-lib-on-osx'
    export LIBZ_SYS_STATIC=1
fi

cargo build --features "$FEATURES"
export CARGO_HOME=$RUNNER_TEMP/chome
target/debug/cargo fetch
rm -rf $CARGO_HOME