-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
140 lines (125 loc) · 3.66 KB
/
Copy pathTaskfile.yml
File metadata and controls
140 lines (125 loc) · 3.66 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
version: '3'
vars:
PREFIX:
sh: echo "$HOME/.local"
BIN_DIR:
sh: echo "$HOME/.local/bin"
LIB_DIR:
sh: echo "$HOME/.local/lib/yobo"
tasks:
default:
desc: Build everything
deps: [build]
build-init:
desc: Build Go yobo-init (static binary)
dir: yobo-init-go
cmds:
- CGO_ENABLED=0 go build -ldflags="-s -w" -o yobo-init .
sources:
- "*.go"
- go.mod
- go.sum
- . # Detect new files added to directory
generates:
- yobo-init
build:
desc: Build yobo CLI with embedded init
deps: [build-init]
cmds:
- cargo build --release
sources:
- src/**/*.rs
- Cargo.toml
- Cargo.lock
- build.rs
- yobo-init-go/yobo-init
generates:
- target/release/yobo
build-dev:
desc: Build yobo CLI (dev mode, no embedding)
cmds:
- cargo build
install:
desc: Install yobo to ~/.local/bin with bundled libraries
deps: [build]
vars:
LIBKRUNFW_SRC: libkrunfw/build/libkrunfw/libkrunfw.so.5.99.0
LIBKRUN_SRC: libkrun/build/libkrun/target/release
cmds:
- mkdir -p "$HOME/.local/bin"
- mkdir -p "$HOME/.local/lib/yobo"
# Install binary and wrapper
- cp target/release/yobo "$HOME/.local/bin/yobo.bin"
- |
cat > "$HOME/.local/bin/yobo" << 'WRAPPER'
#!/bin/sh
# Wrapper to set library path for yobo's custom libkrun/libkrunfw
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LIB_DIR="$(dirname "$SCRIPT_DIR")/lib/yobo"
export LD_LIBRARY_PATH="$LIB_DIR:$LD_LIBRARY_PATH"
exec "$SCRIPT_DIR/yobo.bin" "$@"
WRAPPER
- chmod +x "$HOME/.local/bin/yobo"
# Install custom libkrunfw if built
- |
if [ -f "{{.LIBKRUNFW_SRC}}" ]; then
cp "{{.LIBKRUNFW_SRC}}" "$HOME/.local/lib/yobo/"
ln -sf libkrunfw.so.5.99.0 "$HOME/.local/lib/yobo/libkrunfw.so.5"
ln -sf libkrunfw.so.5 "$HOME/.local/lib/yobo/libkrunfw.so"
echo "Installed libkrunfw to $HOME/.local/lib/yobo"
fi
# Install custom libkrun if built
- |
LIBKRUN_SO=$(find {{.LIBKRUN_SRC}} -name "libkrun.so.*.*.*" -type f 2>/dev/null | head -1)
if [ -n "$LIBKRUN_SO" ]; then
cp "$LIBKRUN_SO" "$HOME/.local/lib/yobo/"
BASENAME=$(basename "$LIBKRUN_SO")
MAJOR=$(echo "$BASENAME" | sed 's/libkrun\.so\.\([0-9]*\).*/\1/')
ln -sf "$BASENAME" "$HOME/.local/lib/yobo/libkrun.so.${MAJOR}"
ln -sf "libkrun.so.${MAJOR}" "$HOME/.local/lib/yobo/libkrun.so"
echo "Installed libkrun to $HOME/.local/lib/yobo"
fi
- echo "Installed yobo to $HOME/.local/bin/yobo"
test:
desc: Run all tests
deps: [test-rust, test-init]
test-rust:
desc: Run Rust tests
cmds:
- cargo test
test-init:
desc: Run Go yobo-init tests
dir: yobo-init-go
cmds:
- go test -v ./...
clean:
desc: Clean build artifacts
cmds:
- cargo clean
- rm -f yobo-init-go/yobo-init
check:
desc: Run cargo check and clippy
cmds:
- cargo check
- cargo clippy -- -D warnings
# libkrunfw - custom kernel with eBPF support
libkrunfw:
desc: Build custom libkrunfw with eBPF support
dir: libkrunfw
cmds:
- ./build.sh
libkrunfw-install:
desc: Build and install to ~/.local/lib/yobo (no sudo needed)
dir: libkrunfw
cmds:
- ./build.sh install
libkrunfw-install-system:
desc: Build and install to /usr/local/lib64 (requires sudo)
dir: libkrunfw
cmds:
- ./build.sh install-system
libkrunfw-clean:
desc: Clean libkrunfw build artifacts
dir: libkrunfw
cmds:
- ./build.sh clean