Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#68148 closed defect (fixed)

libgit2 @1.7.1: builds fail with xcode clang 6 and earlier: error: unknown type name 'inline', from legacy-support header 'dirent.h'

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: cjones051073 (Chris Jones), catap (Kirill A. Korinsky)
Port: libgit2

Description (last modified by mascguy (Christopher Nielsen))

A recent addition to legacy-support added some functions declared inline, per PR:

However, upstream's project compiles with the C standard set to 90, which doesn't support keyword inline. Instead, compiling with C 99 or later is required.

In file included from .../libgit2/work/libgit2-1.7.1/src/util/unix/posix.h:13:
/opt/local/include/LegacySupport/dirent.h:60:8: error: unknown type name 'inline'
static inline struct dirent *__mpls_readdir(DIR *dir) {
       ^

Change History (10)

comment:1 Changed 8 months ago by mascguy (Christopher Nielsen)

Description: modified (diff)

comment:2 Changed 8 months ago by mascguy (Christopher Nielsen)

Unfortunately blacklisting clang doesn't cut the mustard either. Do we need to patch the project's CMake files, and specify the C standard as 99? Or...?

comment:3 in reply to:  2 Changed 8 months ago by mascguy (Christopher Nielsen)

Cc: cjones051073 catap added
Summary: libgit2 @1.7.1: builds fail with xcode clang 6 and earlier: error: unknown type name 'inline'libgit2 @1.7.1: builds fail with xcode clang 6 and earlier: error: unknown type name 'inline', from legacy-support header 'dirent.h'

Replying to mascguy:

Unfortunately blacklisting clang doesn't cut the mustard either. Do we need to patch the project's CMake files, and specify the C standard as 99? Or...?

Given that the failure relates to a header provided by legacy-support - which AFAIK, we haven't seen cause any such issues elsewhere - this is curious to be sure. (And I'm thinking it's the project specifying C 90 to Clang.) Particularly when libgit2-devel 1.7.1 built just fine three weeks ago, with legacy-support. And the latter's header - dirent.h - hasn't changed.

Fortunately this is only affecting 10.9 and earlier, so the fallout isn't as bad as it could be. Would still like to get it resolved ASAP though.

comment:4 Changed 8 months ago by Christopher Nielsen <mascguy@…>

In a2be90d9ce5932c0a6c3bab9071c67cf58566c16/macports-ports (master):

libgit2-devel: patch to compile with c 99

See: #68148

comment:5 Changed 8 months ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In abd25f7f4a164c7ab2a8a8146fcbd746f45035a0/macports-ports (master):

libgit2: patch to compile with c 99

Fixes: #68148

comment:6 Changed 8 months ago by mascguy (Christopher Nielsen)

All good now, queued rebuilds for all dependent ports.

comment:7 in reply to:  description Changed 8 months ago by jmroot (Joshua Root)

Replying to mascguy:

Despite the project setting the C standard to 90 - which should (?) be sufficient - builds are failing due to keyword 'inline':

There is no inline keyword in C89/90. It's available as a GNU extension if you use -std=gnu89, but has different semantics to what was eventually added in C99.

comment:8 Changed 8 months ago by jmroot (Joshua Root)

In b7c964f912ecc7d86c462186cb768e0ea6acceda/macports-legacy-support (master):

Use inline in public headers

These may be included by C89 code where the inline keyword is not available.

See: #68148

comment:9 in reply to:  8 Changed 8 months ago by mascguy (Christopher Nielsen)

Description: modified (diff)

comment:10 Changed 8 months ago by mascguy (Christopher Nielsen)

Replying to jmroot:

In b7c964f912ecc7d86c462186cb768e0ea6acceda/macports-legacy-support (master):

Use __inline__ in public headers

These may be included by C89 code where the inline keyword is not available.

Beautiful, thanks Josh!

Once a new version of legacy-support has been released, I'll revert the C 99 patch for libgit2.

Note: See TracTickets for help on using tickets.