Skip to content

Commit 922b85c

Browse files
authored
Merge pull request stratis-storage#3499 from mulkieran/issue_project_451
Add PROFILE_FLAGS to profileable targets
2 parents 7ca9385 + 8577c73 commit 922b85c

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

Makefile

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
ifeq ($(origin PROFILE), undefined)
2+
else
3+
PROFILE_FLAGS = -C instrument-coverage
4+
endif
5+
16
ifeq ($(origin AUDITABLE), undefined)
27
BUILD = build
38
RUSTC = rustc
@@ -203,15 +208,15 @@ fmt-shell-ci:
203208
## Build stratisd
204209
build:
205210
PKG_CONFIG_ALLOW_CROSS=1 \
206-
RUSTFLAGS="${DENY}" \
211+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
207212
cargo ${BUILD} ${RELEASE_FLAG} \
208213
--bin=stratisd \
209214
${TARGET_ARGS}
210215

211216
## Build the stratisd test suite
212217
build-tests:
213218
PKG_CONFIG_ALLOW_CROSS=1 \
214-
RUSTFLAGS="${DENY}" \
219+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
215220
cargo test --no-run ${RELEASE_FLAG} ${TARGET_ARGS}
216221

217222
## Build stratis-utils only
@@ -232,7 +237,7 @@ build-utils-no-systemd:
232237
## Build stratisd-min and stratis-min for early userspace
233238
build-min:
234239
PKG_CONFIG_ALLOW_CROSS=1 \
235-
RUSTFLAGS="${DENY}" \
240+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
236241
cargo ${BUILD} ${RELEASE_FLAG} \
237242
--bin=stratis-min --bin=stratisd-min \
238243
${SYSTEMD_FEATURES} ${TARGET_ARGS}
@@ -248,7 +253,7 @@ build-min-no-systemd:
248253
## Build stratisd-min and stratis-min for early userspace
249254
build-no-ipc:
250255
PKG_CONFIG_ALLOW_CROSS=1 \
251-
RUSTFLAGS="${DENY}" \
256+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
252257
cargo ${BUILD} ${RELEASE_FLAG} \
253258
--bin=stratisd \
254259
${NO_IPC_FEATURES} \
@@ -257,7 +262,7 @@ build-no-ipc:
257262
## Build stratis-str-cmp binary
258263
build-stratis-str-cmp:
259264
PKG_CONFIG_ALLOW_CROSS=1 \
260-
RUSTFLAGS="${DENY}" \
265+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
261266
cargo ${RUSTC} ${RELEASE_FLAG} \
262267
--bin=stratis-str-cmp \
263268
${UDEV_FEATURES} \
@@ -268,7 +273,7 @@ build-stratis-str-cmp:
268273
## Build stratis-base32-decode binary
269274
build-stratis-base32-decode:
270275
PKG_CONFIG_ALLOW_CROSS=1 \
271-
RUSTFLAGS="${DENY}" \
276+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
272277
cargo ${RUSTC} ${RELEASE_FLAG} \
273278
--bin=stratis-base32-decode \
274279
${UDEV_FEATURES} \
@@ -284,21 +289,21 @@ build-udev-utils: build-stratis-str-cmp build-stratis-base32-decode
284289
## Build the stratisd-tools program
285290
stratisd-tools:
286291
PKG_CONFIG_ALLOW_CROSS=1 \
287-
RUSTFLAGS="${DENY}" \
292+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
288293
cargo ${BUILD} ${RELEASE_FLAG} \
289294
--bin=stratisd-tools ${EXTRAS_FEATURES} ${TARGET_ARGS}
290295

291296
## Build stratis-min for early userspace
292297
stratis-min:
293298
PKG_CONFIG_ALLOW_CROSS=1 \
294-
RUSTFLAGS="${DENY}" \
299+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
295300
cargo ${BUILD} ${RELEASE_FLAG} \
296301
--bin=stratis-min ${MIN_FEATURES} ${TARGET_ARGS}
297302

298303
## Build stratisd-min for early userspace
299304
stratisd-min:
300305
PKG_CONFIG_ALLOW_CROSS=1 \
301-
RUSTFLAGS="${DENY}" \
306+
RUSTFLAGS="${DENY} ${PROFILE_FLAGS}" \
302307
cargo ${BUILD} ${RELEASE_FLAG} \
303308
--bin=stratisd-min ${SYSTEMD_FEATURES} ${TARGET_ARGS}
304309

@@ -419,55 +424,55 @@ clean: clean-cfg clean-ancillary clean-primary
419424

420425
## Tests with loop devices
421426
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_
423428

424429
## Tests run under valgrind with loop devices
425430
test-loop-valgrind:
426431
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_
427432

428433
## Tests with real devices
429434
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_
431436

432437
## Basic tests
433438
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_
435440

436441
## Basic tests run under valgrind
437442
test-valgrind:
438443
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_
439444

440445
## Clevis tests with real devices
441446
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
443448

444449
## Clevis real device tests that are expected to fail
445450
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
447452

448453
## Clevis tests with loop devices
449454
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_
451456

452457
## Clevis tests with loop devices with valgrind
453458
test-clevis-loop-valgrind:
454459
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_
455460

456461
## Clevis loop device tests that are expected to fail
457462
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_
459464

460465
## Clevis loop device tests that are expected to fail run under valgrind
461466
test-clevis-loop-should-fail-valgrind:
462467
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_
463468

464469
## Test stratisd-min CLI
465470
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
467472

468473
## Test stratis-min CLI
469474
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
471476

472477
## Run yamllint on workflow files
473478
yamllint:

0 commit comments

Comments
 (0)