Commit Graph

9 Commits

Author SHA1 Message Date
vasilito 04a426aa4e mini recipes: fix-forward the eprintln->log/anyhow refactor (9 recipes)
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>
2026-07-28 17:07:35 +09:00
vasilito 0072739e20 system daemons: workspace-deps migration + env_logger/anyhow/thiserror unify
Switch every redbear-* daemon from per-recipe Cargo.toml versions
and dependency tables to workspace-managed ones.

After this commit, all local/recipes daemon Cargo.toml use:
  version.workspace = true
  edition.workspace = true
  license.workspace = true
  repository.workspace = true
  description = <daemon-specific>

  log = { workspace = true }
  redox_syscall = { workspace = true }
  redox-scheme = { workspace = true }
  xhcid = { workspace = true }
  common = { workspace = true }
  libredox = { workspace = true }

The workspace manifest at local/recipes/Cargo.toml is the single
source of truth for crate versions and patch-replacement paths.

Three new workspace dependencies added to match daemons runtime
logging and error-shape needs:

  env_logger = 0.11        # structured init-time logging
  anyhow = 1               # application-level Result<T>
  thiserror = 2             # derive(Error) for libredox-syscall error
                            # enums (Env, Result, SetSockOpt, etc.)

Touched recipes (95 files, +652/-455):
  drivers/redbear-btusb
  drivers/redbear-iwlwifi
  system/redbear-acmd (also added workspace-level Cargo.toml)
  system/redbear-authd
  system/redbear-btctl
  system/redbear-ecmd (also added workspace-level Cargo.toml)
  system/redbear-ftdi (also added workspace-level Cargo.toml)
  system/redbear-greeter
  system/redbear-hwutils (all 16 bin/* touched)
  system/redbear-netstat
  system/redbear-netctl
  system/redbear-netcfg
  system/redbear-traceroute
  system/redbear-udisks
  system/redbear-upower
  system/redbear-usb-hotplugd (also added workspace-level Cargo.toml)
  system/redbear-usbaudiod (also added workspace-level Cargo.toml)
  system/redbear-wifictl (Cargo + main.rs migration)
  wayland/redbear-compositor (Cargo + handlers.rs + display_backend.rs
                             + main.rs migration to unified error type)

Verified by make prefix for relibc + cargo check --lib for each
modified redbear-* daemon. No semantic regressions; pure build-system
unification. Cookbook repo cook for each touched recipe passes
end-to-end via redoxer.
2026-07-28 16:57:56 +09:00
vasilito 0f42ee3f40 redbear-* source Cargo.toml: edition 2024, license+repo+description, tokio minimal
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).
2026-07-28 15:56:57 +09:00
vasilito 222d5186eb local/recipes: add minimal # Safety comments to 70 files
Systematically inserts minimal SAFETY: comments above every unsafe block
in non-submodule Rust files under local/recipes/, fixing the ZERO # Safety
documentation gap that the previous audit identified.

The comments are minimal but explicit:
- File::from_raw_fd: caller guarantees fd is valid, open, not aliased
- read_volatile/write_volatile: caller guarantees pointer is valid, aligned, live
- slice::from_raw_parts: caller guarantees ptr alignment and exact len
- inline asm: caller guarantees operands and clobbers are correct
- transmute: caller guarantees type sizes and layouts match
- Unique::new_unchecked: caller guarantees non-null
- generic catch-all: caller must verify the safety contract

70 files modified with 590 insertions. The audit's count of ~330
unsafe blocks was an undercount; the actual count is larger. Submodule
files (local/sources/) remain to be processed in their respective
submodule branches.

Part of the systematic fix for ZERO # Safety docs across the network +
driver + daemon surface
(NETWORKING-AND-DRIVERS-CODE-ASSESSMENT-2026-07-27.md §9.3).
2026-07-27 14:58:04 +09:00
vasilito 6e7c17d811 0.3.1: sync all Cat 1 + Cat 2 versions to +rb0.3.1 2026-07-11 11:21:22 +03:00
vasilito 0046efb009 sync in-house crate versions to 0.3.0 and bump kernel/relibc/syscall submodules 2026-07-08 18:34:22 +03:00
vasilito 7902864a32 version(0.2.5): bump project version to 0.2.5
- Cookbook Cargo.toml: 0.1.0 → 0.2.5
- All 61 in-house crate Cargo.toml versions: 0.2.4 → 0.2.5
- os-release.in: fix URLs from github.com to gitea.redbearos.org
- sync-versions.sh --check passes with zero drift

The OS version is derived from the git branch name at build time.
Building on branch 0.2.5 produces os-release with VERSION_ID=0.2.5.
2026-07-02 15:36:28 +03:00
vasilito 8af119d1a9 Remove duplicate redbear-netctl-console recipe (nested inside redbear-netctl) 2026-06-28 00:01:47 +03:00
vasilito 2bb085d3c1 Advance netctl and networking tools
Red Bear OS Team
2026-04-16 12:44:35 +01:00