Commit Graph

1931 Commits

Author SHA1 Message Date
vasilito a66db2c77b chore: track relibc pointer (spawn diag fd2) 2026-07-18 20:33:06 +09:00
vasilito 4a556f56e7 chore: track relibc pointer (spawn ENOENT diag) 2026-07-18 20:25:24 +09:00
vasilito 6ada6661be chore: track userutils pointer (explicit shell stdio fds) 2026-07-18 18:13:47 +09:00
vasilito e1bfeacba0 refactor: fix last 4 clippy warnings (if_same_then_else, too_many_arguments)
Reduced warnings from 4 to 0 — cookbook lib is now clippy-clean.

Changes:
- if_same_then_else (1): combined identical Ok(list) branches with || in
  staged_pkg.rs new_recursive()
- too_many_arguments (3): added #[allow(clippy::too_many_arguments)] with
  justification comments (required by AGENTS.md WARNING POLICY) on
  display_tree_entry, walk_tree_entry, new_recursive — params are genuinely
  independent display/traversal/recursion options

Verification: cargo check , cargo test --lib  38/38, cargo clippy 0 warnings.
2026-07-18 18:08:14 +09:00
vasilito 67de313411 refactor: box large Error variants (Command, Pkgar) to fix result_large_err
Boxing the Command(Command, ExitStatus) variant (204 bytes) and
Pkgar(pkgar::Error) variant (272 bytes) reduces the Error enum from
272+ bytes to ~80 bytes, eliminating all 70 result_large_err warnings.

Changes:
- Error::Command(Command, ExitStatus) → Command(Box<(Command, ExitStatus)>)
- Error::Pkgar(pkgar::Error) → Pkgar(Box<pkgar::Error>)
- Updated 2 construction sites in fs.rs (Command)
- Updated 1 construction site in package.rs (Pkgar)
- Updated 1 From conversion in lib.rs (Pkgar)
- Updated Display match in lib.rs (Command destructuring)

This is a heap allocation on error paths only — zero cost on the happy path.
Box<T> auto-implements Display/Debug when inner type does, so formatting
is unchanged.

Verification: cargo check , cargo test --lib  38/38.
Clippy: 74 → 4 warnings (70 eliminated).
2026-07-18 18:05:20 +09:00
vasilito 9762cb20b8 refactor: fix ptr_arg clippy warnings (&PathBuf→&Path, &Vec→&[T])
Reduced warnings from 86 to 74 (12 warnings fixed across 16 function signatures).

Changes:
- &PathBuf → &Path (14 signatures in cook_build, fetch, fs)
- &Vec<T> → &[T] (2 signatures in cook_build, web/html)
- &mut Vec<T> → &mut [T] (1 signature in recipe)
- Removed redundant to_path_buf() call exposed by signature change

All callers unaffected via deref coercion. Verification: cargo check ,
cargo test --lib  38/38, cargo clippy 74 remaining (70 result_large_err,
3 too_many_arguments, 1 if_same_then_else).
2026-07-18 18:01:07 +09:00
vasilito e0533832af chore: track userutils pointer (FD_CLOEXEC stdio clear + diag) 2026-07-18 17:56:48 +09:00
vasilito ee08ff4b33 refactor: manual clippy fixes (manual_strip, borrowed_box, redundant_struct)
Reduced warnings from 96 to 86.

Categories fixed (10 warnings):
- manual_strip (5): starts_with + manual slice → strip_prefix/strip_suffix
- borrowed_box (2): &Box<impl Fn> → &impl Fn (fs.rs signatures + caller)
- redundant_struct_expression (2): remove ..Default::default() when all fields set
- field_reassign_with_default (1): Default + field assign → struct literal

Verification: cargo check , cargo test --lib  38/38, cargo clippy 86 remaining.
2026-07-18 17:54:02 +09:00
vasilito 0c541f6161 refactor: auto-fix 100 clippy warnings (needless_borrow, collapsible_if, len_zero, etc.)
cargo clippy --fix reduced warnings from 196 to 96 (51% reduction).

