Open stinky22 opened 9 years ago
This code isn't maintained, so there won't be an update from the libgit2 team, though fwiw it's finding libgit2 just fine, but the structure and the error codes mentioned in the error message have changed.
I see, thanks for the reply. Are there any active libgit2 backends for memcached/mysql/something in the wild? My brief search doesn't turn up anything.
Also, from a libgit2 team standpoint, would you discourage me from creating my own backend? If nobody is using backends my concern is that libgit2 support for backends may be spotty in future releases.
I get more or less the same error, when I try to build the memcached backend:
$ git clone --depth 1 --branch v0.26.0 https://github.com/libgit2/libgit2.git
$ cd libgit2
$ mkdir build && cd build
$ cmake ..
$ cmake --build . --target install
$ ldconfig
$ cd ..
$ git clone --depth 1 https://github.com/libgit2/libgit2-backends.git
$ cd libgit2-backends/memcached
$ mkdir build && cd build
$ cmake ../
$ cmake --build .
the last cmake fails with:
-- The C compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found libgit2: /usr/local/lib/libgit2.so
-- Found LIBMEMCACHED: /usr/lib/x86_64-linux-gnu/libmemcached.so
-- Configuring done
-- Generating done
-- Build files have been written to: /libgit2/libgit2-backends/memcached/build
Scanning dependencies of target git2-memcached
[100%] Building C object CMakeFiles/git2-memcached.dir/memcached.c.o
/libgit2/libgit2-backends/memcached/memcached.c:34:18: error: field ‘parent’ has incomplete type
git_odb_backend parent;
^
/libgit2/libgit2-backends/memcached/memcached.c: In function ‘memcached_backend__read_header’:
/libgit2/libgit2-backends/memcached/memcached.c:81:10: error: ‘GIT_ENOMEM’ undeclared (first use in this function)
return GIT_ENOMEM;
^
/libgit2/libgit2-backends/memcached/memcached.c:81:10: note: each undeclared identifier is reported only once for each function it appears in
/libgit2/libgit2-backends/memcached/memcached.c:105:12: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
status = GIT_SUCCESS;
^
/libgit2/libgit2-backends/memcached/memcached.c: In function ‘memcached_backend__read’:
/libgit2/libgit2-backends/memcached/memcached.c:130:10: error: ‘GIT_ENOMEM’ undeclared (first use in this function)
return GIT_ENOMEM;
^
/libgit2/libgit2-backends/memcached/memcached.c:155:12: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
status = GIT_SUCCESS;
^
/libgit2/libgit2-backends/memcached/memcached.c: In function ‘memcached_backend__exists’:
/libgit2/libgit2-backends/memcached/memcached.c:179:10: error: ‘GIT_ENOMEM’ undeclared (first use in this function)
return GIT_ENOMEM;
^
/libgit2/libgit2-backends/memcached/memcached.c: In function ‘memcached_backend__write’:
/libgit2/libgit2-backends/memcached/memcached.c:213:10: error: ‘GIT_ENOMEM’ undeclared (first use in this function)
return GIT_ENOMEM;
^
/libgit2/libgit2-backends/memcached/memcached.c:242:11: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
status = GIT_SUCCESS;
^
/libgit2/libgit2-backends/memcached/memcached.c: In function ‘git_odb_backend_memcached’:
/libgit2/libgit2-backends/memcached/memcached.c:271:10: error: ‘GIT_ENOMEM’ undeclared (first use in this function)
return GIT_ENOMEM;
^
/libgit2/libgit2-backends/memcached/memcached.c:296:9: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
return GIT_SUCCESS;
^
make[2]: *** [CMakeFiles/git2-memcached.dir/memcached.c.o] Error 1
CMakeFiles/git2-memcached.dir/build.make:54: recipe for target 'CMakeFiles/git2-memcached.dir/memcached.c.o' failed
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/git2-memcached.dir/all' failed
make[1]: *** [CMakeFiles/git2-memcached.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
Since pygit2 just received support for custom backends with 0.25.1 I can't imagine, that the custom back-ends are completely unused. Somebody must know something about it ;-)
These example custom backends don't get a lot of love. I'll put this on my todo list (though updating them would be rather easy for somebody interested in submitting a first-time pull request).
But these are just the examples: the custom backends are heavily used. They're relied upon in production by Visual Studio Team Services, which stores its Git repositories in a Azure Blob Storage, and by Team Foundation Server, which stores its Git repositories in SQL Server blob storage.
Custom backends are going to remain supported, period. 😀
I'm on OSX Yosemite and I can't build the memcached backend.
Here are the steps I'm executing:
Here is partial output from the build step:
It appears that the compiler can't find libgit2, but cmake seemed to find it just fine in the
cmake memcached
step.