Skip to content

fix(kble-socket): compile with features = ["stdio"] alone - #190

Merged
sksat (sksat) merged 1 commit into
mainfrom
fix/kble-socket-stdio-feature
Jun 5, 2026
Merged

fix(kble-socket): compile with features = ["stdio"] alone#190
sksat (sksat) merged 1 commit into
mainfrom
fix/kble-socket-stdio-feature

Conversation

@sksat

Copy link
Copy Markdown
Member

What

Fixes a pre-existing feature-flag bug: kble-socket with features = ["stdio"] (without tungstenite) failed to compile.

The bug

lib.rs re-exported from_stdio whenever stdio was enabled:

#[cfg(feature = "stdio")]
pub use stdio::{from_stdio, Stdio};

But from_stdio is #[cfg(feature = "tungstenite")] (it builds a WebSocketStream). So stdio alone gave error[E0432]: unresolved import stdio::from_stdio.

Fix

Gate the from_stdio re-export on both features; stdio alone still provides the Stdio byte-stream adapter:

#[cfg(feature = "stdio")]
pub use stdio::Stdio;
#[cfg(all(feature = "stdio", feature = "tungstenite"))]
pub use stdio::from_stdio;

Notes

🤖 Generated with Claude Code

`lib.rs` re-exported `from_stdio` whenever `stdio` was enabled, but `from_stdio`
is `#[cfg(feature = "tungstenite")]` (it builds a WebSocket), so enabling `stdio`
without `tungstenite` failed to compile with `unresolved import
stdio::from_stdio`.

Gate the `from_stdio` re-export on both `stdio` and `tungstenite`; `stdio` alone
still provides the `Stdio` byte-stream adapter. Pre-existing issue, unrelated to
the cancellable-stdin work in #189.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@sksat

Copy link
Copy Markdown
Member Author

The feature-powerset CI guard added in #191 correctly catches the bug this PR fixes.

Running #191's new cargo hack check --feature-powerset against main (i.e. without this fix), the verify-crate job fails at exactly the stdio-only combination:

running `cargo check --no-default-features --features stdio` on kble-socket (7/15)
error[E0432]: unresolved import `stdio::from_stdio`
   |
13 | pub use stdio::{from_stdio, Stdio};
   |                 ^^^^^^^^^^ no `from_stdio` in `stdio`
error: could not compile `kble-socket` (lib) due to 1 previous error

(run: https://github.com/arkedge/kble/actions/runs/26989996812/job/79647909232)

Every other step (clippy / fmt / install cargo-hack) passes; only the new check feature powerset step is red, on the single combination this PR repairs. Once this PR merges and #191 is rebased onto main, all 15 workspace feature combinations compile and #191 goes green — so #191 both proves and guards against this regression.

@sksat
sksat (sksat) merged commit 7a655c3 into main Jun 5, 2026
2 of 4 checks passed
@sksat
sksat (sksat) deleted the fix/kble-socket-stdio-feature branch June 5, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants