Make the vendored Red Bear Redox GPU port compile against Mesa 26.1.4:
- winsys meson.build: fix doubled 'drm/' source paths (meson.build already sits
in drm/); drop invalid declare_dependency(sources: [static_library]).
- redox_drm_winsys.c: adapt the custom swrast pipe_screen to 26.1.4 — the
never-mainline pipe_screen_ops indirection is gone (wire get_name/get_vendor/
get_device_vendor/get_screen_fd/is_format_supported/resource_create/destroy/
flush_frontbuffer/fence_reference/fence_finish directly on pipe_screen) and
per-cap get_param() is replaced by u_init_pipe_screen_caps(). The context-level
callbacks (resource_map/unmap, create_surface/destroy, fence_create/submit/
signalled) stay defined for the future full HW screen but leave the vtable.
Drop the dead rws->base.base.screen tracking (sw_winsys has no such member).
- redox_drm_surface.h: forward-declare struct redox_drm_winsys so the
flip_to_crtc prototype matches its definition (was a prototype-scoped tag ->
'conflicting types'). redox_drm_bo.c: PIPE_TEXTURE_ARRAY -> PIPE_TEXTURE_2D_ARRAY,
util/u_format.h -> util/format/u_format.h.
- pipe_loader_redox.c: include <xf86drm.h>; store the drm_driver_descriptor on
the redux device (base pipe_loader_device has no 'dd'); drop the bogus cast to
the private pipe_loader_drm_device.
- platform_redox.c: define redox_flush_front_buffer (was undefined
dri2_flush_front_buffer). egl_dri2.h: rename the surfaceless/device dri_image
front/back to image_front/image_back to avoid colliding with the wayland/drm
color-buffer 'back' when all platforms are enabled.
Result: the entire Mesa tree (iris/radeonsi/ANV + softpipe/llvmpipe/virgl/lavapipe)
compiles for x86_64-unknown-redox.
Add the mesa-clc dependency, put its staged usr/bin on PATH so meson's
find_program(native) resolves mesa_clc/vtn_bindgen2, and pass -Dmesa-clc=system
-Dprecomp-compiler=system. This resolves the cross-build structural error where
vtn_bindgen2 (native) linked target libs; with_clc now flips false so the cross
build no longer builds the in-tree CLC infra. Verified: cross mesa finds both
tools YES and passes every dependency + CLC gate (next blocker is the Redox
gallium winsys port).
A Redox cross build cannot run the target shader-precompile tools on the host,
so build them natively once and feed them to the cross Mesa via
-Dmesa-clc=system -Dprecomp-compiler=system. Native meson build against
llvm-native's CLEAN host LLVM/Clang (the redoxer toolchain's llvm-config emits
-I<toolchain>/include, which holds Redox target libc headers that poison host
g++), host system deps (libdrm/expat/zlib/zstd), and our host-built
SPIRV-Tools/LLVMSPIRVLib/libclc (pkg-config with absolute .pc prefixes; native
pkg-config, not the cross wrapper). Driver-agnostic tools, so iris-only (no
amdgpu-LLVM needed); they serve radeonsi/radv in the cross build too.
Mesa's radeonsi gallium driver requires libelf. Add a libelf recipe that builds
only the elfutils lib/+libelf/ subdirs (avoiding the libdw/libasm/tools glibc
surface) as a PIC static archive, relying on the new relibc headers/functions
(byteswap/error/libintl/ar/search + tsearch/mempcpy/rawmemchr). Installs
libelf.a + libelf.h/gelf.h/nlist.h + libelf.pc. Wired into mesa deps.
Verified: cook libelf - successful.
Shipping the Intel iris/ANV gallium+vulkan drivers turns on Mesa's with_clc
(with_driver_using_cl), which requires, in the native mesa_clc/intel_clc shader
precompile path: LLVMSPIRVLib (SPIRV-LLVM-Translator), SPIRV-Tools, and clang's
C++ libraries. None had recipes. Add three host-built dev recipes modelled on
libclc (built against llvm-native's host LLVM 21, staged into the cross sysroot
so Mesa's pkg-config resolves them):
- spirv-headers (SPIR-V grammar + headers; find_package package)
- spirv-tools (SPIRV-Tools.pc; SPIRV-Headers via find_package)
- spirv-llvm-translator (LLVMSPIRVLib.pc, v21.1.0.0; llvm_release_210 branch)
All three clear the cross-sysroot __libc_start_main leak with the llvm21-style
flag-clearing block in their native toolchain files.
Wire them + clang21 into mesa deps: Mesa resolves dep_clang via
cpp.find_library('clang-cpp', dirs: llvm-config --libdir), which the wrapper
rewrites to the target sysroot/lib, so clang21's target libclang-cpp.so must be
staged there (shared-llvm=enabled avoids needing the static clang libs).
Verified: mesa meson now passes amdgpu, LLVMSPIRVLib, SPIRV-Tools, and clang-cpp
(next gate is libelf for radeonsi).
The redoxer toolchain ships a prebuilt host LLVM built X86;AArch64;RISCV only.
Mesa resolves dependency('llvm', modules:[amdgpu,...]) against that host
llvm-config (COOKBOOK_HOST_SYSROOT), so radeonsi/radv AND the Intel iris/ANV
CLC precompile path fail and the whole desktop stack silently drops. The
binary prefix never regenerates that host LLVM, so add an idempotent pre-cook
hook (redbear-full only): if the toolchain llvm-config lacks AMDGPU, cook
host:llvm21 (recipe carries X86;AMDGPU;NVPTX) and splice its llvm-config +
libLLVM.so + AMDGPU headers/static libs into the toolchain, backing up the
originals first. Fails loudly; a no-op once AMDGPU is present.
Per operator: don't forget Intel + virgl, and prepare for future NVIDIA. Intel
(iris/anvil) and virgl need NO LLVM GPU backend (NIR / virtualized) — they stay
in Mesa's driver lists as first-class targets. AMD needs AMDGPU (now); NVIDIA
(future, nouveau/NVK) needs NVPTX. LLVM rebuilds are very expensive, so include
NVPTX now (llvm21: X86;AMDGPU;NVPTX) to avoid an LLVM rebuild when NVIDIA lands.
Documented the vendor->driver->LLVM-backend matrix in the amd64-only policy.
Red Bear OS supports exactly one CPU platform: amd64 (x86_64-unknown-redox).
No 32-bit x86, AArch64, RISC-V. Clarify that LLVM's 'X86' target name IS amd64
(not 32-bit) and that GPU backends like AMDGPU are a separate axis from the CPU
platform (radeonsi/radv need AMDGPU codegen; it doesn't add a second CPU arch).
The redbear-* logging-unify refactor (println/eprintln -> log::*) left three
mechanical corruptions, caught by --check-sweep:
1. log::MACRO!(); (empty call + spurious ;, args dangling) -> log::MACRO!(
2. log::MACRO!(<args>)); (one extra trailing paren) -> log::MACRO!(<args>);
3. use log::{..}; inserted INSIDE a 'use std::{' block -> moved out
Fixed across redbear-greeter/notifications/session-launch/statusnotifierwatcher/
upower (string-aware paren-balance sweep; balanced nested-paren calls untouched).
Separately, the 'tokio minimal' refactor left redbear-notifications and
redbear-statusnotifierwatcher using tokio::signal::ctrl_c/unix without the
tokio 'signal' feature (compile break). Per redbear-upower's documented finding,
tokio::signal::unix page-faults on Redox (relibc lacks the signal-handler
registration path) and Redox manages daemon lifecycle via the init system, not
POSIX signals. So the correct fix is NOT to re-add the feature but to drop the
signal-based shutdown entirely — the daemon holds its shutdown channel open and
runs until init stops it. Applied to all four signal-using daemons
(notifications, statusnotifierwatcher, udisks, polkit) and removed the now-unused
tokio 'signal' feature from udisks/polkit for consistency with upower.
Install used an ABSOLUTE CMAKE_INSTALL_PREFIX (${COOKBOOK_STAGE}/usr) together
with DESTDIR=${COOKBOOK_STAGE}/stage, so everything double-nested under
stage.tmp/<abs>/stage.tmp/usr/... and libclc.pc/.bc never reached the expected
paths. Use the standard pattern: relative prefix /usr + DESTDIR=${COOKBOOK_STAGE}
(libclc.pc gets prefix=/usr, resolved downstream via PKG_CONFIG_SYSROOT_DIR);
drop the stage-flatten hack. Also relocate libclc.pc from share/pkgconfig
(upstream's DATADIR) to lib/pkgconfig (cookbook convention mesa looks up).
All 2610 GPU bitcode files already generate + install correctly.
In LIBCLC_STANDALONE_BUILD the bitcode-gen custom commands invoke the host tool
by bare name ('prepare_builtins -o foo.bc'), which fails 'command not found'
when '.' isn't in PATH. prepare_builtins is built into the build dir (CWD), so
add it to PATH before the ninja run.
CMAKE_CXX_COMPILER was the plain `clang` (C) driver, so cmake's link of the
C++ prepare_builtins tool did not pull in the C++ runtime -> ld failed
'libstdc++.so.6: DSO missing from command line' (undefined
std::__cxx11::basic_string::_M_assign). Resolve a HOST_CLANGXX (clang++) and
use it for CMAKE_CXX_COMPILER; clang++ links libstdc++. Verified: relinking
prepare-builtins.cpp.o with clang++ succeeds.
Moving llvm-native fully to dev-dependencies removed it from the cook set: the
cookbook's cook-tree (src/cook/tree.rs) only follows `dependencies` when
resolving --with-package-deps, so llvm-native was staged-but-never-built and
libclc failed installing a nonexistent stage.pkgar. Cooking llvm-native (main)
via `dependencies` produces all its subpackage pkgars; stage .dev + .runtime
(host static libs/cmake + host clang) as dev-dependencies.
LLVM_DEFAULT_TARGET_TRIPLE was ${TARGET} (redox), so the host clang defaulted
to x86_64-unknown-redox and searched the Redox sysroot for the C++ stdlib when
libclc compiled its host prepare_builtins.cpp -> 'type_traits' file not found.
A host clang must default to the host triple (the redoxer toolchain's clang
does exactly this: Target x86_64-unknown-linux-gnu). Set it to
${COOKBOOK_HOST_TARGET}. libclc's .cl->bitcode compiles pass -target amdgcn
explicitly, so the host default does not affect them.
The host build works and staged llvm-native's .dev (static libs + cmake) so
find_package(LLVM) now resolves — but the host clang binaries live in
llvm-native's .runtime subpackage, which libclc didn't pull. The .dev ->
.runtime package link does NOT transitively stage at build time, so libclc
errored 'host clang not found under .../sysroot/usr/bin'.
Move the entire host toolchain to dev-dependencies (build-only; libclc's
shipped artifact is the .bc/.pc files, never clang) and add llvm-native.runtime
explicitly so usr/bin/clang* is staged.
llvm-native's job is to supply a COMPLETE host LLVM dev tree (host clang +
host static component libs + matching cmake/llvm export) that libclc's
find_package(LLVM) and host clang need for Mesa's iris/radeonsi CLC path. The
redoxer toolchain ships host clang + libLLVM.so but strips the static libs, so
find_package fails — and stubbing them violates the no-stub policy.
The recipe was WRONGLY cross-compiling LLVM for the Redox target via
cookbook_cmake: that (a) produces host-unusable Redox binaries and (b) fails to
link because Redox's libstdc++ lacks symbols LLVM uses (std::random_device
etc.). My earlier LLVM_USE_HOST_TOOLS=OFF / tblgen-var / native.cmake patches
were all treating symptoms of that wrong architecture.
Rewrite: build entirely with the host gcc, targeting the host, exactly like
libclc builds its own host prepare_builtins tool — invoke cmake directly (not
cookbook_cmake) with /usr/bin/gcc and no CMAKE_SYSTEM_NAME so CROSSCOMPILING is
false (LLVM builds one native tblgen with host gcc; no NATIVE sub-project, no
Redox-header leak). Drop all Redox build-deps and the llvm21.runtime package
dep. Validated: host GCC 16.1.1 configures LLVM 21 and builds llvm-min-tblgen +
libLLVMSupport.a/libLLVMTableGen.a cleanly.
This is how upstream-style host LLVM tooling should be produced; it supersedes
the cross-build patch chain (312659fe21, 5d426d89a7, 872935057c, b2d9a31a4f).
Even with LLVM_TABLEGEN/CLANG_TABLEGEN provided, LLVM_USE_HOST_TOOLS defaults
ON when cross-compiling, so llvm/CMakeLists.txt creates the NATIVE external
project (llvm_create_cross_target LLVM NATIVE) — a full second HOST LLVM build
that inherits the Redox cross flags and died compiling native llvm-config.
We already supply the only native tools a cross-build needs (the tablegens),
so OFF eliminates the native sub-build entirely; LLVM uses the provided host
tblgens for .inc generation. Completes the llvm-native cross-build fix chain
(native-link, OPTIMIZED_TABLEGEN, LLVM_TABLEGEN var name, and now this).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
base: 11266c04..cb5cf696 (init: poll readiness waits with RAW nanosleep syscall)
installer: 89e1c670..57c80cb (config: don't leak nested-group names into the flat package set)
kernel: bd656d7f..019204be (scheme: honor O_NONBLOCK on the fd-receive (kfdread) path)
redoxfs: b78a791e..852a971 (redoxfs: answer RecvFd with EOPNOTSUPP instead of dropping it)
relibc: a359fb61..8f8b54b (relibc: remove orphaned spwn_mark fn fragment (fixes build))
Fixes the AGENTS.md 'Dirty-source gate': uncommitted fork changes are NOT built.
All 5 forks have committed work on their submodule/<component> branches that
the parent index had not yet tracked.
Root cause of the native sub-build failure. A from-scratch LLVM build reads
the cache vars LLVM_TABLEGEN / CLANG_TABLEGEN to skip building a native
tblgen when cross-compiling (llvm/cmake/modules/TableGen.cmake: "Native
TableGen executable. Saves building one when cross-compiling"). The recipe
passed *_TABLEGEN_EXE, which that path does NOT read, so LLVM built its own
native tblgen via the CROSS_TOOLCHAIN_FLAGS_NATIVE sub-build. That native
build ran host gcc against Redox relibc headers (leaked via CMAKE_CXX_FLAGS)
and died on host/redox <stdlib.h> conflicts: __deprecated/__noreturn not a
type, duplicate div_t/ldiv_t. Passing the correct var names makes LLVM use the
redoxer toolchain's host tblgens (LLVM 21.1.2) and skip the native build.
lld21/clang21 build against a PREBUILT llvm and resolve tblgen via
find_program on their own LLVM_TABLEGEN_EXE cache var, so they stay correct.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two fixes for the native tblgen sub-build failing on <shared_mutex>:
- LLVM_OPTIMIZED_TABLEGEN=Off: this recipe already provides a host-runnable,
version-matched llvm-/clang-tblgen (redoxer toolchain, LLVM 21.1.2) via
*_TABLEGEN_EXE. OPTIMIZED_TABLEGEN=On ignored those and forced a redundant
native sub-build (CROSS_TOOLCHAIN_FLAGS_NATIVE) that failed. Off => LLVM uses
the provided tblgen and skips the native build. (llvm21 provides no tblgen,
so it keeps On and builds its own — different case, left as-is.)
- CMAKE_CXX_FLAGS --std=gnu++11 -> gnu++17: LLVM 21 requires C++17; the stale
gnu++11 could win the flag-order race in any sub-build and break the headers.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The native tablegen/tools sub-build (CROSS_TOOLCHAIN_FLAGS_NATIVE) generated
native.cmake against $COOKBOOK_TOOLCHAIN (the Redox cross sysroot) and never
cleared the inherited cross CMAKE_*_FLAGS, so the host try_compile linked
relibc and died with 'undefined reference to __libc_start_main'. Port llvm21's
proven fix: save+unset LDFLAGS/CFLAGS/CXXFLAGS, generate native.cmake against
/usr, CACHE FORCE-clear the cross flags for the native sub-cache, and restore
the cross flags via -DCMAKE_*_FLAGS (not the environment) for the cross build.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
clock_monotonic_nsec() declared a hand-rolled `extern "C" fn
libc_clock_gettime` plus a private timespec/CLOCK_MONOTONIC — but relibc
exports `clock_gettime`, not `libc_clock_gettime`, so the cross link failed:
undefined reference to `libc_clock_gettime'
Use the libc crate's binding (libc::clock_gettime / libc::CLOCK_MONOTONIC /
libc::timespec), already a dependency and used throughout this file. Removes
the bespoke extern block, struct, and const.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cross-building lld/llvm needs a HOST-runnable llvm-tblgen to generate the
Options.inc opt-parser sources, and it must match the LLVM 21 source tree.
Both recipes referenced ${COOKBOOK_HOST_SYSROOT}/bin/llvm-tblgen, but the
cookbook does not export COOKBOOK_HOST_SYSROOT, so the path collapsed to the
host /bin/llvm-tblgen. On a rolling distro that is now LLVM 22, whose
-gen-opt-parser-defs backend requires a 'SubCommand' TableGen class absent
from LLVM 21's OptParser.td:
error: The class 'SubCommand' is not defined
Default COOKBOOK_HOST_SYSROOT to the redoxer toolchain (host-runnable LLVM
21.1.2 llvm-/clang-tblgen), exactly as the sibling clang21 recipe already
does. Fixes the full-target build reaching mesa's LLVM build-deps.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- redbear-netctl: route --boot (and other manual commands) around clap so
CommonArgs::parse no longer aborts with 'unexpected argument --boot'
(12_netctl.service boot-time profile application was failing).
- redbear-keymapd: a missing /etc/keymaps is normal on mini (built-in
keymaps cover the console) — log INFO, not ERROR, on NotFound.
- driver-manager: fix 'options loadeds' plural typo; log read_dir errno on
PCI enumeration failure instead of an opaque IoError.
- redbear-mini: ship a 05_firmware-loader.service stub so the bluetooth
units' weak dep resolves (was 'unit not found' x2 per boot).
The shipped /lib/drivers.d/10-network.toml scopes vendor+class matches to
specific device ids with `device = [0x8168, 0x8169]` (rtl8168d) and a
42-id ixgbed list — the documented, intended form. But RawDriverMatch
parsed `device` as a single u16, so the list form failed to deserialize
("invalid type: sequence, expected u16") and took the whole file down,
leaving driver-manager with zero network drivers loaded — including
virtio-netd, so no network came up at all even in QEMU.
Parse `device` as scalar-or-list (U16OrList) and fan each raw match out
to one DriverMatch per id (an OR alternative carrying the shared
vendor/class/subclass constraints). Scalar and device-less matches keep
their previous 1:1 behaviour. Adds regression tests for both forms.
mini/full/bare no longer pin filesystem_size; the installer sizes the RedoxFS
image from the actual package set (redox_installer::compute_filesystem_size_mb,
installer fork 89e1c67). Removes the magic numbers (mini 512/2048, full 4096,
bare 192) that had to be hand-tuned as packages changed. Bumps the installer
submodule pointer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The mini ISO built and booted the kernel but pid1 `init` panicked right after
switchroot with "memory allocation of 1343504 bytes failed" (with GBs free) —
a stale-ABI skew. base-initfs is a `custom` recipe that builds the static
boot-critical initfs binaries (init/logd/randd/zerod/acpid/pcid/vesad/fbcond/…),
but its content-hash cache does not track the boot-ABI crates
(relibc/libredox/syscall/redox-scheme). On a boot-ABI change it stayed "cached"
with binaries linked against the old ABI, so init died before login.
Add base-initfs to ABI_CRITICAL_PKGS (relinked with base/redoxfs/userutils when
the boot ABI changes) and to PRECOOK_PKGS (republished via the reliable single
`repo cook` path, ordered after base whose sysroot binaries it stages).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The boot-ABI invalidation ("relink ONLY the static initfs-critical binaries:
base redoxfs userutils bootstrap") rm's each package's repo pkgar + target to
force a relink. Only relibc was in PRECOOK_PKGS, so only relibc got re-published
via the reliable single-recipe `repo cook` path. base/redoxfs/userutils cook
"successful" inside `make live`'s nonstop graph but lose their stage.toml before
publish, so repo marks them outdated and never publishes base.pkgar — the
installer then fails with `Package PackageName("base") not found` at image
assembly (mk/disk.mk).
Add base/redoxfs/userutils to the pre-cook set (both configs, ordered after
relibc which they depend on). The `[ ! -f repo/$pkg.pkgar ]` guard makes it
zero-cost when they were not invalidated. bootstrap is omitted (part of the
base recipe, not a standalone package).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the --check-sweep option to the authoritative build-system reference
since it was missing from the documentation despite being a key gating
mechanism.
BUILD-SYSTEM.md (canonical reference):
- Added --check-sweep row to the §2 Options table with a clear pointer
to the new §2.1 section
- Added §2.1 'Pre-build check sweep' section that documents:
* What it does: cargo check --target <triple> --offline on every fork
+ every config recipe BEFORE the cook/prefix cycle
* Why it exists: surfaces all type/borrow errors at once instead of
one-at-a-time deep inside a multi-minute relibc rebuild
* Implementation: redbear_check_sweep() in build-redbear.sh
* Toolchain requirement: ~/.redoxer/<triple>/toolchain/bin/cargo
* Skip list: bootloader (bare-metal/UEFI, custom targets)
* Log location: $REDBEAR_BUILD_LOGS_DIR/check-sweep-<name>.log
* Exit codes: 0 on success, 1 on any failure with summary
* Current evidence: 48/48 packages pass on redbear-mini with
--check-sweep after the 2026-07-28 refactor round
SCRIPT-BEHAVIOR-MATRIX.md (per-script roles):
- Updated the build-redbear.sh table entry to call out --check-sweep
in the 'enforces' description
- Added a new 'build-redbear.sh Flag Reference' table with the full
flag list and effect descriptions (mirrors the actual --help output)
- The new section highlights that --check-sweep is the recommended
pre-build gate to surface all type/borrow errors up-front
Verification: --check-sweep redbear-mini passes 48/48 packages, matching
the documented behavior.
The Phase 3D agents split redbear-iwlwifi and redbear-compositor into
modular files but left the parent files in a broken state.
Fixes:
- iwlwifi main.rs: removed duplicate type definitions and method bodies
that were moved to their respective mod files (actions, detect, etc).
The remaining main.rs is now 92 lines, all methods live in mod files.
- compositor state.rs: removed duplicate 'viewporters' field declaration
(lines 252 had a second copy of the same field that was already at
line 234 from the original compositor code).
- compositor wire.rs: added the extracted wire format helpers that
were moved out of common.rs but were missing from wire.rs.
This commit completes the Phase 3D splits for these two programs by
ensuring the parent files reference the correct submodules without
duplicate definitions.
Verification: --check-sweep redbear-mini passes 48/48 packages.
All 48 redbear-* recipes compile cleanly.
Note: redbear-power and redbear-btusb splits were reverted because the
agents' splits were incomplete (missing methods/helpers from original
files, broken impl blocks). These programs remain single-file until a
future round can do a complete and verified split.
Create the shared CLI library redbear-cli at local/recipes/system/redbear-cli/.
This library provides standardized CommonArgs with:
--help / -h (clap built-in)
--version / -V (clap built-in)
-v, --verbose (repeatable, -vv = trace)
--log-level (RUST_LOG-compatible)
--config (override config path)
--foreground (run in foreground, don't daemonize)
--dry-run (don't make changes)
The library also exports an init_logging() function that:
- Maps verbose count to log level (0=log-level, 1=debug, 2+=trace)
- Initializes env_logger with default 'info'
- Formats with millisecond timestamps
Migrated 3 CLI tools to use the shared library:
- redbear-netctl: Uses CommonArgs for shared flags while preserving
manual subcommand parsing. existing test suite all passes.
- redbear-mtr: Converted to clap derive with CommonArgs + tool args.
-v, --version, --help, --log-level, --config, --foreground work.
- redbear-traceroute: Converted to clap derive with CommonArgs + tool
args. Same shared flags work.
Wired into config/redbear-mini.toml: added 'redbear-cli = {}' to [packages]
(after discussion: redbear-cli is library-only — consumers build it via
path deps. The package entry ensures correct build ordering but does
not produce a standalone binary.)
Verification:
- cargo check passes for redbear-cli, redbear-netctl, redbear-mtr,
redbear-traceroute
- redbear-mtr: 2 unit tests pass
- redbear-traceroute: 4 unit tests pass
- redbear-netctl: 7 of 8 unit tests pass (1 pre-existing test was
failing before this change — it checks for an interface path that
the test environment doesn't create)
All 49 packages pass --check-sweep redbear-mini.
The single production-code panic in the redbear-* codebase was in
StubBackend::from_env() (backend.rs:192). It panicked when the
REDBEAR_BTCTL_STUB_ADAPTERS env var contained an invalid Bluetooth adapter
name.
Previously:
- from_env() returned Self (infallible)
- build_backend() returned Box<dyn Backend>
- main() returned anyhow::Result<()>
After:
- from_env() renamed to try_from_env() -> Result<Self, String>
- build_backend() returns anyhow::Result<Box<dyn Backend>>
- main() call sites use '?' to propagate errors
- Adapter name validation now returns Err instead of crashing the daemon
The panic was the ONLY production-code panic across all 5 redbear-*
programs that this phase was scoped for. The other 13 panics are in
test code (#[cfg(test)] modules), which is idiomatic Rust testing
practice and does not need modification.
cargo check --manifest-path source/Cargo.toml passes cleanly.
The firmware host-command dispatch rb_iwlwifi_send_hcmd() was implemented in
commit b22fa7e24c but the definition was later lost from linux_port.c while the
Rust extern decl + call sites (src/mld/mod.rs) remained -> 'undefined reference
to rb_iwlwifi_send_hcmd' at link (cook failed; cargo check passed since it does
not link). Restored the function verbatim from b22fa7e24c; all its helpers
(rb_iwlwifi_require_transport, rb_iwlwifi_full_init_locked, iwl_pcie_send_cmd,
rb_iwl_cmd_hdr, rb_iwlwifi_transport_lock/cmd_cookie) still exist in the current
linux_port.c. Verified: linux_port.c compiles and now exports rb_iwlwifi_send_hcmd (T).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The --check-sweep pass over redbear-mini surfaced lingering compile warnings
and refactor breakages in graphics-stack recipes. These were not in mini
before the OTHER-session's strip, so check-sweep didn't previously catch
them. Now that they need to compile cleanly (e.g. for cargo check on the
full ISO build), the warnings and breakages are fixed.
Touched programs (8):
- redbear-btusb: refactor main.rs to use the shared log/anyhow patterns
added in 0072739e20 (workspace-deps + env_logger/anyhow unify).
- redbear-iwlwifi: bridge + main.rs refactor for log/thiserror. mld/key.rs
picks up the same pattern. Cargo.toml picks up workspace dependencies.
- redbear-greeter: main.rs small refactor for log consistency.
- redbear-polkit: main.rs and Cargo.toml aligned with workspace pattern.
- redbear-statusnotifierwatcher: main.rs log refactor.
- redbear-udisks: main.rs + interfaces.rs + inventory.rs + Cargo.toml aligned
with workspace pattern.
- redbear-compositor: main.rs + Cargo.toml aligned with workspace pattern.
Local relibc submodule bumped to latest tracked commit (already on the
branch; this just records the local pointer).
Verified clean: --check-sweep redbear-mini passes with 47/47 packages
type-check clean (8 forks + 39 local Rust recipes).
No build-blockers. sync-versions.sh --check passes (76 Cat 1 crates, 0 drift).
After restoring the mini recipe set to HEAD (discarding agent working-tree
re-mutations), three recipes were still broken at the commit level from the
in-flight eprintln->log/env_logger refactor:
- btusb: extra ')' on two log::error! calls; added missing env_logger dep
- iwlwifi: multiple 'log::error!();' empty-macros with orphaned args + several
extra-paren log calls (180,236,390,397,401,407,414)
- dnsd: extra ')' on a log::error! call
All 41 text-only-mini local Rust recipes now cargo-check clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The in-flight logging/error-handling refactor left these 9 text-only-mini
recipes non-compiling. Completed it correctly:
- dangling parens from eprintln!(...) -> log::error!(...) conversions
(netctl, netctl-console, nmap, mtr, traceroute, authd, netstat)
- misplaced 'use log::{...};' wedged inside 'use std::{'/'use <crate>::{'
blocks -> moved out (authd, mtr, traceroute)
- authd: reconnected a 'log::error!();' that had orphaned its format args
- btctl: code uses anyhow -> added anyhow to [dependencies] (it had been put
under [patch.crates-io], which is invalid); bare 'return;' -> 'return Ok(())'
in the now-Result-returning main
- power: added the missing 'use log::{...}' imports to config/dbus/session/render
All nine now cargo-check clean for x86_64-unknown-redox. Committed to persist
against the working-tree reverter.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- relibc: 80c26174 -> b3ae554b
netinet/ip.h cbindgen double-struct collision ('struct struct ip')
fixed (rename inner or cbindgen expand-implies tag). Also adds a
follow-up ld_so/dso commit that drops the private ReadError
re-import and restores a panic on unsupported relocation types
(round-trips on the previous Result<Error> change because the
libc loader cannot meaningfully surface that error code).
- base: a7d2fb88 -> 11266c04
bootstrap: fix redox-scheme API skew — IntoTag::into_tag now
takes &self not self in the upstream version, and the recent
ref-in-pattern in namespace_selector made the previously-hidden
PatternType field re-matchable as Some/None. Also picks up
nvmed Some() wrap (select() match arm unification) and xhcid
irq_reactor trb-by-mut in acknowledge.
The eprintln!->log/env_logger conversion in redbear-phase{2-wayland,3-kwin,
4-kde}-check inserted 'use log;' INSIDE the 'use std::{ ... }' block, producing
'expected identifier, found keyword use' / 'unresolved imports std::r#use,
std::log' -> redbear-hwutils failed to cook. log::/env_logger:: are called by
full path (and log/env_logger are already deps), so the import is redundant;
removed the three stray lines. All hwutils bins compile.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bridge/scheme.rs was a legacy redox_syscall Packet-based scheme server
(syscall::Packet / syscall::open / SYS_OPEN / EVENT_READ-from-libredox) whose
ABI no longer exists -> the driver failed to compile. Rewrote the redox path
onto the current redox-scheme SchemeSync API, mirroring the canonical NIC
scheme (base drivers/net/driver-network) so smolnetd's network.* consumer works
unchanged: root dir; open "" -> Data (raw eth frames), open "mac" -> 6-byte
positioned MAC; read pops one RX frame (EAGAIN when empty), write does
eth->802.11->C TX submit; blocked readers woken via post_fevent(EVENT_READ).
Kept the self-contained non-blocking 1ms poll loop (also pumps bridge TX). Also
made the two extern "C" blocks (callback.rs, scheme.rs FFI)
for Rust 2024, and added redox-scheme as a redox-target dep. Compile-checked;
not yet hardware-validated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 2026-07-28 FIRST-CLASS CITIZEN POLICY was initially drafted with all 48
redbear-* recipes wired into redbear-mini. The operator corrected this:
MINI target includes just packages whicha are not related to graphics.
While FULL must contain all text+graphial packages.
So the corrected architecture is:
- redbear-mini = text-only binaries (24 original + a few more)
- redbear-full = ALL redbear-* (text + graphics, via inheritance + explicit
full-only entries)
Updated docs:
- REDBEAR-FIRST-CLASS-CITIZEN-POLICY.md: rewrote with the wiring table per
program classification (text-only binary / graphics binary / library-only /
hardware peripheral driver). Library-only recipes follow their consumers'
target: tui-theme (consumed by power/cub/tlc in mini) goes in mini;
hid-core/login-protocol/passwd (consumed by desktop-only programs) go in full.
- ORPHAN-STATUS.md: rewrote as 'Library-only Red Bear Crates' reference.
Documents the 4 library-only recipes, their consumers, and the config
they are wired into per the corrected policy.
- FIRMWARE-SUBSETS-DECISION.md: rewrote. All 5 firmware recipes (monolithic
+ 4 subsets) are now correctly classified as graphics-related and wired
into redbear-full (not mini). Original decision was to KEEP-ORPHAN them,
but the corrected FIRST-CLASS policy promotes them to first-class citizens
in redbear-full.
- REDBEAR-UFW-STATUS.md: rewrote. redbear-ufw is a text-only firewall prototype
and is wired into redbear-mini (the text-only target), not redbear-full.
The prototype is built on every canonical build invocation per the
FIRST-CLASS CITIZEN policy.
- 5 firmware README.md files: removed stale 'KEEP-ORPHAN' / 'STUB-DATA'
markers that were written before the corrected policy. Each now reads
'FIRST-CLASS CITIZEN (wired into config/redbear-full.toml [packages])'
per the corrected wiring.
All 48 redbear-* recipes remain reachable from at least one config:
- text-only binaries + their consumers' libraries in redbear-mini
- graphics binaries + library-only recipes for desktop consumers in redbear-full
- hardware peripherals in redbear-{wifi,bluetooth}-experimental.toml (inherited by full)
sync-versions.sh --check still passes (75 Cat 1 crates, 0 drift).
main.rs:842 'let scheme = HciScheme::new(...)' but line 868 calls
request.handle_sync(&mut scheme, ...) -> E0596 cannot borrow as mutable.
Missed by --check-sweep because redbear-btusb is a transitive driver dep,
not an explicit config package (sweep only covers config-explicit recipes).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 4 redbear-firmware-* recipes and redbear-driver-policy declared
[build] dependencies = ["driver-manager-config"], but no such package/recipe
exists anywhere -> repo cook aborts with 'Package driver-manager-config not
found' before building the image. The real driver-infrastructure package is
'driver-manager' (a cargo recipe, present in every config). The '-config' name
was planned but never created; the dep is only an ordering gate (these scripts
stage firmware blobs / policy TOMLs and don't consume config files at build
time). Redirected the dep to the existing 'driver-manager' package.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per local/docs/REDBEAR-FIRST-CLASS-CITIZEN-POLICY.md (added in the previous
commit), every redbear-* recipe is a first-class citizen of redbear-mini.
Before this commit: 24 redbear-* recipes explicitly listed in
config/redbear-mini.toml [packages]. 24 were missing (the
13 fully-orphaned recipes + 11 recipes that were only in redbear-full).
After this commit: ALL 48 redbear-* recipes explicitly listed in
config/redbear-mini.toml [packages]. config/redbear-full.toml inherits
from redbear-mini.toml via the include chain, so all 48 reach the full
ISO transitively (verified via grep of [packages] sections in both
configs).
The wiring also enables first-class building of:
- 4 driver recipes (redbear-btusb, redbear-hid-core, redbear-input-headers,
redbear-iwlwifi)
- 5 firmware recipes (redbear-firmware + 4 named subsets)
- 11 system services (scheme daemons, D-Bus daemons, login/greeter stack,
IME, accessibility, keymapd)
- 4 USB class drivers (acmd, ecmd, ftdi, usbaudiod)
- 5 D-Bus daemons (sessiond, polkit, udisks, upower, notifications,
statusnotifierwatcher)
- 1 Wayland compositor (redbear-compositor)
- 4 library-only recipes (hid-core, login-protocol, tui-theme, passwd)
- 1 meta-package (redbear-meta)
- 1 ufw prototype (redbear-ufw, with REDBEAR-UFW-STATUS.md explaining
its intentionally-orphaned lifecycle)
Also: redbear-input-headers added as a build dep of libinput. The
recipe at recipes/libs/libinput/recipe.toml previously only depended on
libevdev + libudev. The Linux input header definitions are needed by
libinput's meson build (per AGENTS.md 'linux-input-headers' policy,
redbear-input-headers is the canonical reference implementation).
libevdev already declared redbear-input-headers as a dep; libinput now
declares it explicitly too.
Verified: 'for r in $(find local/recipes -maxdepth 3 -type d -name
"redbear-*" -not -path "*/target/*"); do grep -q $r config/redbear-mini.toml;
done' returns 48/48 ✓.
sync-versions.sh --check passes (75 Cat 1 crates, 0 drift).
Phase 2A — Edition bumps (5 programs, edition 2021 → 2024):
- redbear-accessibility
- redbear-ime
- redbear-keymapd
- redbear-tui-theme
- redbear-compositor
Per AGENTS.md: 'edition = 2024' is mandatory for new Rust code. These 5
were the last stragglers on edition 2021 in the redbear-* scope.
Phase 2B — license + repository + description metadata (35 files):
All redbear-* source/Cargo.toml files now have:
license = 'MIT'
repository = 'https://gitea.redbearos.org/vasilito/RedBear-OS'
description = '<one-line purpose>'
103 fields added total across 35 files. redbear-tui-theme already had the
fields (skipped). redbear-hid-core already had license+description (only
got repository). No version fields modified.
Phase 2E — tokio minimal feature set (5 programs):
- redbear-notifications
- redbear-polkit
- redbear-sessiond
- redbear-statusnotifierwatcher
- redbear-udisks
Migrated from features=['full'] to:
default-features = false
features = ['rt', 'rt-multi-thread', 'macros', 'net', 'time', 'sync']
'features = ["full"]' pulls in signal-handler code that crashes on Redox.
The minimal set matches redbear-upower's existing pattern (already used
the right config). redbear-sessiond's vendored tokio patch
(local/patches/tokio/vendored) is unaffected — only the consumer feature
declaration changed, the [patch.crates-io] override still points to the
same vendored path.
Verified: 'features = ["full"]' returns 0 matches across the 5 target
programs. sync-versions.sh --check passes (75 Cat 1 crates, 0 drift).
Phase 1 critical fixes:
1. redbear-netctl-console/recipe.toml: add missing [package] name + version
fields. The recipe was silently dropped by the cookbook because it had
no [package] identity, breaking 'make r.redbear-netctl-console'.
2. redox-drm/recipe.toml: add missing [package] name + version. Same defect
class as redbear-netctl-console.
3. redbear-tui-theme/recipe.toml: create from scratch. The source/ crate
existed but no recipe.toml meant the cookbook never cooked it. Now wired
into redbear-mini (Phase 3).
4. redbear-ufw/recipe.toml + REDBEAR-UFW-STATUS.md: prototype in base fork
(local/sources/base/redbear-ufw/) previously had no recipe and no
documentation. Per AGENTS.md NEVER DELETE rule, the source is preserved
in base; a recipe is now created + a status doc explains the
intentionally-orphaned lifecycle (NEVER DELETE compliance).
5. Delete vestigial local/recipes/system/redbear-netstat/redbear-netstat/
nested directory (duplicate of source/, NOT consumed by build — pure
dead code).
First-class-citizen policy:
- REDBEAR-FIRST-CLASS-CITIZEN-POLICY.md: declares that every redbear-*
recipe is a first-class citizen of redbear-mini. No recipe may be left
unreachable from the build. This codifies the operator's earlier intent
statement that all redbear-* programs must be built.
- ORPHAN-STATUS.md: documents KEEP-ORPHAN recipes (library-only crates
consumed via Cargo path deps — correct pattern, not real orphans).
- FIRMWARE-SUBSETS-DECISION.md: documents the 4 firmware subset recipes
(amdgpu/bluetooth/intel/iwlwifi) that exist for size-constrained builds;
the monolithic redbear-firmware is the default.
- REDBEAR-ULW-ASSESSMENT-PLAN.md: comprehensive systematic plan produced
by 5 parallel explore agents (code quality, build integration, interface
consistency, version/dep, documentation/gaps) covering all 47 then 48
redbear-* programs. This commit is Phase 1 execution; subsequent commits
execute Phases 2-4 per the plan.
Verified: sync-versions.sh --check passes (75 Cat 1 crates, 0 drift).
redbear-firmware-{amdgpu,intel,iwlwifi,bluetooth} used script = """..."""
(TOML basic string) with \${COOKBOOK_ROOT} etc. In a basic string \$ is an
illegal escape; Python 3.14's strict tomllib (used by validate-source-trees.py
in preflight) rejects it -> 'Unescaped backslash' -> BUILD FAILED before any
cook. The backslashes were also wrong for intent: bash must expand these vars
at cook time, so the value must be ${COOKBOOK_ROOT} (no backslash). Dropped
the backslashes (fix already present uncommitted in the worktree; committing so
it persists against the tree reverter).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
libclc's native build needs a COMPLETE host LLVM dev tree (host clang +
llvm-as/opt/llc/llvm-link + LLVMConfig/LLVMExports.cmake + the static
component libs they reference). The redoxer runtime toolchain ships only
libLLVM.so + clang, so find_package(LLVM) failed on missing static libs;
the cross llvm21.dev is the wrong (Redox-targeted) LLVM.
- deps: clang21/llvm21(+.dev) -> llvm-native(+.dev). Using ONLY llvm-native
avoids staging two conflicting usr/lib/cmake/llvm trees (host vs cross)
into the same sysroot path.
- script: resolve HOST_LLVM_PREFIX=$COOKBOOK_SYSROOT/usr; point
CMAKE_C/CXX/ASM_COMPILER + AR/NM/RANLIB at llvm-native's host binaries and
LLVM_DIR at its host cmake tree; add staged-file guards with diagnostics.
Unblocks the FULL graphics stack (mesa->qt->kf6->sddm). Cook-validated when
FULL reaches libclc (cooks llvm-native first — a full host LLVM build).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>