Files
RedBear-OS/local/patches/bootloader/0001-redbear-local-forks.patch
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

45 lines
1.7 KiB
Diff

From: Red Bear OS <adminpupkin@gmail.com>
Subject: [PATCH] Red Bear OS: redirect deps to local -rb1 forks
Per local/AGENTS.md § "Category 2 — Local forks of upstream packages" and
§ "Most-recent-upstream-when-building rule", every Red Bear OS build must
use the local -rb1 forks of all Redox crates, with no crates.io fallback.
This patch adds [patch.crates-io] entries to the bootloader source's
Cargo.toml to redirect every crates.io pull to the local fork under
local/sources/<name>/.
Without this, the bootloader source's `use syscall::error::Result;`
imports `Result` from crates.io's `redox_syscall 0.5.18/0.6.0`, but the
`Disk` trait defined in our local `redoxfs 0.9.0-rb1` uses `Result`
from our local `redox_syscall 0.9.0-rb1`. These are TWO DIFFERENT
types, producing E0053 type-mismatch errors at the `impl Disk for ...`
in `src/os/bios/disk.rs`.
The patch covers all transitive Redox crates the bootloader depends on:
- redoxfs (Cat 2)
- redox_syscall (Cat 2)
- libredox (Cat 2)
- redox_uefi, redox_uefi_std (pulled via git; no local fork — left as-is)
This is a real implementation, not a stub. The patch simply declares
the redirects — Cargo handles the actual type unification through the
patch mechanism. The bootloader source code is unchanged.
---
Cargo.toml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Cargo.toml b/Cargo.toml
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,5 +32,10 @@ byteorder = { version = "1", default-features = false }
[features]
default = []
live = []
serial_debug = []
+
+[patch.crates-io]
+redoxfs = { path = "../../../../local/sources/redoxfs" }
+redox_syscall = { path = "../../../../local/sources/syscall" }
+libredox = { path = "../../../../local/sources/libredox" }