[MacPorts] #61628: git @ 2.29 +credential_osxkeychain+diff_highlight+pcre+perl5_28: cannot build when libarchive is active ("implicit declaration of function…")

MacPorts noreply at macports.org
Mon Nov 23 12:31:02 UTC 2020


#61628: git @ 2.29 +credential_osxkeychain+diff_highlight+pcre+perl5_28: cannot
build when libarchive is active ("implicit declaration of function…")
----------------------+--------------------
 Reporter:  jamadden  |      Owner:  (none)
     Type:  defect    |     Status:  new
 Priority:  Low       |  Milestone:
Component:  ports     |    Version:  2.6.4
 Keywords:            |       Port:  git
----------------------+--------------------
 (macOS 10.15.7; xcode 12.2)

 Building `builtin/archive.c` fails:
 {{{
 /usr/bin/clang -o builtin/archive.o -c -MF builtin/.depend/archive.o.d -MQ
 builtin/archive.o -MMD -MP   -I/opt/local/include -I. -Wall -O2
 -I/opt/local/include -arch x86_64 -I. -DPRECOMPOSE_UNICODE
 -DPROTECT_HFS_DEFAULT=1 -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2
 -I/opt/local/include -I/opt/local/include -DUSE_CURL_FOR_IMAP_SEND
 -DNO_OPENSSL -I/opt/local/include -DUSE_ST_TIMESPEC -DSHA1_APPLE
 -DSHA256_BLK -DSHA1_MAX_BLOCK_SIZE="1024L*1024L*1024L"  -DHAVE_DEV_TTY
 -DHAVE_BSD_SYSCTL -DHAVE_GETDELIM -DHAVE_NS_GET_EXECUTABLE_PATH
 -DAPPLE_COMMON_CRYPTO -DFREAD_READS_DIRECTORIES
 -DCOMMON_DIGEST_FOR_OPENSSL -DNO_MEMMEM -Icompat/regex
 -DSHELL_PATH='"/bin/sh"' -DPAGER_ENV='"LESS=FRX LV=-c"'  builtin/archive.c
 builtin/archive.c:48:24: error: implicit declaration of function
 'archive_format_from_filename' is invalid in C99 [-Werror,-Wimplicit-
 function-declaration]
                 const char *format =
 archive_format_from_filename(name_hint);
                                      ^
 builtin/archive.c:48:24: note: did you mean 'archive_read_open_filename'?
 /opt/local/include/archive.h:524:15: note: 'archive_read_open_filename'
 declared here
 __LA_DECL int archive_read_open_filename(struct archive *,
               ^
 builtin/archive.c:48:15: warning: incompatible integer to pointer
 conversion initializing 'const char *' with an expression of type 'int'
 [-Wint-conversion]
                 const char *format =
 archive_format_from_filename(name_hint);
                             ^
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 builtin/archive.c:101:2: error: implicit declaration of function
 'init_archivers' is invalid in C99 [-Werror,-Wimplicit-function-
 declaration]
         init_archivers();
         ^
 builtin/archive.c:111:9: error: implicit declaration of function
 'write_archive' is invalid in C99 [-Werror,-Wimplicit-function-
 declaration]
         return write_archive(argc, argv, prefix, the_repository, output,
 0);
                ^
 builtin/archive.c:111:9: note: did you mean 'write_or_die'?
         die(_("git archive: Remote with no URL"));
 }}}

 In turns out that this is because `builtin/archive.c` includes the line
 `#include "archive.h"` expecting to get the `archive.h` file from the root
 of the git tree. However, the CFLAGS place `/opt/local/include` at the
 front of the include list, and libarchive supplies
 `/opt/local/include/archive.h`, which overrides git's included
 `archive.h`, leading to these errors.

 The solution is to `port deactivate libarchive`, upgrade/install git, and
 then re-activate libarchive.

 This was a problem with all git 2.29 versions (I haven't been able to
 update since  git
 @2.28.0_1+credential_osxkeychain+diff_highlight+pcre+perl5_28).

-- 
Ticket URL: <https://trac.macports.org/ticket/61628>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list