taskolib / libgit4cpp

C++ wrapper for libgit2 with limited functionality
https://taskolib.github.io/libgit4cpp/
GNU Lesser General Public License v2.1
1 stars 0 forks source link

Symbol missing in library #19

Closed Finii closed 3 months ago

Finii commented 5 months ago
/usr/bin/ld: /usr/lib/libgit4cpp.so: undefined reference to
  `git::branch_remote_name(git_repository*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

WAT? A symbol is missing that is referenced by libgit4cpp and has the git:: namespace, so its origin is libgit4cpp?!

$ git grep -n branch_remote_name
include/libgit4cpp/wrapper_functions.h:153:std::string branch_remote_name(git_repository* repo, const std::string& branch_name);
src/GitRepository.cc:508:    auto remote_name = branch_remote_name(repo_.get(), branch_name.c_str());
src/wrapper_functions.cc:157:        // gul14::cat("branch_remote_name: ", git_error_last()->message);
src/wrapper_functions.cc:175:// std::string branch_remote_name(git_repository* repo, const std::string& branch_name)
src/wrapper_functions.cc:178://     if (git_branch_remote_name(&buf, repo, branch_name.c_str()))
src/wrapper_functions.cc:180://         // gul14::cat("branch_remote_name: ", git_error_last()->message);

Ah, the function is declared in wrapper_functions.h line 153 but never defined, and used in GitRepository.cc line 508.

Finii commented 5 months ago

If we remove the 'b_lundef=false', # use but do not link GUL from meson.build the error becomes obvious:

image

And this goes up through all the library stack to finally the server, we always allow undef'd symbols :-o That can not be the solution.

Well, in the server it is finally a bug to allow undef'd symbols (will raise an error there).

But why not just link it? @alt-graph @wyrnat

alt-graph commented 5 months ago

But why not just link it? @alt-graph @wyrnat

I vaguely remember that you proposed that as a solution to the "diamond dependency" problem with linking GUL14:

Which brings us back to the discussion of whether we want to build all the libs and the server ourselves or if we want to put some parts into the DOOCS release.

Finii commented 5 months ago

Related to https://mcs-gitlab.desy.de/controls-and-operation/utility/taskomat/-/issues/34