1
+ ifeq ($(origin PROFILE ) , undefined)
2
+ else
3
+ PROFILE_FLAGS = -C instrument-coverage
4
+ endif
5
+
1
6
ifeq ($(origin AUDITABLE ) , undefined)
2
7
BUILD = build
3
8
RUSTC = rustc
@@ -203,15 +208,15 @@ fmt-shell-ci:
203
208
# # Build stratisd
204
209
build :
205
210
PKG_CONFIG_ALLOW_CROSS=1 \
206
- RUSTFLAGS=" ${DENY} " \
211
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
207
212
cargo ${BUILD} ${RELEASE_FLAG} \
208
213
--bin=stratisd \
209
214
${TARGET_ARGS}
210
215
211
216
# # Build the stratisd test suite
212
217
build-tests :
213
218
PKG_CONFIG_ALLOW_CROSS=1 \
214
- RUSTFLAGS=" ${DENY} " \
219
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
215
220
cargo test --no-run ${RELEASE_FLAG} ${TARGET_ARGS}
216
221
217
222
# # Build stratis-utils only
@@ -232,7 +237,7 @@ build-utils-no-systemd:
232
237
# # Build stratisd-min and stratis-min for early userspace
233
238
build-min :
234
239
PKG_CONFIG_ALLOW_CROSS=1 \
235
- RUSTFLAGS=" ${DENY} " \
240
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
236
241
cargo ${BUILD} ${RELEASE_FLAG} \
237
242
--bin=stratis-min --bin=stratisd-min \
238
243
${SYSTEMD_FEATURES} ${TARGET_ARGS}
@@ -248,7 +253,7 @@ build-min-no-systemd:
248
253
# # Build stratisd-min and stratis-min for early userspace
249
254
build-no-ipc :
250
255
PKG_CONFIG_ALLOW_CROSS=1 \
251
- RUSTFLAGS=" ${DENY} " \
256
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
252
257
cargo ${BUILD} ${RELEASE_FLAG} \
253
258
--bin=stratisd \
254
259
${NO_IPC_FEATURES} \
@@ -257,7 +262,7 @@ build-no-ipc:
257
262
# # Build stratis-str-cmp binary
258
263
build-stratis-str-cmp :
259
264
PKG_CONFIG_ALLOW_CROSS=1 \
260
- RUSTFLAGS=" ${DENY} " \
265
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
261
266
cargo ${RUSTC} ${RELEASE_FLAG} \
262
267
--bin=stratis-str-cmp \
263
268
${UDEV_FEATURES} \
@@ -268,7 +273,7 @@ build-stratis-str-cmp:
268
273
# # Build stratis-base32-decode binary
269
274
build-stratis-base32-decode :
270
275
PKG_CONFIG_ALLOW_CROSS=1 \
271
- RUSTFLAGS=" ${DENY} " \
276
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
272
277
cargo ${RUSTC} ${RELEASE_FLAG} \
273
278
--bin=stratis-base32-decode \
274
279
${UDEV_FEATURES} \
@@ -284,21 +289,21 @@ build-udev-utils: build-stratis-str-cmp build-stratis-base32-decode
284
289
# # Build the stratisd-tools program
285
290
stratisd-tools :
286
291
PKG_CONFIG_ALLOW_CROSS=1 \
287
- RUSTFLAGS=" ${DENY} " \
292
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
288
293
cargo ${BUILD} ${RELEASE_FLAG} \
289
294
--bin=stratisd-tools ${EXTRAS_FEATURES} ${TARGET_ARGS}
290
295
291
296
# # Build stratis-min for early userspace
292
297
stratis-min :
293
298
PKG_CONFIG_ALLOW_CROSS=1 \
294
- RUSTFLAGS=" ${DENY} " \
299
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
295
300
cargo ${BUILD} ${RELEASE_FLAG} \
296
301
--bin=stratis-min ${MIN_FEATURES} ${TARGET_ARGS}
297
302
298
303
# # Build stratisd-min for early userspace
299
304
stratisd-min :
300
305
PKG_CONFIG_ALLOW_CROSS=1 \
301
- RUSTFLAGS=" ${DENY} " \
306
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " \
302
307
cargo ${BUILD} ${RELEASE_FLAG} \
303
308
--bin=stratisd-min ${SYSTEMD_FEATURES} ${TARGET_ARGS}
304
309
@@ -419,55 +424,55 @@ clean: clean-cfg clean-ancillary clean-primary
419
424
420
425
# # Tests with loop devices
421
426
test-loop :
422
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test loop_ -- --skip clevis_loop_
427
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test loop_ -- --skip clevis_loop_
423
428
424
429
# # Tests run under valgrind with loop devices
425
430
test-loop-valgrind :
426
431
RUST_TEST_THREADS=1 sudo -E valgrind --leak-check=full --num-callers=500 $(shell RUSTFLAGS="${DENY}" cargo test --no-run --all-features --message-format=json 2>/dev/null | jq -r 'select(.target.src_path == "'${PWD}/src/lib.rs'") | select(.executable ! = null) | .executable' ) loop_ --skip real_ --skip clevis_
427
432
428
433
# # Tests with real devices
429
434
test-real :
430
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test real_ -- --skip clevis_real_
435
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test real_ -- --skip clevis_real_
431
436
432
437
# # Basic tests
433
438
test :
434
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 cargo test --all-features -- --skip real_ --skip loop_ --skip clevis_ --skip test_stratis_min_ --skip test_stratisd_min_
439
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 cargo test --all-features -- --skip real_ --skip loop_ --skip clevis_ --skip test_stratis_min_ --skip test_stratisd_min_
435
440
436
441
# # Basic tests run under valgrind
437
442
test-valgrind :
438
443
RUST_TEST_THREADS=1 valgrind --leak-check=full --num-callers=500 $(shell RUSTFLAGS="${DENY}" cargo test --no-run --all-features --message-format=json 2>/dev/null | jq -r 'select(.target.src_path == "'${PWD}/src/lib.rs'") | select(.executable ! = null) | .executable' ) --skip real_ --skip loop_ --skip clevis_
439
444
440
445
# # Clevis tests with real devices
441
446
test-clevis-real :
442
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_real_ -- --skip clevis_real_should_fail
447
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_real_ -- --skip clevis_real_should_fail
443
448
444
449
# # Clevis real device tests that are expected to fail
445
450
test-clevis-real-should-fail :
446
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_real_should_fail
451
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_real_should_fail
447
452
448
453
# # Clevis tests with loop devices
449
454
test-clevis-loop :
450
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_loop_ -- --skip clevis_loop_should_fail_
455
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_loop_ -- --skip clevis_loop_should_fail_
451
456
452
457
# # Clevis tests with loop devices with valgrind
453
458
test-clevis-loop-valgrind :
454
459
RUST_TEST_THREADS=1 sudo -E valgrind --leak-check=full --num-callers=500 $(shell RUSTFLAGS="${DENY}" cargo test --no-run --all-features --message-format=json 2>/dev/null | jq -r 'select(.target.src_path == "'${PWD}/src/lib.rs'") | select(.executable ! = null) | .executable' ) clevis_loop_ --skip clevis_loop_should_fail_
455
460
456
461
# # Clevis loop device tests that are expected to fail
457
462
test-clevis-loop-should-fail :
458
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_loop_should_fail_
463
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test clevis_loop_should_fail_
459
464
460
465
# # Clevis loop device tests that are expected to fail run under valgrind
461
466
test-clevis-loop-should-fail-valgrind :
462
467
RUST_TEST_THREADS=1 sudo -E valgrind --leak-check=full --num-callers=500 $(shell RUSTFLAGS="${DENY}" cargo test --no-run --all-features --message-format=json 2>/dev/null | jq -r 'select(.target.src_path == "'${PWD}/src/lib.rs'") | select(.executable ! = null) | .executable' ) clevis_loop_should_fail_
463
468
464
469
# # Test stratisd-min CLI
465
470
test-stratisd-min :
466
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test --no-default-features --features " engine,min" test_stratisd_min
471
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test --no-default-features --features " engine,min" test_stratisd_min
467
472
468
473
# # Test stratis-min CLI
469
474
test-stratis-min :
470
- RUSTFLAGS=" ${DENY} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test --no-default-features --features " engine,min" test_stratis_min
475
+ RUSTFLAGS=" ${DENY} ${PROFILE_FLAGS} " RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER=' sudo -E' cargo test --no-default-features --features " engine,min" test_stratis_min
471
476
472
477
# # Run yamllint on workflow files
473
478
yamllint :
0 commit comments