Skip to content

fix: Fix compilation failures when not enabling default features#1162

Open
sbernauer wants to merge 2 commits intomainfrom
fix/crate-features
Open

fix: Fix compilation failures when not enabling default features#1162
sbernauer wants to merge 2 commits intomainfrom
fix/crate-features

Conversation

@sbernauer
Copy link
Member

@sbernauer sbernauer commented Feb 27, 2026

Context: Bumping operator-rs in containerdebug

Problem

Some of our crates (notable stackable-operator) produce lot's of compilation errors when being pulled in with no default features, e.g.

stackable-operator = { git = "https://github.com/stackabletech/operator-rs", tag = "stackable-operator-0.106.2", default-features = false }

produces error: could not compile stackable-operator (lib) due to 237 previous errors

stackable-telemetry is even worse, as it is broken using default features:

stackable-telemetry = {git = "https://github.com/stackabletech/operator-rs", tag = "stackable-operator-0.106.2" }

causes

error[E0432]: unresolved import `clap`
  --> /home/sbernauer/.cargo/git/checkouts/operator-rs-10d25a4c6a1c49cf/f9b117c/crates/stackable-telemetry/src/tracing/mod.rs:12:5
   |
12 | use clap;
   |     ^^^^ no external crate `clap`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `stackable-telemetry` (lib) due to 1 previous error

Fix

This PR fixes the stackable-operator and stackable-telemetry by making mandatory features actually mandatory.
I also added pre-commit checks to prevent this from happening again.

With this fix I can now pull in exactly what I need in containerdebug:

stackable-shared = {git = "https://github.com/stackabletech/operator-rs", branch = "fix/crate-features" }
stackable-telemetry = {git = "https://github.com/stackabletech/operator-rs", branch = "fix/crate-features", features = ["clap"] }

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added

@sbernauer sbernauer changed the title fix: Fix multiple compilation failures when not enabling default features fix: Fix compilation failures when not enabling default features Feb 27, 2026
@sbernauer sbernauer marked this pull request as ready for review February 27, 2026 07:47
@sbernauer sbernauer self-assigned this Feb 27, 2026
@sbernauer sbernauer moved this to Development: Waiting for Review in Stackable Engineering Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Development: Waiting for Review

Development

Successfully merging this pull request may close these issues.

1 participant