@@ -19,20 +19,12 @@ executors:
19
19
resource_class : small
20
20
21
21
commands :
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
30
22
print_versions :
31
23
description : Version Info
32
24
steps :
33
25
- run :
34
26
name : Version Info
35
- command : rustc --version; cargo --version; rustup --version
27
+ command : rustup --version
36
28
env_setup :
37
29
description : Environment Setup
38
30
steps :
@@ -44,6 +36,7 @@ commands:
44
36
echo 'export LIBRA_DUMP_LOGS=1' >> $BASH_ENV
45
37
echo 'export CARGO_INCREMENTAL=0' >> $BASH_ENV
46
38
echo 'export CI_TIMEOUT="timeout 40m"' >> $BASH_ENV
39
+ echo 'export RUST_NIGHTLY=nightly-2020-03-18' >> $BASH_ENV
47
40
install_deps :
48
41
steps :
49
42
- run :
@@ -52,14 +45,23 @@ commands:
52
45
sudo apt-get update
53
46
sudo apt-get install -y cmake curl clang llvm
54
47
rustup component add clippy rustfmt
48
+ rustup toolchain install $RUST_NIGHTLY
49
+ - run :
50
+ name : Set cargo Environment
51
+ command : |
52
+ # Use nightly version of cargo to access the new feature resolver
53
+ echo 'export CARGO=$(rustup which --toolchain $RUST_NIGHTLY cargo)' >> $BASH_ENV
54
+ # Turn on the experimental feature resolver in cargo. See:
55
+ # https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#features
56
+ echo 'export CARGOFLAGS=-Zfeatures=all' >> $BASH_ENV
55
57
install_code_coverage_deps :
56
58
steps :
57
59
- run :
58
60
name : Install grcov and lcov
59
61
command : |
60
62
sudo apt-get update
61
63
sudo apt-get install lcov
62
- cargo install --force grcov
64
+ $CARGO $CARGOFLAGS install --force grcov
63
65
install_docker_linter :
64
66
steps :
65
67
- run :
@@ -68,11 +70,6 @@ commands:
68
70
export HADOLINT=${HOME}/hadolint
69
71
export HADOLINT_VER=v1.17.4
70
72
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
76
73
find_dockerfile_changes :
77
74
steps :
78
75
- run :
@@ -106,7 +103,6 @@ commands:
106
103
build_setup :
107
104
steps :
108
105
- checkout
109
- - rust_setup
110
106
- print_versions
111
107
- env_setup
112
108
- install_deps
@@ -127,7 +123,7 @@ jobs:
127
123
command : ./scripts/git-checks.sh
128
124
- run :
129
125
name : Fetch workspace dependencies over network
130
- command : cargo fetch
126
+ command : $CARGO $CARGOFLAGS fetch
131
127
- save_cargo_package_cache
132
128
- persist_to_workspace :
133
129
root : /home/circleci/project
@@ -148,20 +144,20 @@ jobs:
148
144
- restore_cargo_package_cache
149
145
- run :
150
146
name : cargo lint
151
- command : cargo x lint
147
+ command : $CARGO $CARGOFLAGS x lint
152
148
- run :
153
149
name : cargo clippy
154
- command : cargo xclippy --workspace --all-targets
150
+ command : $CARGO $CARGOFLAGS xclippy --workspace --all-targets
155
151
- run :
156
152
name : cargo fmt
157
- command : cargo xfmt --check
153
+ command : $CARGO $CARGOFLAGS xfmt --check
158
154
- run :
159
155
name : cargo guppy
160
156
command : |
161
- cargo install cargo-guppy \
157
+ $CARGO $CARGOFLAGS install cargo-guppy \
162
158
--git http://github.com/calibra/cargo-guppy \
163
159
--rev 8b2bc45c0cd6323a7a2b8170ddad6d2a5b79047b
164
- [[ -z $(cargo guppy dups --target x86_64-unknown-linux-gnu \
160
+ [[ -z $($CARGO $CARGOFLAGS guppy dups --target x86_64-unknown-linux-gnu \
165
161
--kind directthirdparty) ]]
166
162
build-dev :
167
163
executor : build-executor
@@ -172,19 +168,19 @@ jobs:
172
168
at : /home/circleci/project
173
169
- restore_cargo_package_cache
174
170
- run :
175
- command : RUST_BACKTRACE=1 cargo build -j 16
171
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16
176
172
- run :
177
- command : RUST_BACKTRACE=1 cargo build -j 16 -p libra-swarm
173
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p libra-swarm
178
174
- run :
179
- command : RUST_BACKTRACE=1 cargo build -j 16 -p cluster-test
175
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p cluster-test
180
176
- run :
181
- command : RUST_BACKTRACE=1 cargo build -j 16 -p libra-fuzzer
177
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p libra-fuzzer
182
178
- run :
183
- command : RUST_BACKTRACE=1 cargo build -j 16 -p language_benchmarks
179
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p language_benchmarks
184
180
- run :
185
- command : RUST_BACKTRACE=1 cargo build -j 16 -p cost-synthesis
181
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p cost-synthesis
186
182
- run :
187
- command : RUST_BACKTRACE=1 cargo build -j 16 -p test-generation
183
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 -p test-generation
188
184
- build_teardown
189
185
build-release :
190
186
executor : build-executor
@@ -196,7 +192,7 @@ jobs:
196
192
- restore_cargo_package_cache
197
193
- run :
198
194
name : Build release
199
- command : RUST_BACKTRACE=1 cargo build -j 16 --release
195
+ command : RUST_BACKTRACE=1 $CARGO $CARGOFLAGS build -j 16 --release
200
196
- build_teardown
201
197
build-e2e-test :
202
198
executor : build-executor
@@ -209,7 +205,7 @@ jobs:
209
205
- run :
210
206
name : Find all e2e tests
211
207
command : |
212
- cargo x test --package testsuite -- --list | grep "::" | \
208
+ $CARGO $CARGOFLAGS x test --package testsuite -- --list | grep "::" | \
213
209
sed 's/: .*$//' > e2e_tests
214
210
cat e2e_tests
215
211
- persist_to_workspace :
@@ -246,7 +242,7 @@ jobs:
246
242
RUST_BACKTRACE=1 $CI_TIMEOUT $libratest $target \
247
243
--test-threads 1 --exact --nocapture
248
244
else
249
- RUST_BACKTRACE=1 $CI_TIMEOUT cargo x test $target \
245
+ RUST_BACKTRACE=1 $CI_TIMEOUT $CARGO $CARGOFLAGS x test $target \
250
246
--package testsuite -- --test-threads 1 --exact --nocapture
251
247
fi
252
248
done
@@ -262,7 +258,7 @@ jobs:
262
258
- run :
263
259
name : Run all unit tests
264
260
command : |
265
- RUST_BACKTRACE=1 $CI_TIMEOUT cargo test \
261
+ RUST_BACKTRACE=1 $CI_TIMEOUT $CARGO $CARGOFLAGS test \
266
262
--all-features \
267
263
--workspace \
268
264
--exclude libra-node \
@@ -281,7 +277,7 @@ jobs:
281
277
name : Run crypto unit tests
282
278
command : |
283
279
cd crypto/crypto && \
284
- RUST_BACKTRACE=1 cargo test \
280
+ RUST_BACKTRACE=1 $CARGO $CARGOFLAGS test \
285
281
--features='std fiat_u64_backend fuzzing' \
286
282
--no-default-features
287
283
run-flaky-unit-test :
@@ -312,16 +308,16 @@ jobs:
312
308
steps :
313
309
- build_setup
314
310
- run :
315
- name : Install Cargo Audit
311
+ name : Install cargo-audit
316
312
command : |
317
- cargo install --force cargo-audit
313
+ $CARGO $CARGOFLAGS install --force cargo-audit
318
314
- run :
319
315
# NOTE ignored advisory rules
320
316
# RUSTSEC-2018-0015 - term
321
317
# RUSTSEC-2019-0031 - spin
322
318
name : Audit crates
323
319
command : |
324
- cargo audit --deny-warnings \
320
+ $CARGO $CARGOFLAGS audit --deny-warnings \
325
321
--ignore RUSTSEC-2018-0015 \
326
322
--ignore RUSTSEC-2019-0031
327
323
- build_teardown
@@ -331,7 +327,6 @@ jobs:
331
327
steps :
332
328
- build_setup
333
329
- install_code_coverage_deps
334
- - install_rust_nightly_toolchain
335
330
- run :
336
331
name : Setup code coverage output
337
332
command : echo "export CODECOV_OUTPUT=codecov" >> $BASH_ENV
0 commit comments