From 4261792fb8d74d863490bf8d381441c534d0985f Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 18 Nov 2023 14:03:53 -0500 Subject: [PATCH] Update builds for v0.5.0 release, including wasm compile step --- backend/Cargo.lock | 51 +++++++---------------------------------- backend/Cargo.toml | 6 ++--- backend/Dockerfile | 6 ++++- backend/build-docker.sh | 11 +++++++-- src/rust/Cargo.lock | 10 ++++++++ src/rust/Cargo.toml | 4 ++-- src/rust/build.rs | 4 ++-- 7 files changed, 39 insertions(+), 53 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index b270307..0b895b4 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -296,7 +296,7 @@ name = "fantastic-rs" version = "0.5.0" dependencies = [ "log", - "nrpc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nrpc", "prost", "serde", "serde_json", @@ -304,7 +304,7 @@ dependencies = [ "sysfuss", "tokio", "usdpl-back", - "usdpl-build 0.11.0", + "usdpl-build", ] [[package]] @@ -682,16 +682,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "nrpc" -version = "0.10.0" -dependencies = [ - "async-trait", - "bytes", - "futures", - "prost", -] - [[package]] name = "nrpc" version = "0.10.0" @@ -704,27 +694,13 @@ dependencies = [ "prost", ] -[[package]] -name = "nrpc-build" -version = "0.10.0" -dependencies = [ - "nrpc 0.10.0", - "prettyplease 0.2.15", - "proc-macro2", - "prost-build", - "prost-types", - "protox", - "quote", - "syn 2.0.39", -] - [[package]] name = "nrpc-build" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6d47eea1ccd03b060da4b19bec6ac8addcd0129c03b15905a158cd20389d6a4" dependencies = [ - "nrpc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nrpc", "prettyplease 0.2.15", "proc-macro2", "prost-build", @@ -1269,6 +1245,8 @@ dependencies = [ [[package]] name = "sysfuss" version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f33bae529511a671b5f2ed4cc46ae0b2ccdf8c03ccf7eebe95a5a886ff7914dc" [[package]] name = "tempfile" @@ -1458,34 +1436,21 @@ dependencies = [ "bytes", "gettext-ng", "log", - "nrpc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nrpc", "prost", "ratchet_rs", "tokio", - "usdpl-build 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "usdpl-build", "usdpl-core", ] -[[package]] -name = "usdpl-build" -version = "0.11.0" -dependencies = [ - "nrpc-build 0.10.0", - "prettyplease 0.2.15", - "proc-macro2", - "prost-build", - "prost-types", - "quote", - "syn 2.0.39", -] - [[package]] name = "usdpl-build" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b732dfafa3876eb2acc3ff17ffc8ed370662e68de3bdf541fbbddaa71ebf52be" dependencies = [ - "nrpc-build 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nrpc-build", "prettyplease 0.2.15", "proc-macro2", "prost-build", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 87498ff..979ddbf 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -15,18 +15,18 @@ usdpl-back = { version = "0.11", features = ["blocking", "decky"]} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -nrpc = { version = "0.10", default-features = false } #path = "../../nRPC/nrpc" } +nrpc = { version = "0.10", default-features = false } prost = "0.11" tokio = { version = "1", features = ["sync", "rt"] } -sysfuss = { version = "0.3", features = ["derive"], path = "../../sysfs-nav" } +sysfuss = { version = "0.3", features = ["derive"] } # logging log = "0.4" simplelog = "0.12" [build-dependencies] -usdpl-build = { version = "0.11", path = "../../usdpl-rs/usdpl-build" } +usdpl-build = { version = "0.11" } [profile.release] debug = false diff --git a/backend/Dockerfile b/backend/Dockerfile index f1a0ed3..1facf61 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,3 +1,7 @@ FROM ghcr.io/steamdeckhomebrew/holo-toolchain-rust:latest -ENTRYPOINT [ "/backend/entrypoint.sh" ] \ No newline at end of file +#RUN pacman -S --noconfirm cmake make clang git +# for building Rust wasm frontend +RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + +ENTRYPOINT [ "/backend/entrypoint.sh" ] diff --git a/backend/build-docker.sh b/backend/build-docker.sh index c59496c..7fd1e74 100755 --- a/backend/build-docker.sh +++ b/backend/build-docker.sh @@ -6,10 +6,17 @@ rustc --version cargo --version echo "--- Building plugin backend ---" -cargo build --release --features usdpl-back/decky -mkdir -p out +cargo build --release +#mkdir -p out cp target/release/fantastic-rs out/backend +echo "--- Building plugin frontend (wasm) ---" +# this only builds the webassembly part, while the actual frontend task builds the rest of it +cd /plugin/src/rust +./build.sh decky +cargo clean +cd /backend + echo " --- Cleaning up ---" # remove root-owned target folder cargo clean diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index 830d9da..37f76c5 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -430,6 +430,8 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "nrpc" version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb8807391415c7f5673c2431e723597bbf6a5c2f510aab30dc8d48d0c76f5d26" dependencies = [ "async-trait", "bytes", @@ -440,6 +442,8 @@ dependencies = [ [[package]] name = "nrpc-build" version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6d47eea1ccd03b060da4b19bec6ac8addcd0129c03b15905a158cd20389d6a4" dependencies = [ "nrpc", "prettyplease 0.2.12", @@ -804,6 +808,8 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "usdpl-build" version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b732dfafa3876eb2acc3ff17ffc8ed370662e68de3bdf541fbbddaa71ebf52be" dependencies = [ "nrpc-build", "prettyplease 0.2.12", @@ -817,6 +823,8 @@ dependencies = [ [[package]] name = "usdpl-core" version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad1ff724f8214657706c4c877181d68d65a4db1c782e0a08a74402fe7c480f5" dependencies = [ "base64", ] @@ -824,6 +832,8 @@ dependencies = [ [[package]] name = "usdpl-front" version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e7ab9901d3db914e70594d94b2bd05c6c2c9d528937c8f466be581e0b79e8f" dependencies = [ "console_error_panic_hook", "futures", diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 44d8f7e..b4e59c2 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -14,11 +14,11 @@ crate-type = ["cdylib", "rlib"] [dependencies] usdpl-front = { version = "0.11" } -nrpc = { version = "0.10", path = "../../../nRPC/nrpc", default-features = false } +nrpc = { version = "0.10", default-features = false } prost = "0.11" [build-dependencies] -usdpl-build = { version = "0.11", path = "../../../usdpl-rs/usdpl-build" } +usdpl-build = { version = "0.11" } [features] debug = ["usdpl-front/debug"] diff --git a/src/rust/build.rs b/src/rust/build.rs index 6cb4f89..08efd0d 100644 --- a/src/rust/build.rs +++ b/src/rust/build.rs @@ -2,12 +2,12 @@ fn main() { println!("CWD: {}", std::env::current_dir().unwrap().display()); usdpl_build::front::build( [format!( - "{}/../../backend-rs/protos/fantastic.proto", + "{}/../../backend/protos/fantastic.proto", std::env::current_dir().unwrap().display() )] .into_iter(), [format!( - "{}/../../backend-rs/protos/", + "{}/../../backend/protos/", std::env::current_dir().unwrap().display() )] .into_iter(),