Windows + libssh2 not usable
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.3k
- Forks
- 293
- PR merge metrics
- No merged PRs in 30d
Description
The current solution to pkg-config isn't workable if you need Windows + libssh2 + rugged:
$ pkg-config --libs --static C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\rugged-0.24.0b11\vendor\libgit2\build\libgit2.pc
-LC:/Program -LC:/Ruby22-x64/DevKit-mingw64-64-4.7.2/lib Files (x86)/libgit2/lib -lgit2 -lssh2 -lws2_32 -lbcrypt -lcrypt32
But the hardcoded list of libs going into $LIBS doesn't include -lssh2 so the build fails spectacularly:
linking shared-object rugged/rugged.so
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rugged-0.24.0b11/ext/rugged/../../vendor/libgit2/build/libgit2.a(ssh.c.obj): In function `ssh_error':
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rugged-0.24.0b11/vendor/libgit2/src/transports/ssh.c:51: undefined reference to `libssh2_session_last_error'
// ... You get the idea...
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rugged-0.24.0b11/ext/rugged/../../vendor/libgit2/build/libgit2.a(ssh.c.obj): In function `list_auth_methods':
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rugged-0.24.0b11/vendor/libgit2/src/transports/ssh.c:759: undefined reference to `libssh2_userauth_authenticated'
collect2.exe: error: ld returned 1 exit status
make: *** [rugged.so] Error 1
The solution seems to be using pkg-config. If someone's compiled libssh2 then installing pkg-config from http://sourceforge.net/projects/pkgconfiglite/files/ is pretty easy. I'm just not quite sure how to work around not having pkg-config. Perhaps a bit more smarts to make pkg-config an optional dependency on Windows?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names the Windows extension build, the hardcoded $LIBS list, and the pkg-config invocation; start by reproducing the libssh2 link failure and tracing how those libraries are selected. Done means a Windows rugged build links libssh2 successfully, with clear behavior when pkg-config is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, ruby
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100