The arpa/inet.h header in macOS is providing an incorrect htonl
function with enabled local submodule visibility while building LLDB. This
caused several networking tests to fail as the IP addresses are now flipped
in LLDB.
This patch disables building with modules when local submodule visibility is
active and the current system is macOS for the source/Host directory (which
is the *only directory that includes arpa/inet.h).
- debugserver also includes arpa/inet.h but there we already disabled
modules.
I know this would speculative, but would it be possible to detect the SDK version here? This way it forces us to regularly check whether the workaround is still necessary.
If you know the sysroot (=SDK path), you can inspect $SYSROOT/SDKSettings.json (perhaps via an inline python script and extract the version key), or perhaps even more straightforward you could invoke plutil on $SYSROOT/SDKSettings.plist to extract the version.