Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extconf.rb doesn't find libgit2 from GNU Guix #955

Open
Apteryks opened this issue Mar 20, 2023 · 2 comments
Open

extconf.rb doesn't find libgit2 from GNU Guix #955

Apteryks opened this issue Mar 20, 2023 · 2 comments

Comments

@Apteryks
Copy link

Hello!

Based on my understanding of:

dir_config('git2').any? or pkg_config('libgit2')
, it should find the libgit2 prefix (LIBGIT2_DIR) using either a --with-git2-dir=$my-prefix passed to gem install, or automatically via pkg-config.

Neither works on my system, so I had to resort to manually patching LIBGIT2_DIR. pkg-config is available in the build environment and:

$ pkg-config --cflags libgit2
-I/gnu/store/agd3gdj1nhpq4w1hyfnhya66m9qlqfdk-libgit2-1.5.1/include -I/gnu/store/aj9iv9xfxb8bj8rg0r7v65xjh1skyb5k-openssl-1.1.1t/include -I/gnu/store/mqz2h2v1i7lx555yaz89sqd06kpgdr62-pcre2-10.37/include -I/gnu/store/v8d7j5i02nfz951x1szbl9xrd873vc3l-zlib-1.2.12/include

$ find /gnu/store/agd3gdj1nhpq4w1hyfnhya66m9qlqfdk-libgit2-1.5.1 -name version.h
/gnu/store/agd3gdj1nhpq4w1hyfnhya66m9qlqfdk-libgit2-1.5.1/include/git2/version.h

Thanks!

@chrschmidt
Copy link

I am new to ruby, and actually just want to package this like the original poster, but from reading the sources of the two functions, neither dir_config nor pkg_config will set up anything but variables that will later be written to the Makefile.
Further more, while there is a check for pkg-config on the else half of the function, there is no check on the --use-system-libraries side.

I think what this code does, is extract the version of libgit2 that is bundled with rugged, and then check that the system libgit2 matches.

If the libgit2 tree has not been checked out it fails, despite the tree being used for nothing but extracting the major and minor version from version.h.

While I understand that it is inconvenient to have to update the version in extconf.rb manually, downloading an incomplete release (as the git submodule is missing), and then having to add the source from git just to compile against system libgit2 in the end, is also not a structurally sound path.

@chrschmidt
Copy link

$ pkg-config --cflags libgit2
-I/gnu/store/agd3gdj1nhpq4w1hyfnhya66m9qlqfdk-libgit2-1.5.1/include -I/gnu/store/aj9iv9xfxb8bj8rg0r7v65xjh1skyb5k-openssl-1.1.1t/include -I/gnu/store/mqz2h2v1i7lx555yaz89sqd06kpgdr62-pcre2-10.37/include -I/gnu/store/v8d7j5i02nfz951x1szbl9xrd873vc3l-zlib-1.2.12/include

I'd also like to point out to you that the check would fail on your system, because rugged is developed against libgit2 head (no specific commit IDs are set anywhere that I could find), and thus seems to require 1.6.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants