[GH-ISSUE #1832] [BUG] Build failure with only feature dns-over-https #785

Closed
opened 2026-03-16 00:14:11 +03:00 by kerem · 2 comments
Owner

Originally created by @NobodyXu on GitHub (Nov 17, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1832

cargo check --no-default-features --features dns-over-https failed with:

warning: /Users/nobodyxu/Dev/trust-dns/bin/Cargo.toml: file found to be present in multiple build targets: /Users/nobodyxu/Dev/trust-dns/bin/src/named.rs
    Checking trust-dns-proto v0.22.0 (/Users/nobodyxu/Dev/trust-dns/crates/proto)
error[E0433]: failed to resolve: use of undeclared crate or module `tokio_rustls`
  --> crates/proto/src/https/https_client_stream.rs:26:5
   |
26 | use tokio_rustls::{
   |     ^^^^^^^^^^^^ use of undeclared crate or module `tokio_rustls`

error[E0432]: unresolved import `rustls`
  --> crates/proto/src/https/https_client_stream.rs:25:5
   |
25 | use rustls::ClientConfig;
   |     ^^^^^^ use of undeclared crate or module `rustls`

error[E0432]: unresolved import `tokio_rustls`
  --> crates/proto/src/https/https_client_stream.rs:26:5
   |
26 | use tokio_rustls::{
   |     ^^^^^^^^^^^^ use of undeclared crate or module `tokio_rustls`

error[E0432]: unresolved import `crate::iocompat`
  --> crates/proto/src/https/https_client_stream.rs:32:12
   |
32 | use crate::iocompat::AsyncIoStdAsTokio;
   |            ^^^^^^^^ could not find `iocompat` in the crate root

error[E0433]: failed to resolve: use of undeclared crate or module `tokio`
   --> crates/proto/src/https/https_client_stream.rs:477:21
    |
477 |                     tokio::spawn(
    |                     ^^^^^ use of undeclared crate or module `tokio`

warning: unused import: `TryFutureExt`
  --> crates/proto/src/https/https_client_stream.rs:20:39
   |
20 | use futures_util::future::{FutureExt, TryFutureExt};
   |                                       ^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
warning: `trust-dns-proto` (lib) generated 1 warning
error: could not compile `trust-dns-proto` due to 5 previous errors; 1 warning emitted

I found this when running cargo hack check --feature-powerset.

System:
This bug does not depend on specific system configure to reproduce.

Version:
Crate: proto
Version: 0.22.0

Additional context

This bug is originally found in https://github.com/cargo-bins/cargo-binstall/pull/538 and https://github.com/cargo-bins/cargo-binstall/pull/430
It can be reproduced on GHA mac (x86-64)/windows/ubuntu whenever trust-dns is enabled and also on my M1 mac.

Originally created by @NobodyXu on GitHub (Nov 17, 2022). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1832 `cargo check --no-default-features --features dns-over-https` failed with: ``` warning: /Users/nobodyxu/Dev/trust-dns/bin/Cargo.toml: file found to be present in multiple build targets: /Users/nobodyxu/Dev/trust-dns/bin/src/named.rs Checking trust-dns-proto v0.22.0 (/Users/nobodyxu/Dev/trust-dns/crates/proto) error[E0433]: failed to resolve: use of undeclared crate or module `tokio_rustls` --> crates/proto/src/https/https_client_stream.rs:26:5 | 26 | use tokio_rustls::{ | ^^^^^^^^^^^^ use of undeclared crate or module `tokio_rustls` error[E0432]: unresolved import `rustls` --> crates/proto/src/https/https_client_stream.rs:25:5 | 25 | use rustls::ClientConfig; | ^^^^^^ use of undeclared crate or module `rustls` error[E0432]: unresolved import `tokio_rustls` --> crates/proto/src/https/https_client_stream.rs:26:5 | 26 | use tokio_rustls::{ | ^^^^^^^^^^^^ use of undeclared crate or module `tokio_rustls` error[E0432]: unresolved import `crate::iocompat` --> crates/proto/src/https/https_client_stream.rs:32:12 | 32 | use crate::iocompat::AsyncIoStdAsTokio; | ^^^^^^^^ could not find `iocompat` in the crate root error[E0433]: failed to resolve: use of undeclared crate or module `tokio` --> crates/proto/src/https/https_client_stream.rs:477:21 | 477 | tokio::spawn( | ^^^^^ use of undeclared crate or module `tokio` warning: unused import: `TryFutureExt` --> crates/proto/src/https/https_client_stream.rs:20:39 | 20 | use futures_util::future::{FutureExt, TryFutureExt}; | ^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default Some errors have detailed explanations: E0432, E0433. For more information about an error, try `rustc --explain E0432`. warning: `trust-dns-proto` (lib) generated 1 warning error: could not compile `trust-dns-proto` due to 5 previous errors; 1 warning emitted ``` I found this when running `cargo hack check --feature-powerset`. **System:** This bug does not depend on specific system configure to reproduce. **Version:** Crate: proto Version: 0.22.0 **Additional context** This bug is originally found in https://github.com/cargo-bins/cargo-binstall/pull/538 and https://github.com/cargo-bins/cargo-binstall/pull/430 It can be reproduced on GHA mac (x86-64)/windows/ubuntu whenever trust-dns is enabled and also on my M1 mac.
kerem closed this issue 2026-03-16 00:14:17 +03:00
Author
Owner

@NobodyXu commented on GitHub (Nov 17, 2022):

NOTE that enabling dns-over-native-tls also failed:

info: running `cargo check --no-default-features --features dns-over-native-tls` on trust-dns-proto (7/568
0)
warning: /Users/nobodyxu/Dev/trust-dns/bin/Cargo.toml: file found to be present in multiple build targets:
 /Users/nobodyxu/Dev/trust-dns/bin/src/named.rs
   Compiling tokio v1.21.0
    Checking tokio-native-tls v0.3.0
    Checking trust-dns-proto v0.22.0 (/Users/nobodyxu/Dev/trust-dns/crates/proto)
error[E0432]: unresolved import `crate::iocompat`
  --> crates/proto/src/native_tls/tls_client_stream.rs:21:12
   |
21 | use crate::iocompat::AsyncIoStdAsTokio;
   |            ^^^^^^^^ could not find `iocompat` in the crate root

error[E0432]: unresolved import `crate::iocompat`
  --> crates/proto/src/native_tls/tls_client_stream.rs:22:12
   |
22 | use crate::iocompat::AsyncIoTokioAsStd;
   |            ^^^^^^^^ could not find `iocompat` in the crate root

error[E0432]: unresolved import `crate::iocompat`
  --> crates/proto/src/native_tls/tls_stream.rs:20:12
   |
20 | use crate::iocompat::{AsyncIoStdAsTokio, AsyncIoTokioAsStd};
   |            ^^^^^^^^ could not find `iocompat` in the crate root

warning: unused import: `futures_util::TryFutureExt`
  --> crates/proto/src/native_tls/tls_client_stream.rs:14:5
   |
14 | use futures_util::TryFutureExt;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default


For more information about this error, try `rustc --explain E0432`.
warning: `trust-dns-proto` (lib) generated 1 warning
error: could not compile `trust-dns-proto` due to 3 previous errors; 1 warning emitted
error: process didn't exit successfully: `/Users/nobodyxu/.rustup/toolchains/stable-aarch64-apple-darwin/b
in/cargo check --manifest-path Cargo.toml --no-default-features --features dns-over-native-tls` (exit stat
us: 101)


<!-- gh-comment-id:1317937811 --> @NobodyXu commented on GitHub (Nov 17, 2022): NOTE that enabling `dns-over-native-tls` also failed: ``` info: running `cargo check --no-default-features --features dns-over-native-tls` on trust-dns-proto (7/568 0) warning: /Users/nobodyxu/Dev/trust-dns/bin/Cargo.toml: file found to be present in multiple build targets: /Users/nobodyxu/Dev/trust-dns/bin/src/named.rs Compiling tokio v1.21.0 Checking tokio-native-tls v0.3.0 Checking trust-dns-proto v0.22.0 (/Users/nobodyxu/Dev/trust-dns/crates/proto) error[E0432]: unresolved import `crate::iocompat` --> crates/proto/src/native_tls/tls_client_stream.rs:21:12 | 21 | use crate::iocompat::AsyncIoStdAsTokio; | ^^^^^^^^ could not find `iocompat` in the crate root error[E0432]: unresolved import `crate::iocompat` --> crates/proto/src/native_tls/tls_client_stream.rs:22:12 | 22 | use crate::iocompat::AsyncIoTokioAsStd; | ^^^^^^^^ could not find `iocompat` in the crate root error[E0432]: unresolved import `crate::iocompat` --> crates/proto/src/native_tls/tls_stream.rs:20:12 | 20 | use crate::iocompat::{AsyncIoStdAsTokio, AsyncIoTokioAsStd}; | ^^^^^^^^ could not find `iocompat` in the crate root warning: unused import: `futures_util::TryFutureExt` --> crates/proto/src/native_tls/tls_client_stream.rs:14:5 | 14 | use futures_util::TryFutureExt; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default For more information about this error, try `rustc --explain E0432`. warning: `trust-dns-proto` (lib) generated 1 warning error: could not compile `trust-dns-proto` due to 3 previous errors; 1 warning emitted error: process didn't exit successfully: `/Users/nobodyxu/.rustup/toolchains/stable-aarch64-apple-darwin/b in/cargo check --manifest-path Cargo.toml --no-default-features --features dns-over-native-tls` (exit stat us: 101) ```
Author
Owner

@djc commented on GitHub (Nov 20, 2022):

It's a little unclear to me what's actually the purpose here. As I see it, the dns-over-https feature by itself isn't particularly useful, and is mostly used as a common subset for dns-over-https-rustls and dns-over-https-native-tls. So why should we fix this?

<!-- gh-comment-id:1321224521 --> @djc commented on GitHub (Nov 20, 2022): It's a little unclear to me what's actually the purpose here. As I see it, the `dns-over-https` feature by itself isn't particularly useful, and is mostly used as a common subset for `dns-over-https-rustls` and `dns-over-https-native-tls`. So why should we fix this?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#785
No description provided.