{"record":{"id":"8a09cb242b5ae605","repo":"ducaale/xh","slug":"this-binary-was-built-without-support-for-binding-to","errorCode":null,"errorMessage":"This binary was built without support for binding to interfaces. Enable the `network-interface` feature.","messagePattern":"This binary was built without support for binding to interfaces\\. Enable the `network-interface` feature\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":351,"sourceCode":"            {\n                client = client.interface(name_or_ip);\n            }\n\n            #[cfg(not(any(\n                target_os = \"android\",\n                target_os = \"fuchsia\",\n                target_os = \"illumos\",\n                target_os = \"ios\",\n                target_os = \"linux\",\n                target_os = \"macos\",\n                target_os = \"solaris\",\n                target_os = \"tvos\",\n                target_os = \"visionos\",\n                target_os = \"watchos\",\n            )))]\n            {\n                #[cfg(not(feature = \"network-interface\"))]\n                return Err(anyhow!(\n                    \"This binary was built without support for binding to interfaces. Enable the `network-interface` feature.\"\n                ));\n\n                #[cfg(feature = \"network-interface\")]\n                {\n                    use network_interface::{NetworkInterface, NetworkInterfaceConfig};\n                    let ip_addr = NetworkInterface::show()?\n                        .iter()\n                        .find_map(|interface| {\n                            if &interface.name == name_or_ip {\n                                if let Some(addr) = interface.addr.first() {\n                                    return Some(addr.ip());\n                                }\n                            }\n                            None\n                        })\n                        .with_context(|| format!(\"Couldn't bind to {:?}\", name_or_ip))?;\n                    log::debug!(\"Resolved {name_or_ip:?} to {ip_addr:?}\");","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/ducaale/xh/blob/2404aceecc08b0b2d100fedc96f57745cd5904dc/src/main.rs#L333-L369","documentation":"This xh binary was compiled without the `network-interface` cargo feature, which provides the ability to bind outgoing requests to a specific network interface. When the user passes an interface-binding option, `run` immediately returns this error because the code path that would use the `network_interface` crate is compiled out. It is a build-time capability check, not a runtime failure.","triggerScenarios":"Running a binary built with `--no-default-features` or a feature set excluding `network-interface`, then invoking xh with the option to bind to a network interface (e.g. `--interface`).","commonSituations":"Using a distro-packaged or minimal build of xh that strips optional features; building with `cargo install xh --no-default-features`; Docker/CI images built with a reduced feature set.","solutions":["Rebuild/reinstall xh with the feature enabled: `cargo install xh --features network-interface` (or with default features).","Download an official pre-built xh release binary, which includes the feature.","Remove the interface-binding flag from the invocation if binding is not actually required."],"exampleFix":"// before\ncargo install xh --no-default-features\n// after\ncargo install xh --features network-interface","handlingStrategy":"validation","validationCode":"// before shipping a minimal build, confirm the feature is on:\n// cargo tree -e features | grep network-interface  (or check Cargo.toml features)\n// runtime guard in a wrapper script:\nif ! xh --help | grep -q interface; then echo 'xh build lacks network-interface support'; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use official release binaries or default features unless you deliberately strip them.","Document required features in build scripts/CI images.","Smoke-test stripped builds against every flag your scripts use."],"tags":["build-configuration","feature-flags","network","cli"],"backgroundTag":"feature-not-enabled","analyzedSha":"2404aceecc08b0b2d100fedc96f57745cd5904dc","analyzedAt":"2026-09-13T19:13:33.814Z","contentChangedAt":"2026-09-13T19:13:33.814Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}