-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
123 lines (94 loc) · 3.57 KB
/
justfile
File metadata and controls
123 lines (94 loc) · 3.57 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
# Convenience recipes over `cmake --build build --target X` plus a few
# arg-taking helpers that are awkward to express as CMake targets.
#
# Nothing here is load-bearing — CMake owns the build graph. Edit
# CMakeLists.txt / cmake/*.cmake for behaviour changes; this file is
# passthrough.
#
# On first checkout:
# just configure # cmake --preset riscv64-virt
# just toolchain # cmake --build build --target toolchain-all (~2 min)
# then:
# just # default: build the kernel binary
#
# Use `just --list` for a listing of recipes.
BUILD_DIR := env_var_or_default("BUILD_DIR", "build")
KERNEL_ELF := "target/riscv64gc-unknown-none-elf/release/boot"
default: build
configure:
cmake --preset riscv64-virt
build:
cmake --build {{BUILD_DIR}} --target solaya
toolchain:
cmake --build {{BUILD_DIR}} --target toolchain-all
run:
cmake --build {{BUILD_DIR}} --target run
run-fb:
cmake --build {{BUILD_DIR}} --target run-fb
disasm:
cmake --build {{BUILD_DIR}} --target disasm
# Debug session with optional [FUNC] or [USERBIN FUNC] breakpoints — see
# scripts/debug.sh for the full arg grammar.
debug *ARGS:
./scripts/debug.sh {{ARGS}}
attach:
./scripts/attach.sh
# Resolve a kernel address to file:line via the cross-toolchain's
# llvm-addr2line wrapper. Useful when triaging a panic backtrace.
addr2line ADDR:
{{BUILD_DIR}}/toolchain/bin/riscv64-linux-musl-addr2line -e {{KERNEL_ELF}} -f -p -i {{ADDR}}
test: test-unit test-system
test-unit:
cmake --build {{BUILD_DIR}} --target test-unit
# With no TEST, runs the whole suite via CMake. With a TEST argument,
# forwards it to cargo-nextest so you can iterate on a single test
# (restores the loop-system-test ergonomics from the old justfile).
test-system *TEST:
#!/usr/bin/env bash
set -euo pipefail
if [ -z "{{TEST}}" ]; then
cmake --build {{BUILD_DIR}} --target test-system
else
# Ensure buildroot cpio exists; tests read SOLAYA_INITRD at runtime.
cmake --build {{BUILD_DIR}} --target buildroot-all --target solaya-bin
SOLAYA_INITRD="$(pwd)/.buildroot/output/images/rootfs.cpio" \
cargo nextest run --release \
--manifest-path system-tests/Cargo.toml \
--target x86_64-unknown-linux-gnu \
{{TEST}}
fi
clippy:
cmake --build {{BUILD_DIR}} --target clippy
shellcheck:
cmake --build {{BUILD_DIR}} --target shellcheck
miri:
cmake --build {{BUILD_DIR}} --target miri
fmt-check:
cmake --build {{BUILD_DIR}} --target fmt-check
ci:
cmake --build {{BUILD_DIR}} --target ci
menuconfig:
cmake --build {{BUILD_DIR}} --target menuconfig
savedefconfig:
cmake --build {{BUILD_DIR}} --target savedefconfig
olddefconfig:
cmake --build {{BUILD_DIR}} --target olddefconfig
# Buildroot-side reconfiguration — distinct from the kernel Kconfig
# wrappers above. menuconfig opens buildroot's TUI; savedefconfig
# writes the minimal config back to configs/solaya_riscv64_buildroot_defconfig.in
# (header comments are lost — `git diff` + restore as needed);
# rebuild wipes .buildroot/output and rebuilds from scratch.
buildroot-menuconfig:
cmake --build {{BUILD_DIR}} --target buildroot-menuconfig
buildroot-savedefconfig:
cmake --build {{BUILD_DIR}} --target buildroot-savedefconfig
buildroot-rebuild:
cmake --build {{BUILD_DIR}} --target buildroot-rebuild
mcp-server:
cmake --build {{BUILD_DIR}} --target mcp-server
gdb-mcp-server:
cmake --build {{BUILD_DIR}} --target gdb-mcp-server
mcp-servers:
cmake --build {{BUILD_DIR}} --target mcp-servers
clean:
rm -rf {{BUILD_DIR}}