-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
156 lines (138 loc) · 5.1 KB
/
justfile
File metadata and controls
156 lines (138 loc) · 5.1 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# List available commands
default:
just --list
# Auto format code
lint-fix:
cargo fmt
uv run black .
uv run ruff check --fix .
[private]
ci-lint-rustfmt:
cargo fmt --check
[private]
ci-lint-black:
uv run black --check .
[private]
ci-lint-ruff:
uv run ruff check .
# Lint code
lint-rust:
cargo clippy
cargo clippy --features log
uv run cargo clippy --features python
[private]
ci-lint-clippy: ci-build-deps
RUSTFLAGS="-Dwarnings" just lint-rust
# Mypy types checking
lint-mypy: install-python
uv run stubtest kadmin
[private]
ci-lint-mypy: ci-build-deps lint-mypy
alias l := lint
# Lint and auto format
lint: lint-fix lint-rust
alias la := lint-all
# Common lint plus mypy types checking
lint-all: lint lint-mypy
alias b := build-rust
# Build all rust crates
build-rust:
cargo build
cargo build --features log
uv run cargo build --features python
RUSTFLAGS="-Awarnings" cargo build --no-default-features --features mit_client
RUSTFLAGS="-Awarnings" cargo build --no-default-features --features mit_server
RUSTFLAGS="-Awarnings" cargo build --no-default-features --features heimdal_client
RUSTFLAGS="-Awarnings" cargo build --no-default-features --features heimdal_server
RUSTFLAGS="-Awarnings" cargo build --no-default-features --features mit_client,mit_server
RUSTFLAGS="-Awarnings" cargo build --no-default-features --features heimdal_client,heimdal_server
RUSTFLAGS="-Awarnings" uv run cargo build --no-default-features --features mit_client,python
RUSTFLAGS="-Awarnings" uv run cargo build --no-default-features --features mit_server,python
RUSTFLAGS="-Awarnings" uv run cargo build --no-default-features --features heimdal_client,python
RUSTFLAGS="-Awarnings" uv run cargo build --no-default-features --features heimdal_server,python
RUSTFLAGS="-Awarnings" uv run cargo build --no-default-features --features mit_client,mit_server,python
RUSTFLAGS="-Awarnings" uv run cargo build --no-default-features --features heimdal_client,heimdal_server,python
[private]
ci-build-deps:
sudo apt-get remove -y --purge man-db
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential pkg-config krb5-multidev libkrb5-dev heimdal-multidev libclang-dev python3-dev
[private]
ci-build-rust: ci-build-deps
RUSTFLAGS="-Dwarnings" just build-rust
# Build python wheel
build-python:
uv run maturin build
[private]
ci-build-python: ci-build-deps build-python
[private]
ci-build-python-sdist:
uv build --sdist
# Build rust crates and python wheel
build: build-rust build-python
alias t := test-rust-mit
# Test rust code, only MIT variants
test-rust-mit:
RUSTFLAGS="-Awarnings" uv run cargo test --no-default-features --features mit_client,mit_server,log -- --nocapture
# Test rust code, only Heimdal variants
test-rust-heimdal:
RUSTFLAGS="-Awarnings" uv run cargo test --no-default-features --features heimdal_client,heimdal_server,log -- --nocapture
[private]
ci-test-deps:
sudo apt-get install -y --no-install-recommends valgrind
[private]
ci-test-deps-mit: ci-build-deps ci-test-deps
sudo apt-get install -y --no-install-recommends krb5-kdc krb5-user krb5-admin-server
[private]
ci-test-deps-heimdal: ci-build-deps ci-test-deps
sudo apt-get install -y --no-install-recommends heimdal-clients heimdal-kdc
[private]
ci-test-rust-mit: ci-test-deps-mit test-rust-mit
[private]
ci-test-rust-heimdal: ci-test-deps-heimdal test-rust-heimdal
just test-rust-heimdal
alias ts := test-sanity-mit
# Test kadmin with valgrind for memory leaks, only MIT variants
test-sanity-mit:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="valgrind --error-exitcode=1 --suppressions=tests/valgrind.supp -s --leak-check=full" just test-rust-mit
# Test kadmin with valgrind for memory leaks, only Heimdal variants
test-sanity-heimdal:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="valgrind --error-exitcode=1 --suppressions=tests/valgrind.supp -s --leak-check=full" just test-rust-heimdal
[private]
ci-test-sanity-mit: ci-test-deps-mit
just test-sanity-mit
[private]
ci-test-sanity-heimdal: ci-test-deps-heimdal
just test-sanity-heimdal
_test-python:
uv run python -m unittest --verbose python/tests/test_*.py
# Test python bindings
test-python: install-python _test-python
[private]
ci-test-deps-h5l: ci-test-deps
sudo apt-get install -y --no-install-recommends libkrb5-3 libkadm5clnt-mit12 libkadm5srv-mit12 heimdal-dev heimdal-servers heimdal-kdc
[private]
ci-test-python-mit: ci-test-deps-mit _install-python _test-python
[private]
ci-test-python-h5l: ci-test-deps-h5l _install-python _test-python
# Test rust crates and python bindings
test-all: test-rust-mit test-sanity-mit test-python
alias ta := test-all
_install-python:
uv pip install --force-reinstall target/wheels/python_kadmin_rs-*.whl
# Build and install wheel
install-python: clean-python build-python _install-python
docs-rust:
cargo doc
# Generate the Python docs
docs-python:
cd python/docs && uv run sphinx-build -M html . _build
# Cleanup rust build directory
clean-rust:
rm -rf target
# Cleanup python wheel builds
clean-python:
uv pip uninstall python-kadmin-rs
rm -rf dist target/wheels wheelhouse
# Cleanup all
clean: clean-rust clean-python