From 5e91e23752cd351fd66860e7df5a08e55ede9896 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 11 Sep 2026 18:52:31 +0300 Subject: [PATCH] Update codec and kernel dependencies --- Cargo.lock | 8 ++++---- Cargo.toml | 6 +++--- crates/ocs_plugin_api/Cargo.toml | 4 ++-- crates/ocs_web_worker/Cargo.toml | 2 +- crates/plugin-template-api2/Cargo.toml | 2 +- docs/plugin-template-v2/Cargo.toml | 4 +++- docs/plugin-template/Cargo.toml | 7 ++----- docs/plugin-template/src/lib.rs | 23 +++++++++++++---------- 8 files changed, 29 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81f1697f6..2241226f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,8 +78,8 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "acadrust" -version = "0.5.4" -source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4#f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4" +version = "0.5.5" +source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=6d88d702b664685fead738095d778cf6e5a36119#6d88d702b664685fead738095d778cf6e5a36119" dependencies = [ "ahash 0.8.12", "anyhow", @@ -894,7 +894,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cadkernel" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=7c5048ba179e861288a6d1f6a50da6b5b9147838#7c5048ba179e861288a6d1f6a50da6b5b9147838" +source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=0442518e7df3d07bea3ccc8e91aabe648613be86#0442518e7df3d07bea3ccc8e91aabe648613be86" dependencies = [ "acadrust", "cavalier_contours", @@ -905,7 +905,7 @@ dependencies = [ [[package]] name = "cadkernel-constraints" version = "0.1.0" -source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=7c5048ba179e861288a6d1f6a50da6b5b9147838#7c5048ba179e861288a6d1f6a50da6b5b9147838" +source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=0442518e7df3d07bea3ccc8e91aabe648613be86#0442518e7df3d07bea3ccc8e91aabe648613be86" dependencies = [ "nalgebra", ] diff --git a/Cargo.toml b/Cargo.toml index a62f15648..41857eb06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,9 +30,9 @@ glam = { version = "0.33", features = ["bytemuck"] } rfd = "0.17" clap = { version = "4", features = ["derive", "string"] } env_logger = "0.11" -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4", features = ["serde"] } -cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "7c5048ba179e861288a6d1f6a50da6b5b9147838", features = ["acis", "offset"] } -cadkernel-constraints = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "7c5048ba179e861288a6d1f6a50da6b5b9147838" } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "6d88d702b664685fead738095d778cf6e5a36119", features = ["serde"] } +cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "0442518e7df3d07bea3ccc8e91aabe648613be86", features = ["acis", "offset"] } +cadkernel-constraints = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "0442518e7df3d07bea3ccc8e91aabe648613be86" } dwg-thumbnailer = { path = "crates/dwg-thumbnailer" } flate2 = "1" image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] } diff --git a/crates/ocs_plugin_api/Cargo.toml b/crates/ocs_plugin_api/Cargo.toml index ae1b7d3a1..fc6810f99 100644 --- a/crates/ocs_plugin_api/Cargo.toml +++ b/crates/ocs_plugin_api/Cargo.toml @@ -14,7 +14,7 @@ serde = { version = "1", features = ["derive"] } # Pulled in only by the `host` feature, which adds the `acadrust`-typed # `HostApi` runtime surface. The default crate stays dependency-free so engine # crates and external tooling can depend on the manifest/ribbon contract cheaply. -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4", optional = true, features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "6d88d702b664685fead738095d778cf6e5a36119", optional = true, features = ["serde"] } # Runtime IPC and serialization (host feature only). interprocess = { version = "2", optional = true } @@ -38,7 +38,7 @@ serde_json = "1" serde = { version = "1", features = ["derive"] } cargo-lock = "11" # acadrust is scanned at build time to generate the embedded type registry. -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4", features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "6d88d702b664685fead738095d778cf6e5a36119", features = ["serde"] } [dev-dependencies] serde_json = "1" diff --git a/crates/ocs_web_worker/Cargo.toml b/crates/ocs_web_worker/Cargo.toml index b96691b7f..035892750 100644 --- a/crates/ocs_web_worker/Cargo.toml +++ b/crates/ocs_web_worker/Cargo.toml @@ -8,7 +8,7 @@ publish = false crate-type = ["cdylib"] [dependencies] -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4", features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "6d88d702b664685fead738095d778cf6e5a36119", features = ["serde"] } bincode = "1.3" serde = { version = "1", features = ["derive"] } console_error_panic_hook = "0.1" diff --git a/crates/plugin-template-api2/Cargo.toml b/crates/plugin-template-api2/Cargo.toml index b749df0e4..ffe4af730 100644 --- a/crates/plugin-template-api2/Cargo.toml +++ b/crates/plugin-template-api2/Cargo.toml @@ -10,4 +10,4 @@ crate-type = ["cdylib"] [dependencies] ocs_plugin_api = { path = "../ocs_plugin_api", features = ["host"] } -acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "f30dcc84ebfc3f48bdc1eb888d6b8eda65c3e6f4", features = ["serde"] } +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "6d88d702b664685fead738095d778cf6e5a36119", features = ["serde"] } diff --git a/docs/plugin-template-v2/Cargo.toml b/docs/plugin-template-v2/Cargo.toml index f826d1785..d5b862c79 100644 --- a/docs/plugin-template-v2/Cargo.toml +++ b/docs/plugin-template-v2/Cargo.toml @@ -5,9 +5,11 @@ edition = "2021" description = "Example OpenCAD Studio plugin demonstrating the shared-memory DocumentReader API." license = "GPL-3.0-only" +[workspace] + [lib] crate-type = ["cdylib"] [dependencies] ocs_plugin_api = { path = "../../crates/ocs_plugin_api", features = ["host"] } -acadrust = "0.3.4" +acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "6d88d702b664685fead738095d778cf6e5a36119" } diff --git a/docs/plugin-template/Cargo.toml b/docs/plugin-template/Cargo.toml index 4356b9a37..958d4b581 100644 --- a/docs/plugin-template/Cargo.toml +++ b/docs/plugin-template/Cargo.toml @@ -5,6 +5,8 @@ edition = "2021" description = "An Open CAD Studio add-on." license = "GPL-3.0-only" +[workspace] + # A plugin is a C-ABI dynamic library the host loads at runtime. [lib] crate-type = ["cdylib"] @@ -12,8 +14,3 @@ crate-type = ["cdylib"] [dependencies] # The stable contract, with the runtime `host` surface (HostApi / BuiltinPlugin). ocs_plugin_api = { git = "https://github.com/HakanSeven12/OpenCADStudio", features = ["host"] } - -# Match the host's acadrust so the loaded library is binary-compatible -# (approach B assumes the same toolchain + dependency versions). -[patch.crates-io] -acadrust = { git = "https://github.com/HakanSeven12/acadrust", branch = "main" } diff --git a/docs/plugin-template/src/lib.rs b/docs/plugin-template/src/lib.rs index b23a25db0..4e4328ea9 100644 --- a/docs/plugin-template/src/lib.rs +++ b/docs/plugin-template/src/lib.rs @@ -30,16 +30,19 @@ impl CadModule for MyModule { fn title(&self) -> &'static str { "My Plugin" } - fn ribbon_groups(&self) -> Vec { - vec![RibbonGroup { - title: "Tools", - tools: vec![RibbonItem::LargeTool(ToolDef { - id: "MP_HELLO", - label: "Hello", - icon: IconKind::Glyph("★"), - event: ModuleEvent::Command("MP_HELLO".to_string()), - })], - }] + fn ribbon_groups(&self) -> &[RibbonGroup] { + static GROUPS: std::sync::OnceLock> = std::sync::OnceLock::new(); + GROUPS.get_or_init(|| { + vec![RibbonGroup { + title: "Tools", + tools: vec![RibbonItem::LargeTool(ToolDef { + id: "MP_HELLO", + label: "Hello", + icon: IconKind::Glyph("★"), + event: ModuleEvent::Command("MP_HELLO".to_string()), + })], + }] + }) } }