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

[gtk3 3.3.2] Install error on Windows 10 #1271

Closed
Mazwak opened this issue Feb 5, 2019 · 17 comments
Closed

[gtk3 3.3.2] Install error on Windows 10 #1271

Mazwak opened this issue Feb 5, 2019 · 17 comments

Comments

@Mazwak
Copy link

Mazwak commented Feb 5, 2019

Similar to #1247, if not identical, but on ruby 2.6.1.

I tried to update pkg-config, but it didn't change anything.

Windows 10 (1709) 64b
ruby 2.6.1p33 from ruby installer

PS C:\Users\…> gem install gtk3                                                                                                    
Temporarily enhancing PATH for MSYS/MINGW with correct environment…                                                                       
Installing required msys2 packages: mingw-w64-x86_64-glib2                                                                                
> pacman -S --needed --noconfirm mingw-w64-x86_64-glib2                                                                                   
avertissement : mingw-w64-x86_64-glib2-2.58.3-1 est à jour -- ignoré                                                                      
Building native extensions. This could take a while...                                                                                    
ERROR:  Error installing gtk3:                                                                                                            
        ERROR: Failed to build gem native extension.                                                                                      
                                                                                                                                          
    current directory: C:/…/Ruby26/lib/ruby/gems/2.6.0/gems/glib2-3.3.2/ext/glib2                                                     
C:/…/Ruby26/bin/ruby.exe -I C:/anses/Ruby26/lib/ruby/site_ruby/2.6.0 -r ./siteconf20190205-20308-1r5ncu8.rb extconf.rb                
checking for --enable-debug-build option... no                                                                                            
checking for -Wall option to compiler... yes                                                                                              
checking for -Waggregate-return option to compiler... yes                                                                                 
checking for -Wcast-align option to compiler... yes                                                                                       
checking for -Wextra option to compiler... no                                                                                             
checking for -Wformat=2 option to compiler... yes                                                                                         
checking for -Winit-self option to compiler... yes                                                                                        
checking for -Wlarger-than-65500 option to compiler... yes                                                                                
checking for -Wmissing-declarations option to compiler... yes                                                                             
checking for -Wmissing-format-attribute option to compiler... yes                                                                         
checking for -Wmissing-include-dirs option to compiler... yes                                                                             
checking for -Wmissing-noreturn option to compiler... yes                                                                                 
checking for -Wmissing-prototypes option to compiler... yes                                                                               
checking for -Wnested-externs option to compiler... no                                                                                    
checking for -Wold-style-definition option to compiler... yes                                                                             
checking for -Wpacked option to compiler... yes                                                                                           
checking for -Wp,-D_FORTIFY_SOURCE=2 option to compiler... yes                                                                            
checking for -Wpointer-arith option to compiler... yes                                                                                    
checking for -Wswitch-default option to compiler... yes                                                                                   
checking for -Wswitch-enum option to compiler... yes                                                                                      
checking for -Wundef option to compiler... yes                                                                                            
checking for -Wout-of-line-declaration option to compiler... no                                                                           
checking for -Wunsafe-loop-optimizations option to compiler... yes                                                                        
checking for -Wwrite-strings option to compiler... yes                                                                                    
checking for Windows... yes                                                                                                               
checking for gobject-2.0 version (>= 2.12.0)... no                                                                                        
installing 'mingw-w64-x86_64-glib2' native package... succeeded                                                                           
checking for gobject-2.0 version (>= 2.12.0)... no                                                                                        
*** 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:/…/Ruby26/bin/$(RUBY_BASE_NAME)                                                                                      
        --enable-debug-build                                                                                                              
        --disable-debug-build                                                                                                             
        --with-pkg-config                                                                                                                 
        --without-pkg-config                                                                                                              
        --with-override-variables                                                                                                         
        --without-override-variables                                                                                                      
                                                                                                                                          
To see why this extension failed to compile, please check the mkmf.log which can be found here:                                           
                                                                                                                                          
  C:/…/Ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/glib2-3.3.2/mkmf.log                                                   
                                                                                                                                          
