Skip to content

Commit 8c6eaf3

Browse files
refactor(Mountain/gRPC): Restructure Vine IPC code generation
- Moved `Proto2/Vine.proto` to `Proto/Vine.proto` and removed header comments - Deleted old gRPC build script (`Proto2/Build.rs`) and generated module (`Source/Vine/Generated.rs`) - Added new generated files using `prost` output: `vine_ipc.rs` and updated `mod.rs` - Integrated gRPC compilation into main `build.rs` using `tonic-build` - Added required dependencies (`tonic-build`, `prost`) to `Cargo.toml` This refactor aligns with Land's final architecture by: 1. Standardizing the IPC layer (`Vine`) directory structure 2. Switching to `prost` for Protocol Buffers implementation (used in `tonic`) 3. Consolidating build processes - Tauri version embedding and gRPC generation now coexist in `build.rs` 4. Improving maintainability through proper error propagation in build scripts The changes ensure robust gRPC communication between `Mountain` and `Cocoon`, critical for implemented workflows like extension hosting, file operations, and command execution. Generated code structure follows Rust best practices with explicit module inclusion.
1 parent c9c7330 commit 8c6eaf3

7 files changed

Lines changed: 1007 additions & 56 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ serde = { workspace = true, features = ["derive"] }
99
serde_json = { workspace = true }
1010
tauri-build = { workspace = true, features = [] }
1111
toml = { workspace = true }
12+
tonic-build = { workspace = true }
1213

1314
[dependencies]
1415
tauri = { version = "*", features = [
@@ -50,6 +51,7 @@ uuid = { workspace = true, features = ["v4", "serde"] }
5051
parking_lot = { workspace = true }
5152
lazy_static = { workspace = true }
5253
portable-pty = { workspace = true }
54+
prost = { workspace = true }
5355

5456
# regex = { workspace = true }
5557
# unbug = { workspace = true }
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// @file vine.proto
2-
// @brief Defines the gRPC services and messages for communication between Mountain (host) and Cocoon (sidecar).
3-
41
syntax = "proto3";
52

63
package vine_ipc;

Proto2/Build.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

Source/Vine/Generated.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.

Source/Vine/Generated/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//! # Vine Generated Code
2+
//!
3+
//! This module includes and re-exports the Rust code that is automatically
4+
//! generated by `tonic-build` from the `Vine.proto` definition file. It serves
5+
//! as the single source of truth for all gRPC message types, service traits,
6+
//! and client/server structs. Do not edit this file directly.
7+
8+
#![allow(
9+
non_snake_case,
10+
non_camel_case_types,
11+
clippy::all,
12+
unused_imports,
13+
unknown_lints,
14+
non_shorthand_field_patterns
15+
)]
16+
17+
include!("vine_ipc.rs");

0 commit comments

Comments
 (0)