Skip to content

Commit 67631e7

Browse files
cargo.md and currentreleasenotes.md update for cargo cli detector
1 parent 02b7353 commit 67631e7

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

documentation/src/main/markdown/currentreleasenotes.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
### New features
2424

2525
* Support for Conda has been extended to 25.1.1.
26+
Here’s the revised line, following your requested format:
27+
* A new detector leveraging `cargo tree` to extract direct and transitive dependencies, improving accuracy over the previous flat-list detection. This build-based detector is triggered for Cargo projects with a `Cargo.toml` file and requires Cargo version **1.44.0+**. Falls back to the existing build-less approach if `cargo tree` is unavailable.
28+
* Added property `detect.cargo.path` to allow users to specify a custom Cargo executable path.
2629

2730
### Resolved issues
2831

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
# Cargo support
22

3-
## Overview
3+
## Overview
44

5-
[detect_product_short] runs the Cargo detector if it finds either of the following files in your project:
5+
[detect_product_short] now includes two Cargo detectors:
66

7-
* Cargo.toml
8-
* Cargo.lock
7+
* **Cargo CLI Detector** (New)
8+
* **Cargo Lockfile Detector**
99

10-
The Cargo detector parses the Cargo.lock file for information on your project's dependencies. If the detector discovers a Cargo.toml file but not a Cargo.lock file, it will prompt the user to generate a Cargo.lock by running `cargo generate-lockfile` and then run [detect_product_short] again.
11-
The Cargo detector extracts the project's name and version from the Cargo.toml file. If it does not find a Cargo.toml file, it will defer to values derived by Git, from the project's directory, or defaults.
10+
## Cargo CLI Detector
11+
12+
A new cli detector for Cargo projects, which extracts **direct and transitive dependencies** using the `cargo tree` command. This improves the accuracy of dependency detection over the previous flat-list detection.
13+
14+
**Requirements:**
15+
* Cargo version **1.44.0+** is required (as `cargo tree` was introduced in this version).
16+
* A `Cargo.toml` file must be present in the project.
17+
* A valid `cargo` executable must be available on the system.
18+
19+
**Behavior:**
20+
* Executes `cargo tree` to analyze dependencies.
21+
* Parses the output to construct a hierarchical **dependency graph**.
22+
* Falls back to the Cargo Lockfile Detector if `cargo tree` is unavailable.
23+
24+
To specify a custom Cargo executable path, use the `detect.cargo.path` property.
25+
26+
## Cargo Lockfile Detector
27+
28+
If `cargo tree` is unavailable, [detect_product_short] will default to the Cargo Lockfile Detector, which extracts dependencies by parsing the `Cargo.lock` file.
29+
30+
* If both `Cargo.toml` and `Cargo.lock` are present, the detector uses `Cargo.lock` for dependency information.
31+
* If `Cargo.lock` is missing, the detector prompts the user to generate it using `cargo generate-lockfile`.
32+
* Extracts the project’s name and version from `Cargo.toml`. If missing, it derives values from Git or the project directory.

0 commit comments

Comments
 (0)