extconf failed, exit code 1                                                                                                               
                                                                                                                                          
Gem files will remain installed in C:/…/Ruby26/lib/ruby/gems/2.6.0/gems/glib2-3.3.2 for inspection.                                   
Results logged to C:/…/Ruby26/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/glib2-3.3.2/gem_make.out                               
@Mazwak
Copy link
Author

Mazwak commented Feb 6, 2019

I'm pretty sure it is pkg-config not detecting my msys2 correctly.

I use the official MSYS2 installer, as I want to test ruby 2.4/2.5/2.6.
I do not install it in the default location.

pkg-config only search default locations, and fails.
It then proceeds to check gobject-2.0, instead of glib2.

@kou
Copy link
Member

kou commented Feb 6, 2019

Could you show your paths?

@Mazwak
Copy link
Author

Mazwak commented Feb 6, 2019

On windows, if ruby_installer is available, the path should be available with :
RubyInstaller::Runtime::Msys2Installation.new.msys_path

@Mazwak
Copy link
Author

Mazwak commented Feb 6, 2019

On my system, I have :
C:\tools\ruby24
C:\tools\ruby25
C:\tools\ruby26
C:\tools\msys64

@kou
Copy link
Member

kou commented Feb 6, 2019

Thanks.

@Mazwak
Copy link
Author

Mazwak commented Feb 7, 2019

For the time being, I just created a symlink, but it would be nice if it is fixed in the next release, or the one after.

@kou
Copy link
Member

kou commented Feb 9, 2019

Could you try pkg-config 1.3.3?

@Mazwak
Copy link
Author

Mazwak commented Feb 18, 2019

Short answer: It does not work.

Long answer:

I still needed the symlink for the compilation to success.
Here are the steps I tried:

  • Pkg-config is 1.3.2
  • Delete msys symlink
  • gem install glib2 => configure error
  • update pkg-config to 1.3.3
  • gem install glib2 => compilation error [1]
  • Symlink msys
  • gem install glib2 => compilation ok.

[1]

compiling rbglib_bookmarkfile.c
In file included from rbgobject.h:27,
                 from rbgprivate.h:32,
                 from rbglib_bookmarkfile.c:22:
rbglib_bookmarkfile.c: In function 'Init_glib_bookmark_file':
rbglib_bookmarkfile.c:506:35: error: 'G_TYPE_BOOKMARK_FILE_ERROR' undeclared (first use in this function); did you mean 'G_BOOKMARK_FILE_ERROR'?
                 rb_eRuntimeError, G_TYPE_BOOKMARK_FILE_ERROR);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
rbglib.h:154:56: note: in definition of macro 'G_DEF_ERROR'
     rbgerr_define_gerror(domain, name, module, parent, gtype)
                                                        ^~~~~
rbglib_bookmarkfile.c:506:35: note: each undeclared identifier is reported only once for each function it appears in
                 rb_eRuntimeError, G_TYPE_BOOKMARK_FILE_ERROR);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
rbglib.h:154:56: note: in definition of macro 'G_DEF_ERROR'
     rbgerr_define_gerror(domain, name, module, parent, gtype)
                                                        ^~~~~
make: *** [Makefile:244: rbglib_bookmarkfile.o] Error 1

make failed, exit code 2

@kou
Copy link
Member

kou commented Feb 18, 2019

We stepped forward. :-)
The problem is the same problem of #1274. And it has been fixed by pkg-config 1.3.4.

@Mazwak
Copy link
Author

Mazwak commented Feb 19, 2019

I get the same error with pkg-config 1.3.4.

@Mazwak
Copy link
Author

Mazwak commented Feb 19, 2019

I replaced all your path detection in pkg-config with:

prefix = ENV["RI_DEVKIT"].gsub('\\', '/')

and it compiled fine.

As almost all ruby installation on windows will use ruby installer, I think that should be fine.

@kou
Copy link
Member

kou commented Feb 19, 2019

Could you show the output of the following script?

