-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
105 lines (81 loc) · 2.47 KB
/
Makefile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
ifeq ($(origin FEDORA_RELEASE), undefined)
else
FEDORA_RELEASE_ARGS = --release=${FEDORA_RELEASE}
endif
ifeq ($(origin MANIFEST_PATH), undefined)
else
MANIFEST_PATH_ARGS = --manifest-path=${MANIFEST_PATH}
endif
ifeq ($(origin CLIPPY_FIX), undefined)
CLIPPY_OPTS = --all-targets --no-deps
else
CLIPPY_OPTS = --fix
endif
IGNORE_ARGS ?=
${HOME}/.cargo/bin/cargo-audit:
cargo install cargo-audit
audit: ${HOME}/.cargo/bin/cargo-audit
PATH=${HOME}/.cargo/bin:${PATH} cargo audit -D warnings
check-typos:
typos
build:
cargo build
build-examples:
cargo build --examples
test-compare-fedora-versions:
echo "Testing that COMPARE_FEDORA_VERSIONS environment variable is set to a valid path"
test -e "${COMPARE_FEDORA_VERSIONS}"
check-fedora-versions: test-compare-fedora-versions
${COMPARE_FEDORA_VERSIONS} ${MANIFEST_PATH_ARGS} ${FEDORA_RELEASE_ARGS} ${IGNORE_ARGS}
SET_LOWER_BOUNDS ?=
test-set-lower-bounds:
echo "Testing that SET_LOWER_BOUNDS environment variable is set to a valid path"
test -e "${SET_LOWER_BOUNDS}"
verify-dependency-bounds: test-set-lower-bounds
cargo build ${MANIFEST_PATH_ARGS} --all-features
${SET_LOWER_BOUNDS} ${MANIFEST_PATH_ARGS}
cargo build ${MANIFEST_PATH_ARGS} --all-features
clippy:
(cd libcryptsetup-rs-sys && cargo clippy --all-features ${CARGO_OPTS})
cargo clippy --all-features ${CARGO_OPTS}
docs-rust:
cargo doc --no-deps --package libcryptsetup-rs --package libcryptsetup-rs-sys
docs-ci: docs-rust
fmt:
cargo fmt
fmt-ci:
cargo fmt -- --check
release:
cargo build --release
test:
RUST_BACKTRACE=1 cargo test -- --skip test_mutex_poisoning_panic
test-mutex:
RUST_BACKTRACE=1 cargo test --features=mutex -- --skip test_mutex_poisoning_panic
test-mutex-guard:
RUST_BACKTRACE=1 RUST_TEST_THREADS=1 cargo test --features=mutex test_mutex_poisoning_panic
# Loopback tests must have the mutex feature enabled because Rust runs the tests
# on multiple threads which will cause a panic if the mutex feature is not enabled.
test-loopback:
RUST_BACKTRACE=1 RUST_TEST_THREADS=1 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER='sudo -E' cargo test --features=mutex -- --ignored --skip test_mutex_poisoning_panic
yamllint:
yamllint --strict .github/workflows/*.yml
.PHONY:
build
check-fedora-versions
check-typos
clippy
docs-rust
docs-ci
fmt
fmt-ci
release
test
test-mutex
test-mutex-guard
test-compare-fedora-versions
test-loopback
test-loopback-mutex
test-set-lower-bounds
verify-dependency-bounds
verify-dependency-bounds-sys
yamllint