Files
komorebi/justfile
T
LGUG2Z 76bae0630e build(nix): build and check for macOS and Windows
A flake that builds the recorder for macOS and cross-compiles it for Windows
from a Mac (xwin for the SDK, LLVM for the toolchain), with a dev shell for
each, and `nix flake check` running clippy for both targets, rustfmt, taplo,
cargo-deny and the tests.

The sources of komorebi for Mac and komorebi for Windows are flake inputs,
pinned in `flake.lock`: the recorder indexes them so that a line of komorebi's
log can be traced to the statement that wrote it, and the dev shells and every
derivation export where they are.
2026-10-27 22:22:56 -07:00

66 lines
2.1 KiB
Makefile

export RUST_BACKTRACE := "full"
# everything CI checks, in order; run it inside `nix develop` (direnv does)
check: fmt-check clippy check-windows test doc deny
# nightly rustfmt, which the devShell provides, and the macros this project does not allow
fmt-check:
test -z "$(rg 'eyre!' --type rust)" || (echo "eyre! macro not allowed"; false)
test -z "$(rg 'dbg!' --type rust)" || (echo "dbg! macro not allowed"; false)
cargo fmt --check
# format everything: Rust, TOML, Nix and this file
fmt:
cargo clippy --workspace --all-targets --locked
nix fmt
fix:
cargo clippy --workspace --all-targets --fix --allow-dirty
clippy:
cargo clippy --workspace --all-targets --locked -- -D warnings
# type-check every `cfg(windows)` line, tests included, from a Mac (the Windows devShell targets x86_64-pc-windows-msvc)
check-windows:
nix develop .#windows --command cargo clippy --workspace --all-targets --locked -- -D warnings
# lib, integration and doc tests; the ones that read komorebi's source need KOMOREBI_MAC_SRC, which `nix develop` sets
test:
cargo test --workspace --locked
# rustdoc with its warnings as errors, for both hosts: links in `cfg(windows)` docs are only checked on Windows
doc:
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
nix develop .#windows --command env RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
deny:
cargo deny check
clean:
cargo clean
install:
cargo install --path komorebi-recorder --locked
build:
cargo build --package komorebi-recorder --locked --release
run target:
cargo run --bin {{ target }} --locked
# record a bug repro: screen + komorebi log/events + OS trace, then query it with `komorebi-recorder at`
record *args:
cargo run --bin komorebi-recorder --locked -- {{ args }}
# cross-compile komorebi-recorder.exe and komorebi-recorder-gui.exe into ./result-windows
build-windows:
nix build .#komorebi-recorder-windows --out-link result-windows
deps:
cargo update
just depgen
depgen:
cargo deny check
cargo deny list --format json | jq 'del(.unlicensed)' > dependencies.json