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

Unable to install gem because of dependency #376

Closed
3 of 4 tasks
InigoGutierrez opened this issue Mar 28, 2023 · 6 comments
Closed
3 of 4 tasks

Unable to install gem because of dependency #376

InigoGutierrez opened this issue Mar 28, 2023 · 6 comments
Labels

Comments

@InigoGutierrez
Copy link

InigoGutierrez commented Mar 28, 2023

Describe the bug

I am trying to install squib following the documentation: https://squib.readthedocs.io/en/v0.18.0/install.html

I am running gem install squib to do this. It depends on gobject-introspection, which depends on glib2, and it tries to install glib2-3.5.1 but this gem does not compile. The newest version on the dev branch has this dependency updated and cloning the repo and then running bundle install seems to have no dependency problem, but I don't know how to install the squib executable via source and there are no instructions on the documentation on how to do this.

To Reproduce

  1. Run gem install squib

Expected behavior

Squib installs.

Screenshots

This is the log, which I think is more appropiate here than a screenshot.

Building native extensions. This could take a while...
ERROR:  Error installing squib:
	ERROR: Failed to build gem native extension.

    current directory: /home/taamas/.local/share/gem/ruby/3.0.0/gems/glib2-3.5.1/ext/glib2
/usr/bin/ruby -I /usr/lib/ruby/3.0.0 extconf.rb
checking for --enable-debug-build option... no
checking for -Wall option to compiler... yes
checking for -Wcast-align option to compiler... yes
checking for -Wextra option to compiler... yes
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... yes
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 -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 Homebrew... no
checking for gobject-2.0 version (>= 2.12.0)... yes (2.76.1)
checking for gthread-2.0... yes (2.76.1)
checking for unistd.h... yes
checking for io.h... no
checking for rb_check_array_type() in ruby.h... yes
checking for rb_check_hash_type() in ruby.h... yes
checking for rb_exec_recursive() in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for rb_thread_call_without_gvl() in ruby.h... yes
checking for ruby_native_thread_p() in ruby.h... yes
checking for rb_thread_call_with_gvl() in ruby.h... yes
checking for rb_gc_register_mark_object() in ruby.h... yes
checking for rb_exc_new_str() in ruby.h... yes
checking for rb_enc_str_new_static() in ruby.h... yes
checking for curr_thread in ruby.h,node.h... no
checking for rb_curr_thread in ruby.h,node.h... no
creating ruby-glib2.pc
creating glib-enum-types.c
creating glib-enum-types.h
creating Makefile

current directory: /home/taamas/.local/share/gem/ruby/3.0.0/gems/glib2-3.5.1/ext/glib2
make DESTDIR\= sitearchdir\=./.gem.20230328-21706-khe2jz sitelibdir\=./.gem.20230328-21706-khe2jz clean

current directory: /home/taamas/.local/share/gem/ruby/3.0.0/gems/glib2-3.5.1/ext/glib2
make DESTDIR\= sitearchdir\=./.gem.20230328-21706-khe2jz sitelibdir\=./.gem.20230328-21706-khe2jz
compiling glib-enum-types.c
glib-enum-types.c: In function ‘g_spawn_error_get_type’:
glib-enum-types.c:652:7: warning: ‘G_SPAWN_ERROR_2BIG’ is deprecated: Use 'G_SPAWN_ERROR_TOO_BIG' instead [-Wdeprecated-declarations]
  652 |       { G_SPAWN_ERROR_2BIG, "G_SPAWN_ERROR_2BIG", "2big" },
      |       ^
In file included from /usr/include/glib-2.0/glib.h:84,
                 from /usr/include/glib-2.0/gobject/gbinding.h:30,
                 from /usr/include/glib-2.0/glib-object.h:24,
                 from rbgobject.h:24,
                 from rbgprivate.h:32,
                 from glib-enum-types.c:4:
/usr/include/glib-2.0/glib/gspawn.h:78:3: note: declared here
   78 |   G_SPAWN_ERROR_2BIG GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(G_SPAWN_ERROR_TOO_BIG) = G_SPAWN_ERROR_TOO_BIG,
      |   ^~~~~~~~~~~~~~~~~~
compiling rbglib-bytes.c
compiling rbglib-gc.c
rbglib-gc.c:69:5: warning: missing initializer for field ‘dsize’ of ‘struct <anonymous>’ [-Wmissing-field-initializers]
   69 |     },
      |     ^
In file included from /usr/include/ruby-3.0.0/ruby/internal/core.h:34,
                 from /usr/include/ruby-3.0.0/ruby/ruby.h:26,
                 from /usr/include/ruby-3.0.0/ruby.h:38,
                 from rbgobject.h:25,
                 from rbgprivate.h:32,
                 from rbglib-gc.c:21:
/usr/include/ruby-3.0.0/ruby/internal/core/rtypeddata.h:75:18: note: ‘dsize’ declared here
   75 |         size_t (*dsize)(const void *);
      |                  ^~~~~
