libgit2 / libgit2/rugged

Unable to install rugged 0.25.1 on windows 10

Open
#669 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.3k
Forks
293
PR merge metrics
No merged PRs in 30d

Description

Hi. When attempting to install 0.25.1 as mentioned above, this is the result:

gem install rugged
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rugged:
        ERROR: Failed to build gem native extension.

    current directory: c:/Ruby233/lib/ruby/gems/2.3.0/gems/rugged-0.25.1/ext/rugged
c:/Ruby233/bin/ruby.exe -r ./siteconf20170118-10960-129ea6f.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "MSYS Makefiles"
 -- C:\DevKit\bin/make.exe
checking for main() in -lgit2... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/Ruby233/bin/$(RUBY_BASE_NAME)
        --use-system-libraries
        --with-git2-dir
        --without-git2-dir
        --with-git2-include
        --without-git2-include=${git2-dir}/include
        --with-git2-lib
        --without-git2-lib=${git2-dir}/lib
        --with-git2lib
        --without-git2lib
c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:320:in `open'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:320:in `open'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
        from c:/Ruby233/lib/ruby/2.3.0/mkmf.rb:992:in `have_library'
        from extconf.rb:108:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  c:/Ruby233/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/rugged-0.25.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in c:/Ruby233/lib/ruby/gems/2.3.0/gems/rugged-0.25.1 for inspection.
Results logged to c:/Ruby233/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/rugged-0.25.1/gem_make.out

I notice in mkmf.log that it manages to build git2, but then after that, ends up like this:

"gcc -o conftest.exe -Ic:/Ruby233/include/ruby-2.3.0/i386-mingw32 -Ic:/Ruby233/include/ruby-2.3.0/ruby/backward -Ic:/Ruby233/include/ruby-2.3.0 -I. -Ic:/Ruby233/lib/ruby/gems/2.3.0/gems/rugged-0.25.1/ext/rugged/../../vendor/libgit2/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  -g -O3 -Wall -Wno-comment conftest.c  -Lc:/Ruby233/lib/ruby/gems/2.3.0/gems/rugged-0.25.1/ext/rugged/../../vendor/libgit2/build -L. -Lc:/Ruby233/lib -L.  -Lc:/Ruby233/lib/ruby/gems/2.3.0/gems/rugged-0.25.1/vendor/libgit2/build/deps/winhttp     -lmsvcrt-ruby230  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi   -lwinhttp -lcrypt32 -lrpcrt4 -lole32 -lz"
c:/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lz
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

Does anyone know why it can't find -lz, have any suggestions to troubleshoot further, or know how this might be fixed? I'm happy to provide more information about my setup if necessary.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with extconf.rb:108 and the mkmf.log entry showing the linker failure, then review gem_make.out for the complete installation context. Reproduce the rugged 0.25.1 installation on Windows 10 with the reported Ruby and DevKit setup; done means the native extension builds without the missing -lz error.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.