require "pkg-config"
require "pp"

p RUBY_PLATFORM
p PKGConfig::VERSION
pp RbConfig::CONFIG
p PKGConfig.cflags_only_I("gobject-2.0")

@Mazwak
Copy link
Author

Mazwak commented Feb 19, 2019

"x64-mingw32"
"1.3.4"
{"DESTDIR"=>"C:",
"MAJOR"=>"2",
"MINOR"=>"6",
"TEENY"=>"1",
"PATCHLEVEL"=>"33",
"INSTALL"=>"/usr/bin/install -c",
"EXEEXT"=>".exe",
"prefix"=>"C:/tools/Ruby26",
"ruby_install_name"=>"ruby",
"RUBY_INSTALL_NAME"=>"ruby",
"RUBY_SO_NAME"=>"x64-msvcrt-ruby260",
"exec"=>"exec",
"ruby_pc"=>"ruby-2.6.pc",
"CC_WRAPPER"=>"",
"PACKAGE"=>"ruby",
"BUILTIN_TRANSSRCS"=>" enc/trans/newline.c",
"MANTYPE"=>"doc",
"vendorarchhdrdir"=>
"C:/tools/Ruby26/include/ruby-2.6.0/vendor_ruby/x64-msvcrt",
"sitearchhdrdir"=>"C:/tools/Ruby26/include/ruby-2.6.0/site_ruby/x64-msvcrt",
"rubyarchhdrdir"=>"C:/tools/Ruby26/include/ruby-2.6.0/x64-mingw32",
"vendorhdrdir"=>"C:/tools/Ruby26/include/ruby-2.6.0/vendor_ruby",
"sitehdrdir"=>"C:/tools/Ruby26/include/ruby-2.6.0/site_ruby",
"rubyhdrdir"=>"C:/tools/Ruby26/include/ruby-2.6.0",
"RUBY_SEARCH_PATH"=>"",
"UNIVERSAL_INTS"=>"",
"UNIVERSAL_ARCHNAMES"=>"",
"configure_args"=>
" '--prefix=/mingw64' '--build=x86_64-w64-mingw32' '--host=x86_64-w64-mingw32' '--target=x86_64-w64-mingw32' '--without-ext=pty,syslog' 'LDFLAGS=-pipe -s' 'build_alias=x86_64-w64-mingw32' 'host_alias=x86_64-w64-mingw32' 'target_alias=x86_64-w64-mingw32' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe' 'CPPFLAGS=-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048' 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe'",
"CONFIGURE"=>"configure",
"vendorarchdir"=>"C:/tools/Ruby26/lib/ruby/vendor_ruby/2.6.0/x64-msvcrt",
"vendorlibdir"=>"C:/tools/Ruby26/lib/ruby/vendor_ruby/2.6.0",
"vendordir"=>"C:/tools/Ruby26/lib/ruby/vendor_ruby",
"sitearchdir"=>"C:/tools/Ruby26/lib/ruby/site_ruby/2.6.0/x64-msvcrt",
"sitelibdir"=>"C:/tools/Ruby26/lib/ruby/site_ruby/2.6.0",
"sitedir"=>"C:/tools/Ruby26/lib/ruby/site_ruby",
"rubyarchdir"=>"C:/tools/Ruby26/lib/ruby/2.6.0/x64-mingw32",
"rubylibdir"=>"C:/tools/Ruby26/lib/ruby/2.6.0",
"ruby_version"=>"2.6.0",
"sitearch"=>"x64-msvcrt",
"arch"=>"x64-mingw32",
"sitearchincludedir"=>"C:/tools/Ruby26/include/x64-msvcrt",
"archincludedir"=>"C:/tools/Ruby26/include/x64-mingw32",
"sitearchlibdir"=>"C:/tools/Ruby26/lib/x64-msvcrt",
"archlibdir"=>"C:/tools/Ruby26/lib/x64-mingw32",
"libdirname"=>"libdir",
"RUBY_EXEC_PREFIX"=>"",
"RUBY_LIB_VERSION"=>"",
"RUBY_LIB_VERSION_STYLE"=>"3\t/* full */",
"RI_BASE_NAME"=>"ri",
"ridir"=>"C:/tools/Ruby26/share/ri",
"rubysitearchprefix"=>"C:/tools/Ruby26/lib/ruby/x64-msvcrt",
"rubyarchprefix"=>"C:/tools/Ruby26/lib/ruby/x64-mingw32",
"MAKEFILES"=>"Makefile GNUmakefile",
"PLATFORM_DIR"=>"win32",
"THREAD_MODEL"=>"win32",
"SYMBOL_PREFIX"=>"",
"EXPORT_PREFIX"=>" ",
"COMMON_HEADERS"=>"winsock2.h windows.h",
"COMMON_MACROS"=>"",
"COMMON_LIBS"=>"m",
"MAINLIBS"=>"-lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi ",
"ENABLE_SHARED"=>"yes",
"DLDSHARED"=>"x86_64-w64-mingw32-gcc -shared",
"DLDLIBS"=>"",
"SOLIBS"=>"-lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi ",
"LIBRUBYARG_SHARED"=>"-lx64-msvcrt-ruby260",
"LIBRUBYARG_STATIC"=>
"-lx64-msvcrt-ruby260-static -lgmp -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi ",
"LIBRUBYARG"=>"-lx64-msvcrt-ruby260",
"LIBRUBY"=>"libx64-msvcrt-ruby260.dll.a",
"LIBRUBY_ALIASES"=>"",
"LIBRUBY_SONAME"=>"libx64-msvcrt-ruby260.dll.2.6",
"LIBRUBY_SO"=>"x64-msvcrt-ruby260.dll",
"LIBRUBY_A"=>"libx64-msvcrt-ruby260-static.a",
"RUBYW_INSTALL_NAME"=>"rubyw",
"rubyw_install_name"=>"rubyw",
"EXTDLDFLAGS"=>"",
"EXTLDFLAGS"=>"-static-libgcc",
"strict_warnflags"=>"",
"warnflags"=>
"-Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable",
"debugflags"=>"-ggdb3",
"optflags"=>"-O3 -fno-omit-frame-pointer",
"NULLCMD"=>":",
"ENABLE_DEBUG_ENV"=>"",
"DLNOBJ"=>"dln.o",
"INSTALL_STATIC_LIBRARY"=>"no",
"MJIT_SUPPORT"=>"yes",
"EXECUTABLE_EXTS"=>".exe .com .cmd .bat",
"ARCHFILE"=>"",
"LIBRUBY_RELATIVE"=>"yes",
"EXTOUT"=>".ext",
"PREP"=>"miniruby.exe",
"CROSS_COMPILING"=>"no",
"TEST_RUNNABLE"=>"yes",
"rubylibprefix"=>"C:/tools/Ruby26/lib/ruby",
"setup"=>"Setup",
"ENCSTATIC"=>"",
"EXTSTATIC"=>"",
"STRIP"=>"strip",
"SOEXT"=>"dll",
"TRY_LINK"=>"",
"PRELOADENV"=>"",
"LIBPATHENV"=>"PATH",
"RPATHFLAG"=>"",
"LIBPATHFLAG"=>" -L%s",
"LINK_SO"=>"",
"ASMEXT"=>"S",
"LIBEXT"=>"a",
"DLEXT2"=>"",
"DLEXT"=>"so",
"LDSHAREDXX"=>"x86_64-w64-mingw32-g++ -shared",
"LDSHARED"=>"x86_64-w64-mingw32-gcc -shared",
"CCDLFLAGS"=>"",
"STATIC"=>"",
"ARCH_FLAG"=>"",
"DLDFLAGS"=>
"-pipe -s -Wl,--enable-auto-image-base,--enable-auto-import $(DEFFILE)",
"ALLOCA"=>"",
"MATHN"=>"yes",
"dsymutil"=>"",
"codesign"=>"",
"POSTLINK"=>":",
"WERRORFLAG"=>"-Werror",
"CHDIR"=>"cd",
"RMALL"=>"rm -fr",
"RMDIRS"=>"rmdir --ignore-fail-on-non-empty -p",
"RMDIR"=>"rmdir --ignore-fail-on-non-empty",
"CP"=>"cp",
"RM"=>"rm -f",
"PKG_CONFIG"=>"pkg-config",
"DOXYGEN"=>"",
"DOT"=>"",
"MAKEDIRS"=>"/usr/bin/mkdir -p",
"MKDIR_P"=>"/usr/bin/mkdir -p",
"INSTALL_DATA"=>"/usr/bin/install -c -m 644",
"INSTALL_SCRIPT"=>"/usr/bin/install -c",
"INSTALL_PROGRAM"=>"/usr/bin/install -c",
"SET_MAKE"=>"",
"LN_S"=>"cp -pR",
"NM"=>"nm",
"DLLWRAP"=>"dllwrap",
"WINDRES"=>"windres",
"OBJCOPY"=>":",
"OBJDUMP"=>"objdump",
"ASFLAGS"=>"",
"AS"=>"as",
"ARFLAGS"=>"rcD ",
"AR"=>"ar",
"RANLIB"=>"ranlib",
"try_header"=>"",
"CC_VERSION_MESSAGE"=>
"x86_64-w64-mingw32-gcc.exe (Rev1, Built by MSYS2 project) 8.2.1 20181214\n" +
"Copyright (C) 2018 Free Software Foundation, Inc.\n" +
"This is free software; see the source for copying conditions. There is NO\n" +
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
"CC_VERSION"=>"x86_64-w64-mingw32-gcc --version",
"CSRCFLAG"=>"",
"COUTFLAG"=>"-o ",
"OUTFLAG"=>"-o ",
"CPPOUTFILE"=>"-o conftest.i",
"GNU_LD"=>"yes",
"LD"=>"ld",
"GCC"=>"yes",
"EGREP"=>"/usr/bin/grep -E",
"GREP"=>"/usr/bin/grep",
"CPP"=>"x86_64-w64-mingw32-gcc -E",
"CXXFLAGS"=>"-march=x86-64 -mtune=generic -O2 -pipe",
"CXX"=>"x86_64-w64-mingw32-g++",
"OBJEXT"=>"o",
"CPPFLAGS"=>
"-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 ",
"LDFLAGS"=>"-L. -pipe -s",
"CFLAGS"=>"-march=x86-64 -mtune=generic -O2 -pipe",
"CC"=>"x86_64-w64-mingw32-gcc",
"target_os"=>"mingw32",
"target_vendor"=>"w64",
"target_cpu"=>"x64",
"target"=>"x86_64-w64-mingw32",
"host_os"=>"mingw32",
"host_vendor"=>"w64",
"host_cpu"=>"x86_64",
"host"=>"x86_64-w64-mingw32",
"RUBY_VERSION_NAME"=>"ruby-2.6.0",
"RUBYW_BASE_NAME"=>"rubyw",
"RUBY_BASE_NAME"=>"ruby",
"build_os"=>"mingw32",
"build_vendor"=>"w64",
"build_cpu"=>"x86_64",
"build"=>"x86_64-w64-mingw32",
"RUBY_API_VERSION"=>"2.6",
"RUBY_PROGRAM_VERSION"=>"2.6.1",
"HAVE_GIT"=>"yes",
"GIT"=>"git",
"cxxflags"=>
"-O3 -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable",
"cppflags"=>"",
"cflags"=>
"-O3 -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable",
"target_alias"=>"x86_64-w64-mingw32",
"host_alias"=>"x86_64-w64-mingw32",
"build_alias"=>"x86_64-w64-mingw32",
"LIBS"=>"-lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi ",
"ECHO_T"=>"",
"ECHO_N"=>"-n",
"ECHO_C"=>"",
"DEFS"=>"-D_FILE_OFFSET_BITS=64",
"mandir"=>"C:/tools/Ruby26/share/man",
"localedir"=>"C:/tools/Ruby26/share/locale",
"libdir"=>"C:/tools/Ruby26/lib",
"psdir"=>"C:/tools/Ruby26/share/doc/ruby",
"pdfdir"=>"C:/tools/Ruby26/share/doc/ruby",
"dvidir"=>"C:/tools/Ruby26/share/doc/ruby",
"htmldir"=>"C:/tools/Ruby26/share/doc/ruby",
"infodir"=>"C:/tools/Ruby26/share/info",
"docdir"=>"C:/tools/Ruby26/share/doc/ruby",
"oldincludedir"=>"/usr/include",
"includedir"=>"C:/tools/Ruby26/include",
"localstatedir"=>"C:/tools/Ruby26/var",
"sharedstatedir"=>"C:/tools/Ruby26/com",
"sysconfdir"=>"",
"datadir"=>"C:/tools/Ruby26/share",
"datarootdir"=>"C:/tools/Ruby26/share",
"libexecdir"=>"C:/tools/Ruby26/libexec",
"sbindir"=>"C:/tools/Ruby26/sbin",
"bindir"=>"C:/tools/Ruby26/bin",
"exec_prefix"=>"C:/tools/Ruby26",
"PACKAGE_URL"=>"",
"PACKAGE_BUGREPORT"=>"",
"PACKAGE_STRING"=>"",
"PACKAGE_VERSION"=>"",
"PACKAGE_TARNAME"=>"",
"PACKAGE_NAME"=>"",
"PATH_SEPARATOR"=>":",
"SHELL"=>"/bin/sh",
"UNICODE_VERSION"=>"11.0.0",
"UNICODE_EMOJI_VERSION"=>"11.0",
"archdir"=>"C:/tools/Ruby26/lib/ruby/2.6.0/x64-mingw32",
"topdir"=>"C:/tools/Ruby26/lib/ruby/2.6.0/x64-mingw32"}
Traceback (most recent call last):
5: from ./test_gtk.rb:7:in <main>' 4: from C:/tools/Ruby26/lib/ruby/gems/2.6.0/gems/pkg-config-1.3.4/lib/pkg-config.rb:483:in cflags_only_I'
3: from C:/tools/Ruby26/lib/ruby/gems/2.6.0/gems/pkg-config-1.3.4/lib/pkg-config.rb:152:in cflags_only_I' 2: from C:/tools/Ruby26/lib/ruby/gems/2.6.0/gems/pkg-config-1.3.4/lib/pkg-config.rb:212:in collect_cflags'
1: from C:/tools/Ruby26/lib/ruby/gems/2.6.0/gems/pkg-config-1.3.4/lib/pkg-config.rb:198:in declaration' C:/tools/Ruby26/lib/ruby/gems/2.6.0/gems/pkg-config-1.3.4/lib/pkg-config.rb:307:in parse_pc': .pc for gobject-2.0 doesn't exist. (RuntimeError)

@Mazwak
Copy link
Author

Mazwak commented Feb 19, 2019

this script seems to work better:

require "pkg-config"
require "pp"
require "ruby_installer"

RubyInstaller::Runtime::Msys2Installation.new().with_msys_apps_enabled do
    p RUBY_PLATFORM
    p PKGConfig::VERSION
    pp RbConfig::CONFIG
    p PKGConfig.cflags_only_I("gobject-2.0")
end

with_msys.txt

@kou
Copy link
Member

kou commented Mar 8, 2019

Thanks.
Could you try pkg-config 1.3.5?

@Mazwak
Copy link
Author

Mazwak commented Mar 11, 2019

Compilation works.

Your little script does not.

That's because you do not use RubyInstaller in your script.
RI does change the path before compilation.

Anyway, it does fix my bug, as pkgconfig will always be called with RI pulled in before compilation.

@kou
Copy link
Member

kou commented Mar 11, 2019

Ah, sorry. I wanted you to try gem install gtk3 not #1271 (comment) .
So "compilation works" is what I expect.

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