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

[FreeBSD 12.1] rugged.so finding libssh2.so, but not linking to it #866

Closed
rucarrol opened this issue Feb 6, 2021 · 1 comment
Closed

Comments

@rucarrol
Copy link

rucarrol commented Feb 6, 2021

Hey,

This issue seems to be similar to a previous, older issue ( #366 ).

I'm building rugged on FreeBSD12.2, in a Jail.

Initial gem install rugged fails, so I tried to debug what is happening in the directory left behind.

First, I create the Makefile with ruby extconf.rb (Full output here: https://pastebin.com/kjkxhrVP). Filtered output here:

-- Found ZLIB: /usr/lib/libz.so (found version "1.2.11") 
-- Checking for module 'libssh2'
--   Found libssh2, version 1.9.0
--   Resolved libraries: /usr/local/lib/libssh2.so
-- Looking for libssh2_userauth_publickey_frommemory in /usr/local/lib/libssh2.so
-- Looking for libssh2_userauth_publickey_frommemory in /usr/local/lib/libssh2.so - found

This looks more or less good. Next I run make (Full output: https://pastebin.com/2rjedAde ). Nothing to note here.

However when I check to see if we've resolved the functions in libssh2.so:

root@gitlab:/usr/local/lib/ruby/gems/2.7/gems/rugged-1.1.0/ext/rugged # nm rugged.so | grep libssh2_userauth_publickey_frommemory
                 U libssh2_userauth_publickey_frommemory

And from ldd libssh2.so.1:

root@gitlab:/usr/local/lib/ruby/gems/2.7/gems/rugged-1.1.0/ext/rugged # ldd /usr/local/lib/libssh2.so.1
/usr/local/lib/libssh2.so.1:
	libz.so.6 => /lib/libz.so.6 (0x8006ae000)
	libssl.so.111 => /usr/lib/libssl.so.111 (0x8006ca000)
	libcrypto.so.111 => /lib/libcrypto.so.111 (0x800e00000)
	libc.so.7 => /lib/libc.so.7 (0x80024e000)
	libthr.so.3 => /lib/libthr.so.3 (0x800762000)

root@gitlab:/usr/local/lib/ruby/gems/2.7/gems/rugged-1.1.0/ext/rugged # ls -lh /usr/local/lib/libssh2.so*
lrwxr-xr-x  1 root  wheel    16B Jan 29 17:11 /usr/local/lib/libssh2.so -> libssh2.so.1.0.1
lrwxr-xr-x  1 root  wheel    16B Jan 29 17:11 /usr/local/lib/libssh2.so.1 -> libssh2.so.1.0.1
-rwxr-xr-x  1 root  wheel   245K Jan 29 17:11 /usr/local/lib/libssh2.so.1.0.1

Full Makefile : https://pastebin.com/YGwSv7V3

And outputs form pkg-config:

root@gitlab:/usr/local/lib/ruby/gems/2.7/gems/rugged-1.1.0/ext/rugged # pkg-config --libs --static ../../vendor/libgit2/build/libgit2.pc 
-L/usr/local/lib -lgit2 -lrt -lpthread -lz -L/usr/local/lib -lssh2 -L/usr/local/lib -lssl -L/usr/local/lib -pthread -lcrypto -pthread 

I'm really unsure how to proceed with debugging this further. Would anyone be able to give me some pointers please?

@rucarrol
Copy link
Author

rucarrol commented Feb 7, 2021

After rebuilding the jail 3 times, this went away. Going to resolve this as it seems an odd transient issue.

@rucarrol rucarrol closed this as completed Feb 7, 2021
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

1 participant