From e96d711e9405595995ee36d5d11c9c96e68fb052 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 20 Oct 2022 17:08:16 +0800 Subject: [PATCH] add maintainer notes --- Cargo.toml | 37 +++++++++++++++++++++---------------- xtask/src/main.rs | 12 +++++++++++- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e6d813518..ff01b919e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -113,13 +113,6 @@ incremental = true #panic = "abort" # Remove panic output, which can reduce file size #opt-level = 1 # z,s: Optimize for size instead of performance; 1 for easier debugging -# Activate these patches to use local versions of xous kernel core files instead of crates.io sourced versions. -# Activating these also reduces your dependency on crates.io for critical source APIs, if that's part of your -# threat model; but for now we're favoring sources from crates.io to facility third party adoption of Xous. -# [patch.crates-io] -# xous = {path = "xous-rs"} -# xous-ipc = {path = "xous-ipc"} - # prefer hardware-accelerated versions of services [patch.crates-io.sha2] path = "services/engine-sha512" @@ -141,9 +134,8 @@ engine-25519 = {path = "services/engine-25519"} [patch.crates-io.usb-device] git="https://github.com/betrusted-io/usb-device.git" branch="main" +# local dev shortcuts #path = "../usb-device" - -# for local dev #[patch.crates-io.usbd-human-interface-device] #path = "../usbd-human-interface-device" @@ -156,14 +148,27 @@ git="https://github.com/betrusted-io/ring-xous" rev="09207048c393d524a34f63cf65c85a973012a21d" # use the commitref because we're still updating the branch #branch="0.16.20-cleanup" -# required for ring-xous -[patch.crates-io.xous] -path = "./xous-rs" -[patch.crates-io.xous-ipc] -path = "./xous-ipc" -[patch.crates-io.xous-api-names] -path = "./api/xous-api-names" +###################################################### +### PATCHES TO DEV/TEST XOUS KERNEL CODE +### +### The kernel is published to crates.io, and all the packages in Xous are configured to get +### the kernel from crates.io and NOT the local tree. +### +### When making changes to the kernel, you must activate some or all of the patches below +### for the local sources to "see" the changes. +### You will also need to compile with `--no-verify` to acknowledge that you are doing local +### source development and accept that what's on crates.io doesn't match what's inside this tree. +####################################################### +### Minimum recommended patch set: this causes xous-ring to behave correctly when doing local dev +# [patch.crates-io.xous] +# path = "./xous-rs" +# [patch.crates-io.xous-ipc] +# path = "./xous-ipc" +# [patch.crates-io.xous-api-names] +# path = "./api/xous-api-names" + +### Selectively patch in these crates, or more, as needed depending on your dev activity # [patch.crates-io.utralib] # path = "./utralib" # [patch.crates-io.svd2utra] diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 475f0f202..05189df63 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -366,7 +366,17 @@ fn main() -> Result<(), Box> { // checking before you can check them! let do_verify = env::args().filter(|x| x == "--no-verify").count() == 0; if do_verify { - check_project_consistency() + match check_project_consistency() { + Ok(()) => Ok(()), + Err(e) => { + // Explain to developers why this step is important. + println!("Local source changes have not been published. If you meant to modify core components,"); + println!("activate patches in top-level Cargo.toml to redirect crates.io to the local source tree."); + println!("Otherwise, your local changes are IGNORED."); + println!("Use the `--no-verify` argument to suppress this warning."); + Err(e) + } + } } else { Ok(()) }