Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Universal gems do not match x64-mingw32 platform #3066

Closed
joshcooper opened this issue Jun 14, 2014 · 2 comments
Closed

Universal gems do not match x64-mingw32 platform #3066

joshcooper opened this issue Jun 14, 2014 · 2 comments

Comments

@joshcooper
Copy link

I have a Gemfile:

source "https://rubygems.org"
gem 'windows-api'

Currently, windows-api is at version 0.4.2. It has a dependency on win32-api.

In ruby 1.9.3p374, bundler successfully resolves the most recent version of the gem, which happens to be win32-api-1.5.1-universal-mingw32, containing precompiled binaries for both x86 and x64.

C:\work\foo>bundle install --path .bundle
...
Activated:
  windows-api (0.4.2)
Requirements:
  win32-api (>= 1.4.5) x86-mingw32
Attempting:
  win32-api (>= 1.4.5) x86-mingw32
  Activating: win32-api (1.5.1)
    * windows-api (>= 0)
    * win32-api (>= 1.4.5)
    Dependencies

Installing win32-api 1.5.1
Installing windows-api 0.4.2
Using bundler 1.6.2

However, on ruby 2.0.0p481 x64, the universal gem does not match, and bundler falls back to win32-api-1.4.8, which is a ruby version that requires the DevKit to be installed to compile the native extension.

C:\work\foo>ruby --version
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
C:\work\foo>gem --version
2.0.14
C:\work\foo>bundle --version
Bundler version 1.6.2
C:\work\foo>bundle install --path .bundle
...
Activated:
  windows-api (0.4.2)
Requirements:
  win32-api (>= 1.4.5) x64-mingw32
Attempting:
  win32-api (>= 1.4.5) x64-mingw32
  Activating: win32-api (1.4.8)
    * windows-api (>= 0)
    * win32-api (>= 1.4.5)
    Dependencies

Gem::InstallError: The 'win32-api' native gem requires installed build tools.

However, gem install windows-api on ruby 2.0.0 x64 correctly pulls in the win32-api-1.5.1-universal-mingw32 gem as expected:

C:\work\foo>ruby --version
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
C:\work\foo>gem install windows-api
Fetching: win32-api-1.5.1-universal-mingw32.gem (100%)
Successfully installed win32-api-1.5.1-universal-mingw32
Fetching: windows-api-0.4.2.gem (100%)
Successfully installed windows-api-0.4.2

There seems to be an issue with how bundler compares the current x64-mingw32 platform against possible matches. I would expect it to prefer an exact match, e.g. x64-mingw32, but fall back to universal-mingw32 before trying earlier versions.

@indirect
Copy link
Member

I think universal gems are a new thing that isn’t explicitly supported by Bundler yet. If you understand how they are supposed to be supported, a patch would be fantastic. If not, we’ll try to get this working soon. Thanks for letting us know!

On Jun 13, 2014, at 11:07 PM, Josh Cooper [email protected] wrote:

I have a Gemfile:

source "https://rubygems.org"
gem 'windows-api'
Currently, windows-api is at version 0.4.2. It has a dependency on win32-api.

In ruby 1.9.3p374, bundler successfully resolves the most recent version of the gem, which happens to be win32-api-1.5.1-universal-mingw32, containing precompiled binaries for both x86 and x64.

C:\work\foo>bundle install --path .bundle
...
Activated:
windows-api (0.4.2)
Requirements:
win32-api (>= 1.4.5) x86-mingw32
Attempting:
win32-api (>= 1.4.5) x86-mingw32
Activating: win32-api (1.5.1)
* windows-api (>= 0)
* win32-api (>= 1.4.5)
Dependencies

Installing win32-api 1.5.1
Installing windows-api 0.4.2
Using bundler 1.6.2
However, on ruby 2.0.0p481 x64, the universal gem does not match, and bundler falls back to win32-api-1.4.8, which is a ruby version that requires the DevKit to be installed to compile the native extension.

C:\work\foo>ruby --version
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
C:\work\foo>gem --version
2.0.14
C:\work\foo>bundle --version
Bundler version 1.6.2
C:\work\foo>bundle install --path .bundle
...
Activated:
windows-api (0.4.2)
Requirements:
win32-api (>= 1.4.5) x64-mingw32
Attempting:
win32-api (>= 1.4.5) x64-mingw32
Activating: win32-api (1.4.8)
* windows-api (>= 0)
* win32-api (>= 1.4.5)
Dependencies

Gem::InstallError: The 'win32-api' native gem requires installed build tools.
However, gem install windows-api on ruby 2.0.0 x64 correctly pulls in the win32-api-1.5.1-universal-mingw32 gem as expected:

C:\work\foo>ruby --version
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
C:\work\foo>gem install windows-api
Fetching: win32-api-1.5.1-universal-mingw32.gem (100%)
Successfully installed win32-api-1.5.1-universal-mingw32
Fetching: windows-api-0.4.2.gem (100%)
Successfully installed windows-api-0.4.2
There seems to be an issue with how bundler compares the current x64-mingw32 platform against possible matches. I would expect it to prefer an exact match, e.g. x64-mingw32, but fall back to universal-mingw32 before trying earlier versions.


Reply to this email directly or view it on GitHub.

@indirect
Copy link
Member

This is fixed in 1.9.3

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

Successfully merging a pull request may close this issue.

2 participants