|
1 | | -# build with various profiles to populate the rustc cache |
2 | | -warmup: |
3 | | - # build with cranelift |
4 | | - -env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly build -Zcodegen-backend |
5 | | - # build without cranelift (as hx will do) |
6 | | - -cargo build |
7 | | - # build in release profile |
8 | | - -cargo build --release |
| 1 | +# lancelot justfile - run `just` or `just help` to see available commands |
| 2 | + |
| 3 | +# Default recipe - show help |
| 4 | +default: help |
| 5 | + |
| 6 | +# Show available commands |
| 7 | +help: |
| 8 | + @echo "lancelot build system" |
| 9 | + @echo "" |
| 10 | + @echo "Usage: just <recipe>" |
| 11 | + @echo "" |
| 12 | + @echo "Common recipes:" |
| 13 | + @echo " build - Build the project (stable toolchain)" |
| 14 | + @echo " build-release - Build with optimizations" |
| 15 | + @echo " test - Run all tests" |
| 16 | + @echo " lint - Run all lints (check, clippy, fmt)" |
| 17 | + @echo " ci - Run full CI pipeline (lint + test)" |
| 18 | + @echo "" |
| 19 | + @echo "Individual lint recipes:" |
| 20 | + @echo " check - Run cargo check" |
| 21 | + @echo " clippy - Run clippy lints" |
| 22 | + @echo " fmt - Run rustfmt" |
| 23 | + @echo " fmt-check - Check formatting without modifying" |
| 24 | + @echo "" |
| 25 | + @echo "Individual test recipes:" |
| 26 | + @echo " test-core - Test lancelot core library" |
| 27 | + @echo " test-flirt - Test lancelot-flirt library" |
| 28 | + @echo " test-pylancelot - Test pylancelot (Rust + Python)" |
| 29 | + @echo " test-pyflirt - Test pyflirt (Rust + Python)" |
| 30 | + @echo "" |
| 31 | + @echo "Development recipes (uses cranelift for faster builds, requires nightly):" |
| 32 | + @echo " dev-build - Fast build with cranelift" |
| 33 | + @echo " dev-check - Fast check with cranelift" |
| 34 | + @echo " warmup - Populate rustc cache with various profiles" |
| 35 | + |
| 36 | +# ============================================================================ |
| 37 | +# Main build recipes |
| 38 | +# ============================================================================ |
| 39 | + |
| 40 | +# Build the project (stable toolchain) |
| 41 | +build: |
| 42 | + cargo build |
9 | 43 |
|
10 | | - # build unicorn dep, which is only used in tests, and takes a while |
11 | | - -cd core && env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly test -Zcodegen-backend |
12 | | - -cd core && cargo test |
| 44 | +# Build with optimizations |
| 45 | +build-release: |
| 46 | + cargo build --release |
13 | 47 |
|
| 48 | +# ============================================================================ |
| 49 | +# Lint recipes (matches CI workflow) |
| 50 | +# ============================================================================ |
| 51 | + |
| 52 | +# Run cargo check |
14 | 53 | check: |
15 | | - env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly check -Zcodegen-backend |
| 54 | + cargo check |
16 | 55 |
|
| 56 | +# Run clippy with warnings as errors (requires nightly) |
17 | 57 | clippy: |
18 | | - env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly clippy -Zcodegen-backend |
| 58 | + cargo +nightly clippy -- -D warnings |
19 | 59 |
|
| 60 | +# Format code with rustfmt (requires nightly for all features) |
20 | 61 | fmt: |
21 | | - cargo +nightly fmt |
| 62 | + cargo +nightly fmt --all |
| 63 | + |
| 64 | +# Check formatting without modifying files |
| 65 | +fmt-check: |
| 66 | + cargo +nightly fmt --all -- --check |
| 67 | + |
| 68 | +# Run all lints: check, clippy, and format check |
| 69 | +lint: check clippy fmt-check |
22 | 70 |
|
23 | | -lint: check clippy fmt |
| 71 | +# ============================================================================ |
| 72 | +# Test recipes (matches CI workflow) |
| 73 | +# ============================================================================ |
| 74 | + |
| 75 | +# Run all tests |
| 76 | +test: test-core test-flirt test-pylancelot test-pyflirt |
24 | 77 |
|
| 78 | +# Test lancelot core library |
25 | 79 | test-core: |
26 | | - cd core && \ |
27 | | - env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly test -Zcodegen-backend |
| 80 | + cargo test -p lancelot |
28 | 81 |
|
| 82 | +# Test lancelot-flirt library |
29 | 83 | test-flirt: |
30 | | - cd flirt && \ |
31 | | - env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly test -Zcodegen-backend |
| 84 | + cargo test -p lancelot-flirt |
32 | 85 |
|
| 86 | +# Test pylancelot Rust code |
33 | 87 | test-pylancelot-rs: |
34 | | - cd pylancelot && \ |
35 | | - cargo test # can't use cranelift when linking to python |
| 88 | + cd pylancelot && cargo test |
36 | 89 |
|
| 90 | +# Test pylancelot Python code |
37 | 91 | test-pylancelot-py: |
38 | 92 | bash .github/scripts/pytest-pylancelot.sh |
39 | 93 |
|
| 94 | +# Test pylancelot (both Rust and Python) |
40 | 95 | test-pylancelot: test-pylancelot-rs test-pylancelot-py |
41 | 96 |
|
| 97 | +# Test pyflirt Rust code |
42 | 98 | test-pyflirt-rs: |
43 | | - cd pyflirt && \ |
44 | | - cargo test # can't use cranelift when linking to python |
| 99 | + cd pyflirt && cargo test |
45 | 100 |
|
| 101 | +# Test pyflirt Python code |
46 | 102 | test-pyflirt-py: |
47 | 103 | bash .github/scripts/pytest-pyflirt.sh |
48 | 104 |
|
| 105 | +# Test pyflirt (both Rust and Python) |
49 | 106 | test-pyflirt: test-pyflirt-rs test-pyflirt-py |
50 | 107 |
|
51 | | -test: test-core test-flirt test-pylancelot test-pyflirt |
| 108 | +# ============================================================================ |
| 109 | +# CI recipe - run the full pipeline |
| 110 | +# ============================================================================ |
52 | 111 |
|
53 | | -build: |
| 112 | +# Run full CI pipeline (matches GitHub Actions workflow) |
| 113 | +ci: lint test |
| 114 | + |
| 115 | +# ============================================================================ |
| 116 | +# Development recipes (optional - uses cranelift for faster builds) |
| 117 | +# ============================================================================ |
| 118 | + |
| 119 | +# Fast build with cranelift (requires nightly) |
| 120 | +dev-build: |
54 | 121 | env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly build -Zcodegen-backend |
55 | 122 |
|
56 | | -build-release: |
57 | | - cargo build --release |
| 123 | +# Fast check with cranelift (requires nightly) |
| 124 | +dev-check: |
| 125 | + env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly check -Zcodegen-backend |
| 126 | + |
| 127 | +# Fast clippy with cranelift (requires nightly) |
| 128 | +dev-clippy: |
| 129 | + env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly clippy -Zcodegen-backend |
| 130 | + |
| 131 | +# Build with various profiles to populate the rustc cache |
| 132 | +warmup: |
| 133 | + # build with cranelift |
| 134 | + -env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly build -Zcodegen-backend |
| 135 | + # build without cranelift (as hx will do) |
| 136 | + -cargo build |
| 137 | + # build in release profile |
| 138 | + -cargo build --release |
| 139 | + # build unicorn dep, which is only used in tests, and takes a while |
| 140 | + -cd core && env CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift cargo +nightly test -Zcodegen-backend |
| 141 | + -cd core && cargo test |
0 commit comments