Opened 6 years ago

Closed 3 years ago

#56299 closed defect (fixed)

rb-cocoa: fatal error: 'string.h' file not found

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version:
Keywords: yosemite elcapitan sierra highsierra mojave catalina bigsur haspatch Cc: cooljeanius (Eric Gallager), ryandesign (Ryan Carsten Schmidt)
Port: rb-cocoa

Description

rb-cocoa does not build on macOS High Sierra:

clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.4u.sdk' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.4u.sdk' [-Wmissing-sysroot]
In file included from src/types.c:27:
./include/ffi_common.h:37:11: fatal error: 'string.h' file not found
# include <string.h>
          ^~~~~~~~~~
1 error generated.

The 10.4u SDK is not available on recent systems.

Change History (4)

comment:1 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:2 Changed 3 years ago by cooljeanius (Eric Gallager)

Different error on Big Sur:

cc -O3 -I./include -DMACOSX -arch ppc -arch i386  -c src/types.c -o src/types.o 
In file included from src/types.c:26:
In file included from ./include/ffi.h:83:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/limits.h:63:
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/sys/cdefs.h:828:2: error: Unsupported architecture
#error Unsupported architecture
 ^

(presumably from the -arch ppc flag)

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added
Keywords: yosemite elcapitan sierra highsierra mojave catalina bigsur haspatch added

RubyCocoa was intending to use the 10.4u SDK to build the bundled copy of libffi only when the OS version is less than 10.5, but it was doing the version comparison as a floating point number, so OS versions 10.10 through 10.15 were seen as less than 10.5. This was fixed in https://github.com/rubycocoa/rubycocoa/commit/3e4c5c8d2df8e7c81a1f4c56ef597cd5da8eb0e9.

The second problem is the use of undesired -arch flags (and not UsingTheRightCompiler), both of which are in the Makefile of the bundled libffi. It only tries to make the bundled libffi on 10.5 or later if the libffi system library doesn't appear to exist in the filesystem. Of course, on macOS 11, Apple deleted all system libraries from the filesystem, keeping them only in the dylib cache, something about which this build system didn't know.

RubyCocoa 1.2.0 deletes the bundled libffi and thereby solves both problems so the port should be updated to that version, which I've done in https://github.com/macports/macports-ports/pull/11764.

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In cbf02f422c28b2c277b6f021058bfff2769248e4/macports-ports (master):

rb-cocoa: Update to 1.2.0

Closes: #56299

Note: See TracTickets for help on using tickets.