From 646593856800c55f44fe2b15991570737709a36e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 17 Oct 2025 14:45:07 +0200 Subject: rust: add rust.workspace() skeleton implementation rust.workspace() is the entry point for global feature resolution. It loads a Cargo.toml file and ensures that all dependencies will be built with the correct set of features. Fixes: #13404 Signed-off-by: Paolo Bonzini --- docs/markdown/Rust-module.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'docs') diff --git a/docs/markdown/Rust-module.md b/docs/markdown/Rust-module.md index 5ce0fdcdb..64c4c2311 100644 --- a/docs/markdown/Rust-module.md +++ b/docs/markdown/Rust-module.md @@ -4,6 +4,9 @@ authors: - name: Dylan Baker email: dylan@pnwbakers.com years: [2020, 2021, 2022, 2024] + - name: Paolo Bonzini + email: bonzini@gnu.org + years: [2025] ... # Rust module @@ -168,3 +171,22 @@ Only a subset of [[shared_library]] keyword arguments are allowed: - link_depends - link_with - override_options + +### workspace() + +``` +cargo_ws = rustmod.workspace() +``` + +*Since 1.11.0* + +Create and return a `workspace` object for managing the project's Cargo +workspace. + +A project that wishes to use Cargo subprojects should have `Cargo.lock` and `Cargo.toml` +files in the root source directory, and should call this function before using +Cargo subprojects. + +The first invocation of `workspace()` establishes the *Cargo interpreter* +that resolves dependencies and features for both the toplevel project (the one +containing `Cargo.lock`) and all subprojects that are invoked with the `cargo` method, -- cgit v1.2.3