From 76f24191d957a112541361f3bc77cc54b5371147 Mon Sep 17 00:00:00 2001 From: GroM Date: Tue, 30 Jul 2024 11:34:09 +0200 Subject: [PATCH] Add comments to explain how Rust workspace is managed --- src/ragger/utils/misc.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ragger/utils/misc.py b/src/ragger/utils/misc.py index 0be59a59..8507f2ed 100644 --- a/src/ragger/utils/misc.py +++ b/src/ragger/utils/misc.py @@ -71,6 +71,15 @@ def find_application(base_dir: Path, device: str, sdk: str) -> Path: raise AssertionError(f"{base_dir} is not a directory") app = base_dir.resolve() if sdk.lower() == "rust": + """ + When building a Rust app, the resulting binary is located in a target + directory target//release/. app is the Path to the + build directory, where is stored the app's Cargo.toml file. + If the app respository is organized as a workspace crate (several packages, + each package in its own directory with its own Cargo.toml), the binaries are + all stored in the same target directory. 'cargo metadata' is used to get the + target directory full path. + """ if device == "nanos2": device = "nanosplus" app_name = toml.load(base_dir / "Cargo.toml")["package"]["name"]