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

Installation on Linux with Ruby version 2.3.8 fails #11

Open
zinga666 opened this issue Jul 22, 2020 · 1 comment
Open

Installation on Linux with Ruby version 2.3.8 fails #11

zinga666 opened this issue Jul 22, 2020 · 1 comment

Comments

@zinga666
Copy link

Hi,

I need to install the keyring Gem on a Linux Machine running Ruby 2.3.8 but it fails with

$ gem install keyring
Fetching corefoundation-0.2.0.gem
Fetching keyring-0.4.1.gem
Fetching ffi-1.13.1.gem
Fetching ruby-keychain-0.3.2.gem
Fetching slop-3.6.0.gem
Building native extensions. This could take a while...
Successfully installed ffi-1.13.1
Successfully installed corefoundation-0.2.0
Successfully installed ruby-keychain-0.3.2
Successfully installed slop-3.6.0
Building native extensions. This could take a while...
ERROR:  Error installing keyring:
    ERROR: Failed to build gem native extension.

    current directory: /home/zinga/.rvm/gems/ruby-2.3.8@keyring-test/gems/keyring-0.4.1/ext
/usr/share/rvm/rubies/ruby-2.3.8/bin/ruby mkrf_conf.rb
*linux: installing gir_ffi-gnome_keyring...

rake failed, exit code 1

Gem files will remain installed in /home/zinga/.rvm/gems/ruby-2.3.8@keyring-test/gems/keyring-0.4.1 for inspection.
Results logged to /home/zinga/.rvm/gems/ruby-2.3.8@keyring-test/extensions/x86_64-linux/2.3.0/keyring-0.4.1/gem_make.out

This is because

  • the gir_ffi-gnome_keyring dependency with version constraint ~> 0.0.3 is
  • currently resolved to gir_ffi-gnome_keyring version 0.0.11 which in turn
  • requires gir_ffi version ~> 0.15.1 which
  • requires Ruby version >= 2.5

So, the installation of the gir_ffi-gnome_keyring dependency fails and thus the installation of keyring itself too.

Notes:

  • I am aware that Ruby 2.3.8 is EOL but I'd expect that an install of a Gem which worked "yesterday" on a machine should work "today" as well (when using the exact same version).
  • The versioning policy of gir_ffi-gnome_keyring to me seems to be a bit "loose" here and I filed a bug for that as well.

In general in the past (with other Gems) I was able to resolve such problems by installing a version of the problematic dependency which fulfilled the version constraint and worked on my platform. When installing the Gem then the dependency was already satisfied and the gem install worked.

With keyring this doesn't work though because it manages the dependency by itself via the extension build mechanism (instead of letting it be resolved by the gem tool) and that kind of forces an installation of the most recent version of the dependency (which satisfies the version constraint).

To make dependency handling of keyring conform a bit more to the "normal behaviour" it could install the dependency/ies only if necessary, like the gem install command with --conservative option, i.e. do something like

name, version = ["gir_ffi-gnome_keyring", '~> 0.0.3']
inst.install name, version if Gem::Dependency.new(name, version).matching_specs.empty?

i.e. install the dependency only if there is none (satisfying the version constraint) already.

Then my workaround with "nailing down" certain dependency versions would work and installation of keyring on older Ruby versions (2.3, 2.4) would work again too.

@mvz
Copy link

mvz commented Jul 22, 2020

I don't see gir_ffi-gnome_keyring being installed in the logging. Instead ruby-keyring is installed. See #9

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