From 6b98c6466364e5a26b0390eaf6d15d132d751701 Mon Sep 17 00:00:00 2001 From: vasilito Date: Wed, 1 Jul 2026 14:03:18 +0300 Subject: [PATCH] kernel: [patch.crates-io] libredox + [patch.''] redox_syscall for Phase J Phase J: the kernel needs two Cargo patch overrides so that the typed-AcPiVerb path (EnterS2Idle / ExitS2Idle) is usable. Without these: * the kernel's redox_syscall dep is fetched from gitlab.redox-os.org (upstream), so the local fork at local/sources/syscall (with the new AcPiVerb variants) is not visible to the kernel's build. * the libredox dep is fetched from crates.io, so the local fork at local/sources/libredox (which uses the local syscall fork) is not visible. This means libredox::error::Error and syscall::Error are different compile-time types and the E0277 errors in scheme-utils and daemon return. The fix: a single [patch.crates-io] section overriding libredox (which is from crates.io) and a [patch.''] section overriding redox_syscall (which is from a git URL). [patch.crates-io] only matches crates.io deps; [patch.''] matches the dep's source URL. Also: declare members = ['.', 'rmm'] in the [workspace] section. Without this, cargo doesn't recognize the kernel as a workspace and the [patch] sections are silently ignored (workspace_metadata is None). The members list includes the kernel's own directory and the rmm path dep. --- Cargo.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c71210140b..f293d48653 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] resolver = "3" +members = [".", "rmm"] [package] name = "kernel" @@ -130,4 +131,18 @@ debug = "full" # same type, so `?` conversions in scheme-utils / daemon # compile cleanly. [patch.crates-io] +# Phase J: override libredox 0.1.17 to use the local +# fork at ../libredox/ (which itself uses the local syscall +# fork). This breaks the libredox::error::Error <-> +# syscall::Error type-identity barrier that previously +# caused E0277 errors in scheme-utils and daemon. libredox = { path = "../libredox" } +# Phase J: the kernel's redox_syscall dep is a git URL +# (not crates.io), so [patch.crates-io] doesn't apply. +# Use a [patch.""] section to match the dep source. +# The local fork at ../syscall adds the EnterS2Idle / +# ExitS2Idle AcpiVerb variants — the kernel's direct use +# of AcpiVerb in src/scheme/acpi.rs's kcall handler +# needs the fork to see these variants. +[patch."https://gitlab.redox-os.org/redox-os/syscall.git"] +redox_syscall = { path = "../syscall" }