Skip to content

Conversation

@levkropp
Copy link
Contributor

@levkropp levkropp commented Aug 11, 2025

This pull request introduces Rust to Multipass by migrating the petname (name generation e.g. hearty-kangaroo) functionality from C++ to Rust and integrates it into the build and runtime environments. This transition involves replacing the old C++ name generator with a new Rust implementation, updating the build system to compile and link the Rust static library, and adapting relevant CI and packaging scripts to support Rust. The changes also update C++ code to use the Rust FFI for name generation and remove legacy C++ petname code.

Petname/name generation migration to Rust:

  • Added new Rust crate (tentatively named rustipass) and implemented petname in rust as a module, exposing FFI functions for name generation and tests.
  • Updated C++ code (src/client/gui/ffi/dart_ffi.cpp, src/daemon/daemon.cpp) to use Rust FFI for petname generation instead of the old C++ NameGenerator.
  • Removed legacy C++ petname and name generator code (include/multipass/name_generator.h, src/petname/make_name_generator.cpp).

Build system and CI integration:

  • Updated CMake configuration to build the Rust static library and link it as an interface library for petname, removing previous code-generation steps. (src/petname/CMakeLists.txt)
  • Added Rust-related files to CI triggers and installed Rust toolchain in CI workflows for Windows/macOS (.github/workflows/dynamic-ci.yml, .github/workflows/windows-macos.yml).

Packaging and environment updates:

  • Added Rust as a build dependency and ensured the Rust toolchain is initialized during Snap builds and CI (BUILD.*.md, snap/snapcraft.yaml)

Daemon configuration cleanup:

  • Removed all references to the old C++ NameGenerator from daemon configuration code (src/daemon/daemon_config.cpp, src/daemon/daemon_config.h).

MULTI-2218

@levkropp levkropp force-pushed the rust-oxidize-petname branch 8 times, most recently from aef62cd to 9e97f97 Compare August 11, 2025 22:12
@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 93.43066% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.30%. Comparing base (68ede90) to head (3c2af6c).
⚠️ Report is 24 commits behind head on main.

Files with missing lines Patch % Lines
src/rustipass/rust_petname_generator.cpp 42.85% 8 Missing ⚠️
src/daemon/daemon.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4299      +/-   ##
==========================================
+ Coverage   89.28%   89.30%   +0.02%     
==========================================
  Files         260      261       +1     
  Lines       17532    17636     +104     
==========================================
+ Hits        15653    15750      +97     
- Misses       1879     1886       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@levkropp levkropp force-pushed the rust-oxidize-petname branch 3 times, most recently from 4ba6110 to 3eb38a4 Compare August 12, 2025 01:05
@levkropp levkropp marked this pull request as ready for review August 12, 2025 21:22
@levkropp levkropp force-pushed the rust-oxidize-petname branch 7 times, most recently from 62934bd to c2362e5 Compare August 13, 2025 21:27
@levkropp levkropp force-pushed the rust-oxidize-petname branch 2 times, most recently from 7e8db3f to 85c05d5 Compare August 14, 2025 18:20
@levkropp levkropp changed the title [rust] init multipass crate & oxidize petname [rust] init multipass cargo workspace & oxidize petname Aug 14, 2025
ricab

This comment was marked as outdated.

@levkropp levkropp force-pushed the rust-oxidize-petname branch 3 times, most recently from 84d93aa to 2c1c524 Compare August 20, 2025 19:25
@levkropp levkropp force-pushed the rust-oxidize-petname branch from 63f1895 to 260c611 Compare October 8, 2025 01:21
In order to avoid having a staticlib with duplicated dependencies for
each oxidized module in multipass, the decision was made to have one
crate that gets built/bridged via CXX, with each oxidized part of
multipass in a subdirectory
@levkropp levkropp force-pushed the rust-oxidize-petname branch from 8a41617 to 42c40c7 Compare October 15, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants