about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-10-01 22:15:03 +1000
committerGitHub <noreply@github.com>2025-10-01 22:15:03 +1000
commit06e059d45d53d82654cad67eff3905c0577e36ab (patch)
tree460ac444041db7cc49873314ceac128731437bdd
parentf50c76f2fa18dd02810346ac6e11c3fc9ccbf91b (diff)
parentb1c212f8502e8e7fcb66da0e8da98db770cb7c02 (diff)
downloadrust-06e059d45d53d82654cad67eff3905c0577e36ab.tar.gz
rust-06e059d45d53d82654cad67eff3905c0577e36ab.zip
Rollup merge of #147213 - ivmarkov:fix-hostname-espidf, r=joboet
Fix broken STD build for ESP-IDF

PRs rust-lang/rust#147162 and rust-lang/rust#146937 did [broke](https://github.com/esp-rs/esp-idf-sys/actions/runs/18151791720/job/51663969786) the STD build for `target_os = "espidf"` because that target [does not have neither a `gethostname`, not a `libc::_SC_HOST_NAME_MAX` by default](https://github.com/espressif/esp-idf/issues/14849).

While there is a [3rd party component for this syscall](https://components.espressif.com/components/espressif/sock_utils/versions/0.2.2/readme) in the ESP-IDF component registry, I don't think we should use it, because it does not come with ESP-IDF by default.

Therefore, the one-liner fix just re-routes ESP-IDF into the `unsupported` branch.
-rw-r--r--library/std/src/sys/net/hostname/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/net/hostname/mod.rs b/library/std/src/sys/net/hostname/mod.rs
index a4b5b76059d..8ffe4894d71 100644
--- a/library/std/src/sys/net/hostname/mod.rs
+++ b/library/std/src/sys/net/hostname/mod.rs
@@ -1,5 +1,5 @@
 cfg_select! {
-    target_family = "unix" => {
+    all(target_family = "unix", not(target_os = "espidf")) => {
         mod unix;
         pub use unix::hostname;
     }