Repository: pytorch
Issue: /Users/davidlaxer/pytorch/third_party/tensorpipe/third_party/libuv/src/unix/getaddrinfo.c:165:10: error: implicit declaration of function 'uv__idna_toascii' [-Werror,-Wimplicit-function-declaration]     rc = uv__idna_toascii(hostname,
Labels: oncall: distributed,triaged

### 🐛 Describe the bug

Building PyTorch from source with 'USE_DISTRIBUTED=ON' had a problem in thirdparty tensorpipe with uv.h.
/Users/davidlaxer/pytorch/third_party/tensorpipe/third_party/libuv/include/uv.h

uv__idna_toascii was not declared in uv.h

I'm on MacOS 13.3.1 using this version of clang:
```
 CC=/usr/bin/clang CXX=/usr/bin/clang++ 
% /usr/bin/clang++  --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
```

Build commands:
```
 export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
 CC=/usr/bin/clang CXX=/usr/bin/clang++ python setup.py build --cmake-only
ccmake build  # or cmake-gui build

% export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} 
 CC=/usr/bin/clang CXX=/usr/bin/clang++ python setup.py install           

```
PyTorch builds properly with USE_DISTRIBUTED=OFF

### Versions

```
% python collect_env.py
Collecting environment information...
PyTorch version: 2.1.0a0+git6bc0f4a
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 13.3.1 (x86_64)
GCC version: Could not collect
Clang version: 14.0.6
CMake version: version 3.22.1
Libc version: N/A

Python version: 3.10.11 (main, Apr 20 2023, 13:59:00) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-10.16-x86_64-i386-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz

Versions of relevant libraries:
[pip3] audiolm-pytorch==0.0.1
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.24.3
[pip3] pytorch-transformers==1.1.0
[pip3] torch==2.1.0a0+gita941356
[pip3] torch-struct==0.5
[pip3] torch-summary==1.4.5
[pip3] torch-utils==0.1.2
[pip3] torchaudio==2.0.0.dev20230313
[pip3] torchtraining-nightly==1604016577
[pip3] torchvision==0.16.0.dev20230428
[pip3] vector-quantize-pytorch==0.9.2
[conda] nomkl                     3.0                           0  
[conda] numpy                     1.24.3          py310he50c29a_0  
[conda] numpy-base                1.24.3          py310h992e150_0  
[conda] pytorch-transformers      1.1.0                    pypi_0    pypi
[conda] torch                     2.1.0a0+git6bc0f4a          pypi_0    pypi
[conda] torch-struct              0.5                      pypi_0    pypi
[conda] torch-summary             1.4.5                    pypi_0    pypi
[conda] torch-utils               0.1.2                    pypi_0    pypi
[conda] torchaudio                2.0.0.dev20230313          pypi_0    pypi
[conda] torchtraining-nightly     1604016577               pypi_0    pypi
[conda] torchvision               0.16.0.dev20230428          pypi_0    pypi
[conda] vector-quantize-pytorch   0.9.2                    pypi_0    pypi
(AI-Feynman) davidlaxer@bluediamond pytorch % 

```

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu