@@ -19,20 +19,12 @@ executors:
1919 resource_class : small
2020
2121commands :
22- rust_setup :
23- description : Set rustc version
24- steps :
25- - run :
26- name : Set rustc version
27- command : |
28- rustup default stable
29- rustup update stable
3022 print_versions :
3123 description : Version Info
3224 steps :
3325 - run :
3426 name : Version Info
35- command : rustc --version; cargo --version; rustup --version
27+ command : rustup --version
3628 env_setup :
3729 description : Environment Setup
3830 steps :
@@ -44,6 +36,7 @@ commands:
4436 echo 'export LIBRA_DUMP_LOGS=1' >> $BASH_ENV
4537 echo 'export CARGO_INCREMENTAL=0' >> $BASH_ENV
4638 echo 'export CI_TIMEOUT="timeout 40m"' >> $BASH_ENV
39+ echo 'export RUST_NIGHTLY=nightly-2020-03-18' >> $BASH_ENV
4740 install_deps :
4841 steps :
4942 - run :
@@ -52,14 +45,20 @@ commands:
5245 sudo apt-get update
5346 sudo apt-get install -y cmake curl clang llvm
5447 rustup component add clippy rustfmt
48+ rustup toolchain install $RUST_NIGHTLY
49+ - run :
50+ name : Set cargo Environment
51+ command : |
52+ echo 'export CARGO=$(rustup which --toolchain $RUST_NIGHTLY cargo)' >> $BASH_ENV
53+ echo 'export CARGOFLAGS=-Zfeatures=all' >> $BASH_ENV
5554 install_code_coverage_deps :
5655 steps :
5756 - run :
5857 name : Install grcov and lcov
5958 command : |
6059 sudo apt-get update
6160 sudo apt-get install lcov
62- cargo install --force grcov
61+ $CARGO $CARGOFLAGS install --force grcov
6362 install_docker_linter :
6463 steps :
6564 - run :
@@ -68,11 +67,6 @@ commands:
6867 export HADOLINT=${HOME}/hadolint
6968 export HADOLINT_VER=v1.17.4
7069 curl -sL -o ${HADOLINT} "https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VER}/hadolint-$(uname -s)-$(uname -m)" && chmod 700 ${HADOLINT}
71- install_rust_nightly_toolchain :
72- steps :
73- - run :
74- name : Install nightly toolchain for features not in beta/stable
75- command : rustup install nightly
7670 find_dockerfile_changes :
7771 steps :
7872 - run :
@@ -106,7 +100,6 @@ commands:
106100 build_setup :
107101 steps :
108102 - checkout
109- - rust_setup
110103 - print_versions
111104 - env_setup
112105 - install_deps
@@ -127,7 +120,7 @@ jobs:
127120 command : ./scripts/git-checks.sh
128121 - run :
129122 name : Fetch workspace dependencies over network
130- command : cargo fetch
123+ command : $CARGO $CARGOFLAGS fetch
131124 - save_cargo_package_cache
132125 - persist_to_workspace :
133126 root : /home/circleci/project
@@ -148,20 +141,20 @@ jobs:
148141 - restore_cargo_package_cache
149142 - run :
150143 name : cargo lint
151- command : cargo x lint
144+ command : $CARGO $CARGOFLAGS x lint
152145 - run :
153146 name : cargo clippy
154- command : cargo xclippy --workspace --all-targets
147+ command : $CARGO $CARGOFLAGS xclippy --workspace --all-targets
155148 - run :
156149 name : cargo fmt
157- command : cargo xfmt --check
150+ command : $CARGO $CARGOFLAGS xfmt --check
158151 - run :
159152 name : cargo guppy
160153 command : |
161- cargo install cargo-guppy \
154+ $CARGO $CARGOFLAGS install cargo-guppy \
162155 --git http://github.com/calibra/cargo-guppy \
163156 --rev 8b2bc45c0cd6323a7a2b8170ddad6d2a5b79047b
164- [[ -z $(cargo guppy dups --target x86_64-unknown-linux-gnu \
157+ [[ -z $($CARGO $CARGOFLAGS guppy dups --target x86_64-unknown-linux-gnu \
165158 --kind directthirdparty) ]]
166159 build-dev :
167160 executor : build-executor
@@ -172,19 +165,19 @@ jobs:
172165 at : /home/circleci/project
173166 - restore_cargo_package_cache
174167 - run :
175- command : RUST_BACKTRACE=1 cargo build -j 16
168+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16
176169 - run :
177- command : RUST_BACKTRACE=1 cargo build -j 16 -p libra-swarm
170+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p libra-swarm
178171 - run :
179- command : RUST_BACKTRACE=1 cargo build -j 16 -p cluster-test
172+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p cluster-test
180173 - run :
181- command : RUST_BACKTRACE=1 cargo build -j 16 -p libra-fuzzer
174+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p libra-fuzzer
182175 - run :
183- command : RUST_BACKTRACE=1 cargo build -j 16 -p language_benchmarks
176+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p language_benchmarks
184177 - run :
185- command : RUST_BACKTRACE=1 cargo build -j 16 -p cost-synthesis
178+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p cost-synthesis
186179 - run :
187- command : RUST_BACKTRACE=1 cargo build -j 16 -p test-generation
180+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p test-generation
188181 - build_teardown
189182 build-release :
190183 executor : build-executor
@@ -196,7 +189,7 @@ jobs:
196189 - restore_cargo_package_cache
197190 - run :
198191 name : Build release
199- command : RUST_BACKTRACE=1 cargo build -j 16 --release
192+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 --release
200193 - build_teardown
201194 build-e2e-test :
202195 executor : build-executor
@@ -209,7 +202,7 @@ jobs:
209202 - run :
210203 name : Find all e2e tests
211204 command : |
212- cargo x test --package testsuite -- --list | grep "::" | \
205+ $CARGO $CARGOFLAGS x test --package testsuite -- --list | grep "::" | \
213206 sed 's/: .*$//' > e2e_tests
214207 cat e2e_tests
215208 - persist_to_workspace :
@@ -246,7 +239,7 @@ jobs:
246239 RUST_BACKTRACE=1 $CI_TIMEOUT $libratest $target \
247240 --test-threads 1 --exact --nocapture
248241 else
249- RUST_BACKTRACE=1 $CI_TIMEOUT cargo x test $target \
242+ RUST_BACKTRACE=1 $CI_TIMEOUT $CARGO $CARGOFLAGS x test $target \
250243 --package testsuite -- --test-threads 1 --exact --nocapture
251244 fi
252245 done
@@ -262,7 +255,7 @@ jobs:
262255 - run :
263256 name : Run all unit tests
264257 command : |
265- RUST_BACKTRACE=1 $CI_TIMEOUT cargo test \
258+ RUST_BACKTRACE=1 $CI_TIMEOUT $CARGO $CARGOFLAGS test \
266259 --all-features \
267260 --workspace \
268261 --exclude libra-node \
@@ -281,7 +274,7 @@ jobs:
281274 name : Run crypto unit tests
282275 command : |
283276 cd crypto/crypto && \
284- RUST_BACKTRACE=1 cargo test \
277+ RUST_BACKTRACE=1 $CARGO $CARGOFLAGS test \
285278 --features='std fiat_u64_backend fuzzing' \
286279 --no-default-features
287280 run-flaky-unit-test :
@@ -312,16 +305,16 @@ jobs:
312305 steps :
313306 - build_setup
314307 - run :
315- name : Install Cargo Audit
308+ name : Install cargo-audit
316309 command : |
317- cargo install --force cargo-audit
310+ $CARGO $CARGOFLAGS install --force cargo-audit
318311 - run :
319312 # NOTE ignored advisory rules
320313 # RUSTSEC-2018-0015 - term
321314 # RUSTSEC-2019-0031 - spin
322315 name : Audit crates
323316 command : |
324- cargo audit --deny-warnings \
317+ $CARGO $CARGOFLAGS audit --deny-warnings \
325318 --ignore RUSTSEC-2018-0015 \
326319 --ignore RUSTSEC-2019-0031
327320 - build_teardown
@@ -331,7 +324,6 @@ jobs:
331324 steps :
332325 - build_setup
333326 - install_code_coverage_deps
334- - install_rust_nightly_toolchain
335327 - run :
336328 name : Setup code coverage output
337329 command : echo "export CODECOV_OUTPUT=codecov" >> $BASH_ENV
0 commit comments