summaryrefslogtreecommitdiff
path: root/Magefile.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-06 09:35:55 +0300
committerPaul Buetow <paul@buetow.org>2026-05-06 09:35:55 +0300
commitfbb7c9a9ad8d03d5d095ac441a58b37537e0ab8d (patch)
tree2ccb042e90ca3ed99e13d9e7bf36948e7e362936 /Magefile.go
parent3b20f2c4d16c7b7f583e9ab2b51213e9ddc94fd5 (diff)
add Dockerfile and Rocky Linux 9 build docs
Introduces a Docker-based build path so ior can be compiled on any Linux host without a native Rocky 9 toolchain setup: - Dockerfile: Rocky 9 minimal image with Go (version from ARG, default from go.mod), static libelf/libzstd built from source, libbpfgo at v0.9.2-libbpf-1.5.1, and mage; CMD runs mage generate + mage all against the repo root mounted as a volume. - scripts/build-with-docker.sh: reads GO_VERSION from go.mod, passes it as --build-arg to docker build, mounts tracefs and BTF into the container, writes the binary to the repo root. - Magefile.go: adds BuildDocker target that wraps the script. - README.md: simplified to the two build paths (Docker + native) with links to docs/; removed GOTOOLCHAIN=auto throughout. - docs/build-rocky-linux-9.md: full manual Rocky 9 steps, libbpfgo toolchain setup/rollback, compile-once-run-everywhere explanation, and timing semantics. - docs/tui-reference.md: complete TUI hotkey reference, recording mode details, and the .ior.zst vs Parquet trade-off table. - AGENTS.md: removed GOTOOLCHAIN=auto from all build commands. - internal/c/generated_tracepoints.c: regenerated against the host kernel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'Magefile.go')
-rw-r--r--Magefile.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/Magefile.go b/Magefile.go
index cf1adfb..e9458b5 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -40,6 +40,7 @@ const (
tracepointsResultNew = "internal/c/generated_tracepoints_result.txt.new"
tracepointsGoPath = "internal/tracepoints/generated_tracepoints.go"
typesGoPath = "internal/types/generated_types.go"
+ dockerBuildScript = "scripts/build-with-docker.sh"
typesHeaderPath = "internal/c/types.h"
VMLINUXPath = "internal/c/vmlinux.h"
benchProfilesDir = "bench-profiles"
@@ -72,6 +73,16 @@ func All() error {
return nil
}
+// BuildDocker builds the ior binary inside a Rocky Linux 9 Docker container
+// and writes the resulting static binary to the repo root. The container
+// image is built on the first run (~15-20 min) and reused thereafter.
+// The Go version baked into the image is taken from go.mod automatically.
+// Requires Docker and a host kernel with tracefs and BTF enabled.
+// Pass --run to skip the image rebuild and only recompile ior.
+func BuildDocker() error {
+ return sh.RunV("bash", dockerBuildScript)
+}
+
// BpfBuild builds the embedded BPF object used by the Go binary.
func BpfBuild() error {
if err := ensureVMLINUX(); err != nil {