← Back to issue list

charm plugin should include rust compiler in build dependencies

View original Github issue

Metadata

Project
charmcraft
Number
#2004
Type
issue
State
closed
Author
james-garner-canonical
Labels
Created
Updated
Closed

Current evaluation

Rejected. The team is shifting away from implicit build dependencies to prevent version drift and unexpected failures. Users must explicitly declare cargo and rustc in their charmcraft.yaml parts.

Suggested action:

No scores available.

Issue body

### What needs to get done Add `"cargo"` to the charm plugin build dependencies for deb based charms (see PR #2005). I'm not 100% sure what's needed for `yum` and `dnf` systems. ### Why it needs to get done It's increasingly common that some python packages require a rust compiler at build time. We first noticed this a few months ago in the Juju SDK's ['Write your first Kubernetes charm' tutorial](https://juju.is/docs/sdk/observe-your-charm-with-cos-lite#heading--build-packages). Here we needed to [add](https://github.com/canonical/juju-sdk-tutorial-k8s/pull/42) `cargo` to `build-packages` for the `charm` `part` when adding [cos-lite](https://charmhub.io/cos-lite). This came up again recently with the 2023 Operator Day tutorial ([video](https://www.youtube.com/watch?v=GkQ3OLJp2Gs), [repo](https://github.com/operatorinc/zinc-k8s-operator)) that most new starters [are asked to do](https://sites.google.com/canonical.com/engineeringonboarding/fundamentals/charms). Here the need for `cargo` comes from adding the [`traefik_k8s.v2.ingress`](https://github.com/canonical/traefik-k8s-operator/blob/main/lib/charms/traefik_k8s/v2/ingress.py) lib, because it includes the popular PyPI package `pydantic` (note: the lib is using `PYDEPS`). We considered another documentation fix here (which would have to include both the tutorial and the `ingress` lib, as well as any other libs using `pydantic`), but it seems like it might be a better idea to just include `cargo` in the charm plugin's build dependencies by default.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6 Rejected. The team is shifting away from implicit build dependencies to prevent version drift and unexpected failures. Users must explicitly declare cargo and rustc in their charmcraft.yaml parts.
qwen/qwen3.6-35b-a3b Rejected. Maintainers declined to add the Rust compiler to default build dependencies, citing a strategic shift toward explicit, minimal build configurations to prevent unexpected version conflicts across different OS bases.
qwen/qwen3.6-35b-a3b Rejected. The team is moving away from implicit build dependencies to ensure minimal, predictable builds. Adding cargo by default risks unexpected failures from system package version drift, so the feature request was closed.
qwen3.6-35b-a3b-mtp-q6 Rejected. Maintainers prefer explicit parts definitions over implicit dependencies. Including cargo by default is avoided to prevent unexpected build failures from system updates. Users must manually specify the rust toolchain.
qwen3.6-35b-a3b-mtp-q6 Rejected. Maintainers favor explicit, minimal part definitions over implicit dependencies. Bundling cargo risks unpredictable build failures from system package updates, so users must manually specify rustc and cargo.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2005 feat: add "cargo" to deb build dependencies for charm plugin charmcraft closed Adding cargo to deb build dependencies for the charm plugin was closed due to inactivity. A reviewer flagged conflicts with user-managed Rust toolchains and recommended an environment validator. The changes were not merged.
73%