Categories fixed:
- needless_borrow (52): removed redundant & on already-referenced values
- collapsible_if (20): nested ifs → single if with let chains (Rust 2024)
- len_zero (8): x.len() == 0 → x.is_empty()
- redundant_field_names (4): field: field → field
- needless_return (3): removed trailing return
- redundant_closure (2): |x| f(x) → f
- Other mechanical (11): useless_conversion, map_entry, derivable_impls, etc.

Verification: cargo check , cargo test --lib  38/38, cargo clippy 96 remaining
(down from 196). No behavior change — all fixes are semantic equivalents.

Remaining 96 warnings:
- 70 result_large_err (architectural: box Error enum variants)
- 12 ptr_arg (API signature: &PathBuf → &Path)
- 14 other (manual evaluation needed)
2026-07-18 17:48:55 +09:00
vasilito fdcb2f5fbc fix: complete remaining Tier 1 messages and Tier 2 doc consolidation
Tier 1 message fixes (Part 5.3):
- M18/M19 (build-redbear.sh:523-524): reworded patch-application messages
  to reflect local fork model (forks have patches committed; recipe patches
  for non-fork recipes applied atomically by repo fetch)
- M46 (build-redbear.sh:923): 'immutable archives' → 'local forks'

Tier 2 doc consolidation (Part 7):
- GRUB-INTEGRATION-PLAN.md: updated all 'make all CONFIG_NAME=' commands
  to canonical './local/scripts/build-redbear.sh' equivalents
- SLEEP-IMPLEMENTATION-PLAN.md: archived (referenced 0.2.4 branch, pre-0.3.1)

Assessment doc Part 7 updated: all Tier 1 (items 1-6) and Tier 2 (items 7-13)
marked as verified complete with per-item status.

