← Back to issue list

cargo-use: support Rust workspaces better

View original Github issue

Metadata

Project
craft-parts
Number
#1217
Type
issue
State
open
Author
Saviq
Labels
Created
Updated
Closed

Current evaluation

Feature request to improve the cargo-use plugin for Rust workspaces (multi-crate repos), where crates inheriting metadata from the workspace root fail to parse. No labels or maintainer response; the plugin still lacks workspace support at HEAD.

Suggested action: needs triage

Reason: The issue has no labels, zero comments, and no maintainer acknowledgement, so it has never been triaged. The reported gap is still real at HEAD: cargo_use_plugin.py still copies the entire source tree and raises 'Package section is missing in Cargo.toml file' for virtual workspaces, with no per-crate cargo package support. It should be kept open and triaged rather than closed, since the limitation persists.

Impact: 40 Quick Win: 18.0 Staleness: 62 Complexity: 55 Confidence: 80 Support Request: 15

Issue body

### What needs to get done It's common for Rust repositories to contain multiple packages/crates in a single workspace. The `cargo-use` plugin needs to better support this. `crate package` is the standard way to "render" a crate standalone, and here's a `build-override` that works well: ```yaml build-environment: - CARGO_PACKAGES: . clap_builder override-build: &package-override | REGISTRY=$( readlink -f ${CRAFT_PART_INSTALL}/../export/cargo-registry ) mkdir --parents "${REGISTRY}" for package in ${CARGO_PACKAGES}; do cd ${CRAFT_PART_BUILD}/$package cargo package --no-verify done cd ${CRAFT_PART_BUILD} for crate in target/package/*.crate; do tar xzvf "${crate}" -C "${REGISTRY}" echo '{"files":{}}' > ${REGISTRY}/$( basename ${crate%.crate} )/.cargo-checksum.json done ``` `crate package --workspace` could create all the packages in one go, but is unreliable (many repositories fail in a myriad ways) and some crates might not even be desirable in the output, so giving the user agency on which crates to work through is likely appropriate. ### Why it needs to get done Pointing at each crate in a workspace individually is tedious, wasteful (pulling the same source multiple times) and error prone: ``` :: Caused by: :: failed to parse manifest at `/root/backstage/cargo-registry/toml_datetime-0.6.8/Cargo.toml` :: Caused by: :: error inheriting `edition` from workspace root manifest's `workspace.package.edition` :: Caused by: :: failed to find a workspace root ``` This is because the crate tries to inherit metadata from the workspace, e.g.: https://github.com/toml-rs/toml/blob/9154dcb3b2eea8a84db183806411adf081bc0977/crates/toml_datetime/Cargo.toml#L7-L11

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 18.0
Staleness: 62
Complexity: 55
Confidence: 80
Support Request: 15
needs triage Feature request to improve the cargo-use plugin for Rust workspaces (multi-crate repos), where crates inheriting metadata from the workspace root fail to parse. No labels or maintainer response; the plugin still lacks workspace support at HEAD.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 65
Confidence: 90
Support Request: 10
needs triage Enhancement request for cargo-use plugin to better handle Rust workspaces. Currently unlabelled, has zero comments, and shows no maintainer activity in over 200 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 65
Confidence: 90
Support Request: 10
needs triage Feature request to improve Rust workspace support in the cargo-use plugin. Currently lacks maintainer response, labels, or assignee. Requires architectural changes to handle multi-crate workspaces efficiently.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 40
Confidence: 75
Support Request: 10
needs triage Enhance cargo-use plugin to support Rust workspaces by enabling explicit crate selection via CARGO_PACKAGES, avoiding unreliable --workspace behavior. Open, zero comments, awaiting triage and assignment.

Update history

No update history recorded yet.

Related work

  • Related To: craft-parts#1062 (confidence 75%)

    PR that introduced the cargo-use plugin (commit 6250df05 'feat: add cargo-use plugin (#1062)'); this issue asks to extend that plugin for workspaces.

Related issues

No related issues found above the similarity threshold.