compiling rbglib-variant-type.c
compiling rbglib-variant.c
compiling rbglib.c
compiling rbglib_bookmarkfile.c
rbglib_bookmarkfile.c:39:1: error: static declaration of ‘g_bookmark_file_get_type’ follows non-static declaration
   39 | g_bookmark_file_get_type(void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gboxed.h:29,
                 from /usr/include/glib-2.0/gobject/gobject.h:31,
                 from /usr/include/glib-2.0/gobject/gbinding.h:31,
                 from /usr/include/glib-2.0/glib-object.h:24,
                 from rbgobject.h:24,
                 from rbgprivate.h:32,
                 from rbglib_bookmarkfile.c:22:
/usr/include/glib-2.0/gobject/glib-types.h:402:9: note: previous declaration of ‘g_bookmark_file_get_type’ with type ‘GType(void)’ {aka ‘long unsigned int(void)’}
  402 | GType   g_bookmark_file_get_type   (void) G_GNUC_CONST;
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
rbglib_bookmarkfile.c:50: warning: "G_TYPE_BOOKMARK_FILE" redefined
   50 | #define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type())
      | 
/usr/include/glib-2.0/gobject/glib-types.h:337: note: this is the location of the previous definition
  337 | #define G_TYPE_BOOKMARK_FILE (g_bookmark_file_get_type ())
      | 
make: *** [Makefile:246: rbglib_bookmarkfile.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/taamas/.local/share/gem/ruby/3.0.0/gems/glib2-3.5.1 for inspection.
Results logged to /home/taamas/.local/share/gem/ruby/3.0.0/extensions/x86_64-linux/3.0.0/glib2-3.5.1/gem_make.out

Environment

  • OS: Arch Linux
  • Ruby version: 3.0.5p211

Additional context

I don't think there is any more relevant content. I am just trying to install the program.

Check the following:

  • I have updated Squib to the latest version. (I can't even install it)
  • I have checked the Squib issues backlog for something similar
  • I have attempted to make a minimal script demonstrating my problem (gem install squib)
  • I have reviewed the Squib Docs and there's still a problem
@andymeneely
Copy link
Owner

I'm looking into this - I've noticed something similar before but I haven't found the pattern. Might be a Ruby 3.0 thing. Have you tried upgrading Ruby?

@andymeneely
Copy link
Owner

@InigoGutierrez Ok it looks like they've fixed their dependency issues since last I checked. Could you do a gem install --prerelease and let me know how it goes? Should install v0.19.0b.

If that doesn't work, do gem uninstall squib gobject-introspection and try again.

@InigoGutierrez
Copy link
Author

I can't update ruby since I depend on the Arch Linux repositories.

By gem install -- prerelease I get you mean gem install squib -- prerelease? The first one fails and asks to provide at least one gem. Either before or after gem uninstall squib gobject-introspection (which only uninstalls gobject-introspection since I don't have squib), the result is the same as before without the prerelease flag, save for these differences, which don't seem relevant:

1c1,2
< Building native extensions. This could take a while...
---
> Building native extensions with: 'prerelease'
> This could take a while...
6c7
< /usr/bin/ruby -I /usr/lib/ruby/3.0.0 extconf.rb
---
> /usr/bin/ruby -I /usr/lib/ruby/3.0.0 extconf.rb prerelease
51c52
< make DESTDIR\= sitearchdir\=./.gem.20230328-21706-khe2jz sitelibdir\=./.gem.20230328-21706-khe2jz clean
---
> make DESTDIR\= sitearchdir\=./.gem.20230407-5316-4a1fw3 sitelibdir\=./.gem.20230407-5316-4a1fw3 clean
54c55
< make DESTDIR\= sitearchdir\=./.gem.20230328-21706-khe2jz sitelibdir\=./.gem.20230328-21706-khe2jz
---
> make DESTDIR\= sitearchdir\=./.gem.20230407-5316-4a1fw3 sitelibdir\=./.gem.20230407-5316-4a1fw3
102c103
<       |
---
>       |
105c106
<       |
---
>       |

Nonetheless, thank you for your time. I will check again once the ruby package at the Arch Linux repositories is updated. I also was able to install the squib library from source, so even if I don't have the executable I at least can run ruby code using it if I specify the local squib installation as a dependency for bundle. I haven't developed anything with ruby before but at least this solution allows making cards. Cool project you have here!

@andymeneely
Copy link
Owner

Ah, I meant gem install squib --prerelease, or gem install squib --version 0.19.0b would be equivalent. I believe it's not an Arch linux thing - I was able to reproduce it on my mac.

@InigoGutierrez
Copy link
Author

😲🤦🤦 That actually worked! I didn't know you could install a newer version of a gem with that. Since I see -- and prerelease in different lines in your previous comment, I thought it was gem install squib -- prerelease, separating prerelease from the arguments by -- as some programs do (like git), and not with --prerelease as a flag, which should have been obvious. My mistake!

So in summary, gem install squib --prerelease is a solution for the broken dependency problem. Thanks!

@andymeneely
Copy link
Owner

The --prerelease thing is my way of having you be a beta tester for my fix - I'm going to put out an official release (v0.19) now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants