Migration guides

To migrate your Kanzi Studio projects to a newer version of Kanzi Rust API, you should update your Kanzi libraries to a version Kanzi Rust API supports, and recompile your Rust libraries by entirely recreating the target directory with cargo clean.

Migrating to Kanzi Rust API 0.8.0

Changes in linking Kanzi libraries

To allow linking against Kanzi libraries built in Debug mode on Windows, certain linker flags need to be specified in the kanzi crate dependents.

Specifically, you need to add a build.rs file to all application and plugin crates, with the following contents:

pub fn main() {
   configure_windows_msvcrt_lib();
}

fn configure_windows_msvcrt_lib() {
   let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
   let profile = std::env::var("PROFILE").unwrap();

   if target_os == "windows" && profile == "debug" {
      // This should work from 1.83, onwards.
      // <https://github.com/rust-lang/rust/issues/39016#issuecomment-2391095973>

      // Don't link the default CRT
      println!("cargo::rustc-link-arg=/nodefaultlib:msvcrt");
      // Link the debug CRT instead
      println!("cargo::rustc-link-arg=/defaultlib:msvcrtd");
   }
}

See also

Release notes

Known issues