All Q1-Q10 quality improvement opportunities from Part 6.2 and all Tier 1-3
items from Part 7 are now resolved.
2026-07-18 17:44:16 +09:00
vasilito c3755d687d chore: track kernel+base pointers (drop kernel diag, add ptyd diag) 2026-07-18 17:29:36 +09:00
vasilito d9b2f69213 feat: build-system binary store integrity (per-pkgar BLAKE3 manifest + post-restore verify)
Q1 from assessment Part 6.2 — closes the largest robustness gap (Mechanism #2):
corrupt cached pkgar that passes mtime check was previously not detected
until runtime.

Publish side (repo_builder.rs):
- Accumulates BLAKE3 hash of each published file (pkgar, toml, dep_hashes,
  auto_deps) into a BinaryStoreManifest
- Writes <recipe>.manifest.toml alongside published artifacts in repo/

Restore side (cook_build.rs):
- BinaryStoreManifest struct with read() returning Result<Option<Self>, String>
  (same pattern as DepHashes: Ok(None) for missing = backward compat,
  Err for corrupt TOML = loud WARN + skip)
- After restoring from binary store, verifies each file's BLAKE3 against
  the manifest. On mismatch or missing file: WARN + all_restored=false
  (forces rebuild). Missing manifest = backward compatible (older cookbook
  published without one).

Helper (fs.rs):
- compute_file_blake3_hex(): 64KB chunked BLAKE3 hash, avoids loading
  entire pkgar into memory

Tests: 3 new (roundtrip, missing-file Ok(None), corrupt-TOML Err).
Total: 38/38 pass. cargo check clean. No new clippy warnings.

Assessment doc Part 6.2/6.3/7 updated: Q1-Q6 all marked resolved.
Auto-correction table updated: transient network failure (Q2 retry) and
corrupt cached pkgar (Q1 BLAKE3 manifest) moved from 'does NOT auto-correct'
to 'auto-corrects'.
2026-07-18 17:28:09 +09:00
vasilito 05f18e5f9b chore: track kernel pointer (dup2 refresh diag) 2026-07-18 17:21:59 +09:00
vasilito de44b9324e feat: build-system resilience (fetch retry, strict cache parse, auto_deps preserve, Tier 1 messages)
Tier 3 code improvements (from BUILD-SYSTEM-ASSESSMENT-2026-07-18 Part 6.2):

- Q2: Add run_command_with_retry() helper with exponential backoff (1s, 2s, 4s).
  Wrap download_wget and git clone with 3 attempts. Git clone closure cleans
  partial tmp dir between retries (git refuses non-empty clone targets).

- Q3: Preserve auto_deps.toml alongside dep_hashes.toml in binary store publish
  (repo_builder.rs). Restore path prefers the preserved copy, falling back to
  declared-depends-only reconstruction only when the preserved copy is absent
  (e.g. published by an older cookbook). Preserves full ELF dynamic dep graph.

- Q4: DepHashes::read now returns Result<Option<Self>, String> discriminating
  'missing' (legitimate first build, fall back to mtime) from 'corrupt' (loud
  WARN + force rebuild). Closes a silent-swallow gap where a corrupt
  dep_hashes.toml produced an incorrect mtime-fallback rebuild.

- Q6: Standardize error reporting in repo.rs nonstop path to {:#} format,
  matching the pattern established in the earlier Tier 1 message commit.

Tier 1 message fixes (remaining items from assessment Part 5.3/5.4):

- M26: build-redbear.sh:569 '30-60 minutes' -> config-dependent range
- A6/A8: Makefile container messages add remediation hint
- B3: mk/config.mk sccache hint adds install guidance
- H2: mk/qemu.mk Unsupported ARCH lists supported values
- mk/redbear.mk comment 'fully-patched' -> 'versioned'

Verification: cargo check 0 errors, cargo test --lib 35/35 passed,
cargo clippy 0 new warnings vs baseline, make -n live + validate clean.
2026-07-18 16:54:24 +09:00
vasilito 0d5043f3fc chore: track relibc pointer (non-fatal filetable refresh) 2026-07-18 16:34:46 +09:00
vasilito 1528e04b09 docs: consolidate build-system docs + Tier 1 message fixes
Phase 2 of the build-system assessment:

Tier 1 (user-facing message fixes):
- mk/podman.mk: 'mk/config.mk' -> '.config' (the actual config location)
- mk/prefix.mk: vague 're-run the build' -> specific 'make prefix' guidance
- mk/virtualbox.mk: 'RedBearOS directory' -> 'Red Bear OS VM directory'
- src/bin/repo.rs: '{:?}' -> '{:#}' anyhow chain format + 'repo: ' prefix

Tier 2 (doc consolidation):
- Archive BUILD-SYSTEM-IMPROVEMENTS.md to local/docs/archived/ (self-labeled
  'HISTORICAL POST-MORTEM', no longer current).
- Add local/docs/BUILD-SYSTEM-ASSESSMENT-2026-07-18.md (459-line
  comprehensive assessment: architecture, quality, robustness, gaps).
- docs/README.md: refresh status note (2026-05-01 -> 2026-07-18, v4.0 ->
  v6.0); fix 'as an full fork' grammar.
- docs/07-RED-BEAR-OS-IMPLEMENTATION-PLAN.md: add status header noting
  canonical/secondary split vs CONSOLE-TO-KDE-DESKTOP-PLAN.md; fix grammar.
- HARDWARE.md: remove nonexistent PROFILE-MATRIX.md reference; repoint to
  README.md and the canonical desktop plan.
- local/docs/LOCAL-FORK-SUPREMACY-POLICY.md: 'currently 0.1.0' -> 'currently
  branch 0.3.1; legacy release archive at sources/redbear-0.1.0/'.
- local/docs/GRUB-INTEGRATION-PLAN.md: 'make all CONFIG_NAME=redbear-grub'
  -> canonical './local/scripts/build-redbear.sh redbear-grub'.
- recipes/AGENTS.md, recipes/core/AGENTS.md: replace upstream-Redox-pattern
  content with proper redirects to root AGENTS.md reflecting the local
  fork / path-fork model actually used by Red Bear.
- CONTRIBUTING.md: full rewrite for local fork workflow (Gitea, single-repo
  rule, path-fork model, patch governance, build-redbear.sh as canonical
  entry point, no AI attribution policy).
- README.md: add BUILD-SYSTEM-ASSESSMENT-2026-07-18.md to Documentation list.

Verified: cargo check (0 errors), cargo test --lib (35/35 passed),
cargo clippy (0 new warnings vs baseline).
2026-07-18 16:32:19 +09:00
vasilito c2f5bb09fc feat: build-system hardening (validate gate, cache safeguards, status sync)
Phase 1 remediation of the build-system assessment:

- Makefile: wire 'validate' target into build/live/reimage flows; surface
  lint-config and init-service validators as a first-class gate.
- mk/disk.mk: add 'validate' target running lint-config, init-service
  validator, and file-ownership validator; suppress noisy unmount warnings
  that masked real failures.
- mk/redbear.mk: add source-fingerprint tracking so integrate-redbear.sh
  re-runs when local/recipes, local/Assets, or local/firmware change.
- src/cook/cook_build.rs: atomic dep_hashes.toml write (tmp + rename) to
  prevent torn-write cache corruption; binary-store restore now checks
  dep_hashes before silent restore; fix production bug in
  collect_files_recursive that silently dropped subdirectories whose
  name matched an exclude pattern.
- src/cook/fetch.rs, src/cook/fetch_repo.rs: harden atomic patch
  application and protected-recipe gating.
- AGENTS.md, local/AGENTS.md, local/docs/COLLISION-DETECTION-STATUS.md:
  sync collision-detection status to 'implemented (Phase 15.0)' now that
  CollisionTracker is wired across all four installer layers
  (installer submodule pointer tracked separately in 13cc6fb0c3).

Verified: cargo check (0 errors), cargo test --lib (35/35 passed),
cargo clippy (0 new warnings vs baseline), make -n validate, make -n live.
2026-07-18 16:30:23 +09:00
vasilito 13cc6fb0c3 chore: track installer pointer (collision-tracker WIP) 2026-07-18 16:08:15 +09:00
vasilito 26cdbe4ac5 chore: track kernel pointer (conservative dup2 refresh) 2026-07-18 15:58:51 +09:00
vasilito c2ca67f7d0 chore: track kernel+relibc pointers (filetable-refresh fd fix); shell back to brush 2026-07-18 14:59:12 +09:00
vasilito f4ca523afd docs: update TOOLS.md for release-bump pipeline (5 new tools)
Add documentation for the 5 new release-bump tools:
- bump-release.sh (canonical orchestrator)
- check-external-versions.sh (external version reporter)
- bump-graphics-recipes.sh (map-driven graphics bumper)
- post-checkout-version-sync.sh (opt-in branch hook)
- install-git-hooks.sh (idempotent hook installer)

Bump tool count 10 -> 15, round 13 -> 14.
Apply drift fixes at lines 94-96 and 204.
2026-07-18 14:48:53 +09:00
vasilito 99e5641127 feat: release-bump pipeline + external graphics version sync
Pipeline (3 operator asks):
- bump-release.sh: canonical orchestrator (forks + sources + external)
- upgrade-forks.sh --to=<tag>: rebase forks with diverged-mode guard
- bump-graphics-recipes.sh: map-driven group-aware graphics bumps
- check-external-versions.sh: drift checker for Qt6/KF6/Plasma/Mesa/Wayland
- refresh-fork-upstream-map.sh: append-only map updater with --check
- post-checkout-version-sync.sh + install-git-hooks.sh: opt-in branch hook
- external_version_lib.py: shared version-parsing/bumping library
- external-upstream-map.toml: ~80 external package entries
- bump-fork.sh: deprecated (REDBEAR_I_KNOW_BUMP_FORK_IS_DEPRECATED=1)
- RELEASE-BUMP-WORKFLOW.md: operator runbook

Quality fixes (8 defects from two independent audits):
- blake2b stable cache keys (was hash(), non-portable)
- atomic cache writes via os.replace
- version_sort_key pre-release demotion (was sorting after finals)
- apply_ver_transform re.error tolerance
- grep || true (pipefail abort)
- cd failure detection in upgrade-forks
- sed URL escape (injection hardening)
- refresh-fork-upstream-map last-row drop fix

Doc cleanup:
- Archive 5 obsolete plans to local/docs/archived/
- Remove 14 stale/superseded docs
- Update 18 docs to reference bump-release.sh and fix inbound links
- TOOLS.md drift fixes
2026-07-18 14:45:41 +09:00
vasilito 7b004272a3 chore: track userutils pointer (termios cast fix) 2026-07-18 14:35:26 +09:00
vasilito 27e97a1132 chore: track userutils pointer (canonical terminal reset before shell) 2026-07-18 14:33:41 +09:00
vasilito 59357561f9 chore: track userutils pointer (blocking console fds before shell) 2026-07-18 13:05:05 +09:00
vasilito 170cbe65fb chore: track userutils pointer (skip login ns restriction test) 2026-07-18 12:52:55 +09:00
vasilito e9f37fa2ab chore: track userutils pointer (getty fwd diag) 2026-07-18 12:42:08 +09:00
vasilito a92f698849 chore: track base pointer (fbcond keyboard CR->LF) 2026-07-18 12:02:48 +09:00
vasilito 246ebdfc4b chore: track userutils pointer (login chdir-before-mkns fix) 2026-07-18 11:01:26 +09:00
vasilito 4c610e6555 chore: track base+userutils pointers (init CWD fix) + clean brush patch 2026-07-18 10:43:18 +09:00
vasilito ab2ca5399a chore: track userutils pointer (spawn diag) 2026-07-18 10:26:53 +09:00
vasilito 74bea85fe7 chore: track userutils pointer (login CWD fix) 2026-07-18 10:17:13 +09:00
vasilito 302ae880da chore: track base submodule pointer (revert logger Warn) 2026-07-18 09:47:28 +09:00
vasilito c843db2682 chore: base gitlink (console log quiet) + durable brush redox patch
- Track base submodule pointer for output_level Warn console-quiet change.
- Capture brush entry.rs redox edits (tokio current-thread runtime, default
  minimal input backend) as patches/brush-redox-runtime-and-input.patch and
  apply it in the recipe, so a clean source re-fetch keeps the Redox port.
2026-07-18 08:55:55 +09:00
vasilito dc97454734 chore: track base submodule pointer for switch_root chdir restore 2026-07-18 08:24:20 +09:00
vasilito f8d269c4b6 chore: track userutils submodule pointer for spawn_shell diagnostics 2026-07-18 08:09:05 +09:00
vasilito 688645bf98 feat(serial): headless serial console for mini/bare via fbcond mirror
Track base e9342b78 (fbcond bidirectional serial mirror) + kernel 229046c6
(debug fevent readable). Disable the standalone 31_debug_console getty since
fbcond now owns the serial/debug console (avoids competing for the shared debug
input queue and duplicated output). Gives headless serial login on mini + bare.
2026-07-18 07:23:58 +09:00
vasilito eddc5c737d fix(mesa): disable gbm (needs DRM/KMS platform; not on Redox surfaceless/llvmpipe) 2026-07-18 04:17:51 +09:00
vasilito b2c174875c fix(full+build): unblock glib/mesa/libinput; close fork-staleness gap
- build-redbear.sh: detect changes to the 4 forks the staleness loop missed
  (userutils pkgar; syscall/libredox/redox-scheme crate path-deps force a full
  userspace relink) — prevents stale-binary skew (bash -n validated).
- glib: drop the stale '#undef AT_FDCWD' Redox workaround — relibc now provides
  faccessat()/AT_FDCWD, and glib's HAVE_FACCESSAT path needs AT_FDCWD.
- mesa: remove the dropped '-Dosmesa=true' meson option (unknown option) and
  guard the osmesa.pc pkg-config edit.
- libinput: unblocked by syncing the fresh relibc libc.a (with timerfd_*) into
  the stale prefix sysroot (prefix-sysroot staleness — see notes).
2026-07-18 03:36:01 +09:00
vasilito 79e7f24f00 docs: remove completed submodule-normalization handoff
The fork branch normalization it described is done — all local/sources forks are
on submodule/* branches (submodule/relibc, submodule/base, ... in active use).
Unreferenced one-time handoff; recoverable from git history if needed.
2026-07-18 03:11:56 +09:00
vasilito 061184a64c fix(libinput): disable lua-plugins (no lua-5.4 in Redox sysroot) to unblock build 2026-07-18 02:52:57 +09:00
vasilito 76d609a39e fix(timerfd): base ptr — compile sys_timerfd so timerfd_* link (unblocks Wayland) 2026-07-18 02:51:37 +09:00
vasilito ff49356d58 fix(full): unblock desktop stack build
- relibc ptr 3b40cc8e: sys/timerfd.h compiles in C (unblocks libwayland + glib)
- redbear-meta: add [package].version = 0.3.1 (cookbook couldn't guess it)
- pam-redbear: regenerate Cargo.lock (in-house crate version drift vs --locked)
- (glib corrupted partial source cleaned to force a fresh re-fetch)
2026-07-18 01:57:26 +09:00
vasilito 72351f2a6a fix(boot): base ptr (net warning cleanup + e1000e) + quieter sessiond dbus retry
Track base 01200174 (smolnetd empty-router/broadcast warnings silenced, e1000e
82574 NIC support). redbear-sessiond: suppress the harmless first dbus connect
retry so it does not print an alarming line on every boot.
2026-07-18 00:50:04 +09:00
vasilito 7462574f3c docs: remove completed one-time doc-cleanup session log
SESSION-2026-07-13-DOC-CLEANUP.md was an explicitly-transient session handoff
log (marked not-edit-me) recording a past cleanup; its content is fully
historical. Durable records (post-mortems, policy, resolved-plan implementation
notes) are intentionally kept.
2026-07-18 00:36:56 +09:00
vasilito 40d45c1422 docs(hardware): record working text-console login + driver coverage
Text login (getty -> brush) works on bare/mini after the relibc F_DUPFD_CLOEXEC
fix; document storage/USB/GOP bare-metal boot coverage and the outstanding
Intel 2.5GbE igc (I225/I226) and e1000e (I219) network driver gap for modern
Arrow Lake boards.
2026-07-18 00:33:56 +09:00
vasilito 5b49b36724 fix(boot): base submodule ptr (bare/mini warning cleanup) + bare serial console
Track base 1769b083 (condition_path_exists for optional daemons, ahcid no-media,
netstack no-NIC idle, dhcpd fast-fail). Re-enable the serial debug console on
the bare target so it has a headless-visible login prompt (matching mini up to
login).
2026-07-18 00:30:00 +09:00
vasilito c415829a12 fix(relibc): F_DUPFD_CLOEXEC ABI translation -> tokio runtime works on Redox
Track relibc submodule pointer 733da068 (translate POSIX F_DUPFD_CLOEXEC 1030 to
Redox syscall value 5, so OwnedFd::try_clone and thus tokio Runtime::build stop
failing with EINVAL). Also revert the ineffective epoll_ctl retry.

Remove temporary tokio/sessiond EINVAL diagnostics now that the root cause is
fixed.
2026-07-17 23:00:23 +09:00
vasilito e0d62330ac kernel: track event kdup fix (tokio Runtime EINVAL root cause); build: only re-cook userspace when relibc/base change
The kernel event scheme now implements kdup, so dup() of an epoll fd works
and tokio's registry.try_clone() succeeds — fixing the tokio runtime EINVAL
that killed every zbus daemon and the brush login shell.

build-redbear.sh: gate the userspace build/sysroot clean on relibc/base
(the forks userspace links) instead of any low-level fork, so a kernel-only
change rebuilds the kernel + initfs + image without a full userspace re-cook.
2026-07-17 21:47:32 +09:00
vasilito 053d10276f sessiond: fix DIAG probe crate name (redox_syscall) 2026-07-17 18:18:40 +09:00