Aether provides generated project files for two language servers:
- Rust —
rust-project.jsonconsumed byrust-analyzer. - C/C++ —
compile_commands.jsonconsumed byclangd.
It is not necessary to sync before opening the project for the first time; the
files may already be present in the repository. Run the sync command to pick up
changes made since the last sync (new or removed source files, modified
BUILD.bazel targets, or a different target architecture), then restart the
affected language server (rust-analyzer, clangd, or both):
# x86_64 targets
bazel run //tooling/sync_ide --config x86_64
# aarch64 targets
bazel run //tooling/sync_ide --config aarch64This invokes two helper scripts:
discover_bazel_c_compile_commands.py— usesbazel aqueryto extract C compile commands and writescompile_commands.jsonto the workspace root.discover_bazel_rust_project.sh— usesbazel buildwith@rules_rust//tools/rust_analyzer:gen_rust_projectto generaterust-project.jsonforrust-analyzer.
The repository includes .vscode/ configuration:
- Recommended extensions — see
.vscode/extensions.json. Install them via Extensions → … → Show Recommended Extensions. The key extensions arerust-lang.rust-analyzer(Rust) andllvm-vs-code-extensions.vscode-clangd(C/C++). - Settings (
.vscode/settings.json) — pre-configuresrust-analyzerto loadrust-project.jsonfrom the workspace root, andclangdwith the correct compile-commands directory and query-driver path for the Bazel-managed LLVM toolchain. - Tasks — the default build task (Terminal → Run Build Task,
Ctrl+Shift+B) runs theSync Project (C + Rust)command and prompts you to pick an architecture. - Launch configurations (
.vscode/launch.json) — three configurations for attachinglldb-dapto a running QEMU GDB stub:- Debug kernel in Qemu — attaches to
bazel-bin/kernel/entry/kernel - Debug init in Qemu — attaches to
bazel-bin/init/init - Debug hello_world in Qemu — attaches to
bazel-bin/hello_world/hello_world
- Debug kernel in Qemu — attaches to
The repository includes .zed/ configuration:
- Tasks (
.zed/tasks.json) — preconfigured tasks:- Sync Project for x86_64 (C + Rust) — regenerates project files
- Qemu run x86_64 / Qemu run aarch64 — run in QEMU
- Qemu debug aarch64 — start QEMU with debugger stub
- Reformat Bazel — run
buildifieron all BUILD files
- Debug (
.zed/debug.json) — a Qemu debug configuration usingCodeLLDBto attach to127.0.0.1:1234.
# x86_64
bazel run //:qemu-debug --config x86_64
# aarch64 (use -c dbg for unoptimized build)
bazel run //tooling/qemu:debug --config aarch64 -c dbgQEMU starts paused, waiting for a debugger on port 1234.
VS Code / lldb-dap: Select the appropriate configuration in the Run and Debug panel and press Start Debugging (F5). Make sure QEMU is already running and paused.
Zed / CodeLLDB: Run the Qemu debug task in the debug panel.
Command-line LLDB:
lldb bazel-bin/kernel/entry/kernel
(lldb) gdb-remote 1234Command-line GDB:
gdb bazel-bin/kernel/entry/kernel
(gdb) target remote :1234
(gdb) continueTo debug a userspace binary, attach with the path to that binary's ELF file instead of the kernel. The symbols and source locations are read from there. For example in VS Code, use the Debug init in Qemu or Debug hello_world in Qemu launch configurations.
Tip: Building with
-c dbg(bazel run ... -c dbg) disables compiler optimizations and produces richer debug information.
Because Aether uses Bazel, new source files must be added to the relevant
BUILD.bazel target in addition to being created on disk. After doing so, run
the IDE sync command again to pick up the new file in compile_commands.json /
rust-project.json.
bazel clean— clean cached build outputs.bazel clean --expunge— deep clean, including external deps.bazel query //...— list available build targets.bazel query 'deps(//kernel/entry:kernel)'— show what a target depends on.bazel build //... --config x86_64 --verbose_failures— build with verbose output.buildifier --mode=fix --lint=fix -r .— format all BUILD files.