[Bug 214009] devel/git: build fails with DEVELOPER=yes

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Nov 2 12:38:53 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214009

            Bug ID: 214009
           Summary: devel/git: build fails with DEVELOPER=yes
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: garga at FreeBSD.org
          Reporter: z7dr6ut7gs at snkmail.com
             Flags: maintainer-feedback?(garga at FreeBSD.org)
          Assignee: garga at FreeBSD.org

If you build devel/git with DEVELOPER=yes, you will get a failure due to
-Werror (added in work/git-2.10.1/Makefile when DEVELOPER=yes).  Here's a
snippet from a build on 10-stable/amd64:

cc -o t/helper/test-path-utils.o -c -MF t/helper/.depend/test-path-utils.o.d
-MQ t/helper/test-path-utils.o -MMD -MP -isystem/usr/local/include
-DLIBICONV_PLUG -O2 -pipe  -DLIBICONV_PLUG -fstack-protector
-fno-strict-aliasing -Werror -Wdeclaration-after-statement
-Wno-format-zero-length -Wold-style-definition -Woverflow -Wpointer-arith
-Wstrict-prototypes -Wunused -Wvla -I. -I/usr/local/include -DUSE_LIBPCRE
-I/usr/local/include -DUSE_CURL_FOR_IMAP_SEND -I/usr/local/include
-DUSE_ST_TIMESPEC -pthread -DHAVE_PATHS_H -DHAVE_STRINGS_H
-DGMTIME_UNRELIABLE_ERRORS -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC
-DHAVE_BSD_SYSCTL -DHAVE_GETDELIM -DSHA1_HEADER='<openssl/sha.h>' 
-DFREAD_READS_DIRECTORIES -DDIR_HAS_BSD_GROUP_SEMANTICS
-DSHELL_PATH='"/bin/sh"' -DPAGER_ENV='"LESS=FRX LV=-c MORE=FRX"' 
t/helper/test-path-utils.c
t/helper/test-path-utils.c:254:39: error: incompatible pointer types passing
'char *(const char *)' to
      parameter of type 'char *(*)(char *)'
[-Werror,-Wincompatible-pointer-types]
                return test_function(basename_data, basename, argv[1]);
                                                    ^~~~~~~~
t/helper/test-path-utils.c:41:58: note: passing argument to parameter 'func'
here
static int test_function(struct test_data *data, char *(*func)(char *input),
                                                         ^
t/helper/test-path-utils.c:257:38: error: incompatible pointer types passing
'char *(const char *)' to
      parameter of type 'char *(*)(char *)'
[-Werror,-Wincompatible-pointer-types]
                return test_function(dirname_data, dirname, argv[1]);
                                                   ^~~~~~~
t/helper/test-path-utils.c:41:58: note: passing argument to parameter 'func'
here
static int test_function(struct test_data *data, char *(*func)(char *input),
                                                         ^
2 errors generated.
gmake[2]: *** [Makefile:1982: t/helper/test-path-utils.o] Error 1


Similar results on 9-stable (using default base gcc).

git-2.10.1/Makefile has:

ifdef DEVELOPER
CFLAGS += $(DEVELOPER_CFLAGS)
endif


The problem with test-path-utils.c is real - it expects basename(3) to be take
a 'char *' argument rather than 'const char *'.  That's an upstream issue,
although they would have to deal with linux having two different prototypes for
basename(3) (one with const, one without) depending on which prototype in
system header files is pulled in (string.h vs libgen.h).

This fixes it for the freebsd port:

--- work/git-2.10.1/t/helper/test-path-utils.c.orig     2016-11-02
12:23:15.000000000 +0000
+++ work/git-2.10.1/t/helper/test-path-utils.c  2016-11-02 12:23:15.000000000
+0000
@@ -38,7 +38,7 @@
        const char *alternative; /* output: ... or this.      */
 };

-static int test_function(struct test_data *data, char *(*func)(char *input),
+static int test_function(struct test_data *data, char *(*func)(const char
*input),
        const char *funcname)
 {
        int failed = 0, i;


Alternately you could comment out the DEVELOPER_CFLAGS definition in the
git-2.10.1/Makefile or something similar:

@@ -968,7 +969,7 @@
 -include config.mak

 ifdef DEVELOPER
-CFLAGS += $(XXX_DONT_USE_DEVELOPER_CFLAGS)
+CFLAGS += $(DEVELOPER_CFLAGS)
 endif

 ifndef sysconfdir



Or try to avoid passing DEVELOPER down into the port build (e.g., undefine it).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list