Issue #15665 has been updated by franklinyu (Franklin Yu).

Status changed from Rejected to Open

@hsbt That location has been [deprecated](https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624):

> The command line tools will search the SDK for system headers by default. However, some software may fail to build correctly against the SDK and require macOS headers to be installed in the base system under /usr/include. If you are the maintainer of such software, we encourage you to update your project to work with the SDK or file a bug report for issues that are preventing you from doing so. As a workaround, an extra package is provided which will install the headers to the base system. **In a future release, this package will no longer be provided.**

Please be future-proof.

hsbt (Hiroshi SHIBATA) wrote:
> I couldn't reproduce this with Mojave.
> 
> ```
> ~ > ls /usr/include/netinet6/in6.h
> /usr/include/netinet6/in6.h
> ```
> 
> It seems your development environment issue.



----------------------------------------
Bug #15665: Cannot compile socket extension on Mojave
https://bugs.ruby-lang.org/issues/15665#change-78073

* Author: franklinyu (Franklin Yu)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.0
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The `mkmf.log` is reporting that it cannot find `netinet6/in6.h`. I guess that previously its finding it in `/usr/include`, but as we all know Apple removed that path since Mojave. On my machine the current path is:

```
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/
```

The C compiler seems fine if Im using it stand-alone. I tried compiling following snippet:

```c
#include <netinet/in.h>
int main() {}
int t(struct in6_addr *addr) {
    return IN6_IS_ADDR_UNSPECIFIED(addr);
}
```

And it works, although I have no idea which header it included. I tried both compiling it with `cc test.c`, and with the actual command in `mkmf.log`:

```
clang -I../../.ext/include/x86_64-darwin18 -I../.././include -I../.././ext/socket -I../.. -I../../. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -Wall -Wextra -Wpedantic -Wshadow -pipe -D__APPLE_USE_RFC_3542 -Werror
```

Both works without any warning/error.

## note

This only happens to 2.6.0 and 2.6.1. Releases in 2.5.x or below are not affected.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>