{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/3605","repository_url":"https://api.github.com/repos/libgit2/libgit2","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/3605/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/3605/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/3605/events","html_url":"https://github.com/libgit2/libgit2/issues/3605","id":132576032,"number":3605,"title":"How can I check if my libgit2 has been compiled with libssh2 support?","user":{"login":"ccrivelli","id":7732795,"avatar_url":"https://avatars.githubusercontent.com/u/7732795?v=3","gravatar_id":"","url":"https://api.github.com/users/ccrivelli","html_url":"https://github.com/ccrivelli","followers_url":"https://api.github.com/users/ccrivelli/followers","following_url":"https://api.github.com/users/ccrivelli/following{/other_user}","gists_url":"https://api.github.com/users/ccrivelli/gists{/gist_id}","starred_url":"https://api.github.com/users/ccrivelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccrivelli/subscriptions","organizations_url":"https://api.github.com/users/ccrivelli/orgs","repos_url":"https://api.github.com/users/ccrivelli/repos","events_url":"https://api.github.com/users/ccrivelli/events{/privacy}","received_events_url":"https://api.github.com/users/ccrivelli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-10T00:23:56Z","updated_at":"2016-02-10T00:31:07Z","closed_at":null,"body":"I'm compiling libgit2 to use it with pygit2 and salt-master.\r\nMy steps are the follwing ones:\r\n```\r\n\r\n# tar zxvf v0.23.4.tar.gz \r\n# cd libgit2-0.23.4/\r\n\r\n# cmake .\r\n-- The C compiler identification is GNU 4.8.5\r\n-- Check for working C compiler: /bin/cc\r\n-- Check for working C compiler: /bin/cc -- works\r\n-- Detecting C compiler ABI info\r\n-- Detecting C compiler ABI info - done\r\n-- Found PkgConfig: /bin/pkg-config (found version \"0.27.1\") \r\n-- checking for module 'libcurl'\r\n--   found libcurl, version 7.29.0\r\n-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version \"1.0.1e\") \r\n-- Found HTTP_Parser: /usr/include  \r\n-- Found ZLIB: /usr/lib64/libz.so (found version \"1.2.7\") \r\n-- checking for module 'libssh2'\r\n--   found libssh2, version 1.4.3\r\n-- Looking for libssh2_userauth_publickey_frommemory in ssh2\r\n-- Looking for libssh2_userauth_publickey_frommemory in ssh2 - not found\r\n-- Performing Test IS_FVISIBILITY=HIDDEN_SUPPORTED\r\n-- Performing Test IS_FVISIBILITY=HIDDEN_SUPPORTED - Success\r\n-- Performing Test IS_WDOCUMENTATION_SUPPORTED\r\n-- Performing Test IS_WDOCUMENTATION_SUPPORTED - Failed\r\n-- Performing Test IS_WNO-MISSING-FIELD-INITIALIZERS_SUPPORTED\r\n-- Performing Test IS_WNO-MISSING-FIELD-INITIALIZERS_SUPPORTED - Success\r\n-- Performing Test IS_WSTRICT-ALIASING=2_SUPPORTED\r\n-- Performing Test IS_WSTRICT-ALIASING=2_SUPPORTED - Success\r\n-- Performing Test IS_WSTRICT-PROTOTYPES_SUPPORTED\r\n-- Performing Test IS_WSTRICT-PROTOTYPES_SUPPORTED - Success\r\n-- Performing Test IS_WDECLARATION-AFTER-STATEMENT_SUPPORTED\r\n-- Performing Test IS_WDECLARATION-AFTER-STATEMENT_SUPPORTED - Success\r\n-- Performing Test IS_WNO-UNUSED-CONST-VARIABLE_SUPPORTED\r\n-- Performing Test IS_WNO-UNUSED-CONST-VARIABLE_SUPPORTED - Failed\r\n-- Performing Test IS_WNO-UNUSED-FUNCTION_SUPPORTED\r\n-- Performing Test IS_WNO-UNUSED-FUNCTION_SUPPORTED - Success\r\n-- Looking for futimens\r\n-- Looking for futimens - found\r\n-- Looking for qsort_r\r\n-- Looking for qsort_r - found\r\n-- Looking for qsort_s\r\n-- Looking for qsort_s - not found\r\n-- Looking for include file pthread.h\r\n-- Looking for include file pthread.h - found\r\n-- Looking for pthread_create\r\n-- Looking for pthread_create - not found\r\n-- Looking for pthread_create in pthreads\r\n-- Looking for pthread_create in pthreads - not found\r\n-- Looking for pthread_create in pthread\r\n-- Looking for pthread_create in pthread - found\r\n-- Found Threads: TRUE  \r\n-- Looking for clock_gettime in rt\r\n-- Looking for clock_gettime in rt - found\r\n-- Found PythonInterp: /bin/python (found version \"2.7.5\") \r\n-- Configuring done\r\n-- Generating done\r\n-- Build files have been written to: /opt/libgit2-0.23.4\r\n\r\n\r\n# make\r\n# make install\r\n[ 22%] Built target git2\r\n[100%] Built target libgit2_clar\r\nInstall the project...\r\n-- Install configuration: \"Debug\"\r\n-- Installing: /usr/local/lib/libgit2.so.0.23.4\r\n-- Installing: /usr/local/lib/libgit2.so.23\r\n-- Installing: /usr/local/lib/libgit2.so\r\n-- Installing: /usr/local/lib/pkgconfig/libgit2.pc\r\n-- Installing: /usr/local/include/git2\r\n.. etc..\r\n\r\n\r\n# pip uninstall pygit2\r\n# export LDFLAGS=\"-Wl,-rpath='/usr/local/lib',--enable-new-dtags $LDFLAGS\"\r\n# pip install pygit2 --upgrade\r\n\r\n(check versions)\r\n# python\r\nPython 2.7.5 (default, Nov 20 2015, 02:00:19) \r\n[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import pygit2\r\n>>> pygit2.__version__\r\n'0.23.3'\r\n>>> pygit2.LIBGIT2_VERSION\r\n'0.23.4'\r\n\r\n\r\n\r\n(then I test to sync the local repo using gitfs)\r\n# salt-run fileserver.update\r\n[ERROR   ] Unable to fetch SSH-based gitfs remote 'git@github.com/myrepo.git'. libgit2 must be compiled with libssh2 to support SSH authentication.\r\nTrue\r\n\r\n```\r\n\r\nAs I still don't understand if it could be a libgit2 issue or a pygit2 issue or a salt-master one,\r\nhow can I be sure that libgit2 has been compiled with libssh2 support?\r\n\r\nIn my cmake step I see:\r\n\r\n```\r\n-- checking for module 'libssh2'\r\n--   found libssh2, version 1.4.3\r\n-- Looking for libssh2_userauth_publickey_frommemory in ssh2\r\n-- Looking for libssh2_userauth_publickey_frommemory in ssh2 - not found\r\n\r\n```\r\n\r\nand libssh headers are already installed (it's a Centos7 box):\r\n\r\n```\r\n# rpm -qa | grep libssh2\r\nlibssh2-devel-1.4.3-10.el7.x86_64\r\nlibssh2-1.4.3-10.el7.x86_64\r\n\r\n```\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/182147202","html_url":"https://github.com/libgit2/libgit2/issues/3605#issuecomment-182147202","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/3605","id":182147202,"user":{"login":"ethomson","id":1130014,"avatar_url":"https://avatars.githubusercontent.com/u/1130014?v=3","gravatar_id":"","url":"https://api.github.com/users/ethomson","html_url":"https://github.com/ethomson","followers_url":"https://api.github.com/users/ethomson/followers","following_url":"https://api.github.com/users/ethomson/following{/other_user}","gists_url":"https://api.github.com/users/ethomson/gists{/gist_id}","starred_url":"https://api.github.com/users/ethomson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethomson/subscriptions","organizations_url":"https://api.github.com/users/ethomson/orgs","repos_url":"https://api.github.com/users/ethomson/repos","events_url":"https://api.github.com/users/ethomson/events{/privacy}","received_events_url":"https://api.github.com/users/ethomson/received_events","type":"User","site_admin":true},"created_at":"2016-02-10T00:31:06Z","updated_at":"2016-02-10T00:31:06Z","body":"I think that the relevant line here is:\r\n> `-- Looking for libssh2_userauth_publickey_frommemory in ssh2 - not found`\r\n\r\nThat function is required for support and ssh support is not available without a version of libssh2 that supports that.  Thus, you need to upgrade to a newer libssh2 that includes that function - it was added three years ago, roughly, and I'm surprised that your distribution does not support that.  [Version 1.4.3 is over three years old now](http://www.libssh2.org/changes.html), so I suspect that if you upgrade you will have more success."}}