libgit2-glib fails to compile on Ubuntu 14.04 64-bit
Submitted by imp..@..il.com
Link to original bug (#730688)
Description
Created attachment 277116 relevant project file and copy of relevant system headers
Basically, one of the functions has one too few arguments passed. Here's all the noise make
spewed out (username modded out):
make all-recursive
make[1]: Entering directory /home/foo/cmp/libgit2-glib' Making all in libgit2-glib make[2]: Entering directory
/home/foo/cmp/libgit2-glib/libgit2-glib'
GEN ggit-enum-types.c
/usr/bin/glib-mkenums: ggit-types.h:894: Failed to parse GGIT_STATUS_OPTION_INCLUDE_UNTRACKED | ' GEN ggit-enum-types.h /usr/bin/glib-mkenums: ggit-types.h:894: Failed to parse
GGIT_STATUS_OPTION_INCLUDE_UNTRACKED | '
make all-am
make[3]: Entering directory /home/foo/cmp/libgit2-glib/libgit2-glib' CC ggit-enum-types.lo CC ggit-blame.lo CC ggit-blame-options.lo CC ggit-blob.lo CC ggit-blob-output-stream.lo CC ggit-branch.lo ggit-branch.c: In function 'ggit_branch_move': ggit-branch.c:104:25: error: too few arguments to function 'git_branch_move' force ? 1 : 0); ^ In file included from /usr/local/include/git2.h:14:0, from ../libgit2-glib/ggit-ref.h:25, from ggit-branch.h:24, from ggit-branch.c:21: /usr/local/include/git2/branch.h:132:17: note: declared here GIT_EXTERN(int) git_branch_move( ^ make[3]: *** [ggit-branch.lo] Error 1 make[3]: Leaving directory
/home/foo/cmp/libgit2-glib/libgit2-glib'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/foo/cmp/libgit2-glib/libgit2-glib' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/home/foo/cmp/libgit2-glib'
make: *** [all] Error 2
All the dependencies are met for this to compile.
I did find that, for some reason, the prototype for the function in question this seems to be this, according to the system header:
GIT_EXTERN(int) git_branch_move( git_reference **out, git_reference *branch, const char *new_branch_name, int force, const git_signature *signature, const char *log_message);
I went to patch that function call by adding two NULL
arguments to the call, but then wound up with a far less trivial compiler fail, make output here:
make all-recursive
make[1]: Entering directory /home/foo/cmp/libgit2-glib' Making all in libgit2-glib make[2]: Entering directory
/home/foo/cmp/libgit2-glib/libgit2-glib'
make all-am
make[3]: Entering directory /home/foo/cmp/libgit2-glib/libgit2-glib' CC ggit-branch.lo CC ggit-branch-enumerator.lo CC ggit-clone-options.lo CC ggit-commit.lo CC ggit-config.lo ggit-config.c: In function 'ggit_config_find_global': ggit-config.c:182:2: warning: passing argument 1 of 'git_config_find_global' from incompatible pointer type [enabled by default] if (git_config_find_global (path, GIT_PATH_MAX) != GIT_OK) ^ In file included from /usr/local/include/git2.h:21:0, from ggit-config.h:26, from ggit-config.c:21: /usr/local/include/git2/config.h:97:17: note: expected 'struct git_buf *' but argument is of type 'gchar *' GIT_EXTERN(int) git_config_find_global(git_buf *out); ^ ggit-config.c:182:2: error: too many arguments to function 'git_config_find_global' if (git_config_find_global (path, GIT_PATH_MAX) != GIT_OK) ^ In file included from /usr/local/include/git2.h:21:0, from ggit-config.h:26, from ggit-config.c:21: /usr/local/include/git2/config.h:97:17: note: declared here GIT_EXTERN(int) git_config_find_global(git_buf *out); ^ ggit-config.c: In function 'ggit_config_find_system': ggit-config.c:211:2: warning: passing argument 1 of 'git_config_find_system' from incompatible pointer type [enabled by default] if (git_config_find_system (path, GIT_PATH_MAX) != GIT_OK) ^ In file included from /usr/local/include/git2.h:21:0, from ggit-config.h:26, from ggit-config.c:21: /usr/local/include/git2/config.h:126:17: note: expected 'struct git_buf *' but argument is of type 'gchar *' GIT_EXTERN(int) git_config_find_system(git_buf *out); ^ ggit-config.c:211:2: error: too many arguments to function 'git_config_find_system' if (git_config_find_system (path, GIT_PATH_MAX) != GIT_OK) ^ In file included from /usr/local/include/git2.h:21:0, from ggit-config.h:26, from ggit-config.c:21: /usr/local/include/git2/config.h:126:17: note: declared here GIT_EXTERN(int) git_config_find_system(git_buf *out); ^ make[3]: *** [ggit-config.lo] Error 1 make[3]: Leaving directory
/home/foo/cmp/libgit2-glib/libgit2-glib'
make[2]: *** [all] Error 2
make[2]: Leaving directory /home/foo/cmp/libgit2-glib/libgit2-glib' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/home/foo/cmp/libgit2-glib'
make: *** [all] Error 2
The prototype for the git_buf struct in the system header is here:
typedef struct { char *ptr; size_t asize, size; } git_buf;
I'm going to attach a tarball of the system headers and the concerned file here.
Attachment 277116, "relevant project file and copy of relevant system headers":
code-and-sys-headers.tar.bz2
Version: git master
Resolution: RESOLVED FIXED