diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index 90bca2651..13f1bc2ad 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -332,6 +332,26 @@ impl Builder { self.kernel = CrateSpec::Local("xous-kernel".to_string(), LoaderRegion::Ram); search_and_replace_in_file("services/aes/Cargo.toml", "default = []", "default = [\"cramium-soc\"]") .expect("couldn't patch AES"); + + // this is needed because we don't have an ed25519 accelerator on cramium targets + search_and_replace_in_file( + "Cargo.toml", + "[patch.crates-io.curve25519-dalek]", + "# [patch.crates-io.curve25519-dalek]", + ) + .expect("couldn't patch curve25519"); + search_and_replace_in_file( + "Cargo.toml", + "git = \"https://github.com/betrusted-io/curve25519-dalek.git\"", + "# git = \"https://github.com/betrusted-io/curve25519-dalek.git\"", + ) + .expect("couldn't patch curve25519"); + search_and_replace_in_file( + "Cargo.toml", + "branch = \"main\" # c25519", + "# branch = \"main\" # c25519", + ) + .expect("couldn't patch curve25519"); self } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 2b6c8c7a8..e1ce85181 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -201,6 +201,26 @@ fn main() -> Result<(), Box> { ) .expect("couldn't patch AES"); + // revert these just in case - but don't throw an error if the strings aren't found + builder::search_and_replace_in_file( + "Cargo.toml", + "# [patch.crates-io.curve25519-dalek]", + "[patch.crates-io.curve25519-dalek]", + ) + .ok(); + builder::search_and_replace_in_file( + "Cargo.toml", + "# git = \"https://github.com/betrusted-io/curve25519-dalek.git\"", + "git = \"https://github.com/betrusted-io/curve25519-dalek.git\"", + ) + .ok(); + builder::search_and_replace_in_file( + "Cargo.toml", + "# branch = \"main\" # c25519", + "branch = \"main\" # c25519", + ) + .ok(); + match builder::search_in_file("services/aes/Cargo.toml", "default = []") { Ok(false) => { return Err( @@ -635,6 +655,24 @@ fn main() -> Result<(), Box> { "default = []", ) .expect("couldn't patch AES"); + builder::search_and_replace_in_file( + "Cargo.toml", + "# [patch.crates-io.curve25519-dalek]", + "[patch.crates-io.curve25519-dalek]", + ) + .expect("couldn't patch curve25519"); + builder::search_and_replace_in_file( + "Cargo.toml", + "# git = \"https://github.com/betrusted-io/curve25519-dalek.git\"", + "git = \"https://github.com/betrusted-io/curve25519-dalek.git\"", + ) + .expect("couldn't patch curve25519"); + builder::search_and_replace_in_file( + "Cargo.toml", + "# branch = \"main\" # c25519", + "branch = \"main\" # c25519", + ) + .expect("couldn't patch curve25519"); } match builder::search_in_file("services/aes/Cargo.toml", "default = []") { Ok(false) => {