libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

Does not build against libgit2 1.4.x releases #1127

Closed alerque closed 2 years ago

alerque commented 2 years ago

Besides the hard coded version check in src/types.h, there are some API differences that need updating. For example:

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto -fPIC -I/usr/local/include -I/usr/include/python3.10 -c build/temp.linux-x86_64-3.10/pygit2._libgit2.c -o build/temp.linux-x86_64-3.10/build/temp.linux-x86_64-3.10/pygit2._libgit2.o
build/temp.linux-x86_64-3.10/pygit2._libgit2.c: In function ‘_cffi_checkfld_typedef_git_buf’:
build/temp.linux-x86_64-3.10/pygit2._libgit2.c:1501:14: error: ‘git_buf’ has no member named ‘asize’; did you mean ‘size’?
 1501 |   (void)((p->asize) | 0);  /* check that 'git_buf.asize' is an integer */
      |              ^~~~~
      |              size
In file included from build/temp.linux-x86_64-3.10/pygit2._libgit2.c:61:
build/temp.linux-x86_64-3.10/pygit2._libgit2.c: At top level:
build/temp.linux-x86_64-3.10/pygit2._libgit2.c:12650:32: error: ‘git_buf’ has no member named ‘asize’; did you mean ‘size’?
12650 |   { "asize", offsetof(git_buf, asize),
      |                                ^~~~~
build/temp.linux-x86_64-3.10/pygit2._libgit2.c:12651:37: error: ‘git_buf’ has no member named ‘asize’; did you mean ‘size’?
12651 |              sizeof(((git_buf *)0)->asize),
      |                                     ^~~~~
      |                                     size
error: command '/usr/bin/gcc' failed with exit code 1
jdavid commented 2 years ago

This was fixed already in the master branch. Before opening an issue check with the master branch. The migration to libgit2 v1.4.0 is still work in progress, don't open an issue for that, but PRs are helpful.

alerque commented 2 years ago

This was partially fixed in the master branch, but as you state yourself this is still a work in progress.

Notably the test suite does not pass yet (2 out of 495 or something like that fail). I don't see why having an open tracking issue for an incomplete task is such a bad thing.