From: andreas.baumgaertner@... Date: 2015-02-28T17:44:23+00:00 Subject: [ruby-core:68355] [Ruby trunk - Bug #10919] [Open] [gem install] installs multipe platforms Issue #10919 has been reported by Andreas Baumgaertner. ---------------------------------------- Bug #10919: [gem install] installs multipe platforms https://bugs.ruby-lang.org/issues/10919 * Author: Andreas Baumgaertner * Status: Open * Priority: Normal * Assignee: Eric Hodel * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49761) [x64-mingw32] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- Natively build a gem - just an example mysql2 on windows x64-mingw32 I could only get the gem to compile with devkit when --platform=ruby is specified - so my understanding is that all devkit compiled gems are platform ruby, even if devkit platform is acutally x64-mingw32 ~~~ C:\apps\redmine_dev\bin>gem install mysql2 --no-document --platform=ruby -- "--with-mysql-dir=c:/apps/redmine_dev/mysql-5.6.23-winx64" Fetching: mysql2-0.3.18.gem (100%) Temporarily enhancing PATH to include DevKit... Building native extensions with: '--with-mysql-dir=c:/apps/redmine_dev/mysql-5.6.23-winx64' This could take a while... Successfully installed mysql2-0.3.18 1 gem installed ~~~ here comes the acutal issue: rerun (also with other dependency managers e.g. bundle install) installs dupplicate gem for platform x64-mingw32 ~~~ C:\apps\redmine_dev\bin>gem install mysql2 Fetching: mysql2-0.3.18-x64-mingw32.gem (100%) ====================================================================================================== \ You've installed the binary version of mysql2. It was built using MySQL Connector/C version 6.1.5. It's recommended to use the exact same version to avoid potential issues. At the time of building this gem, the necessary DLL files were retrieved from: http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.5-winx64.zip \ This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README. ====================================================================================================== Successfully installed mysql2-0.3.18-x64-mingw32 Parsing documentation for mysql2-0.3.18-x64-mingw32 Installing ri documentation for mysql2-0.3.18-x64-mingw32 Done installing documentation for mysql2 after 0 seconds 1 gem installed ~~~ what is the point in installing a gem for two platforms? it is also not supported by require to specify a platform. solution a: gem install should not install an additional platform, if the gem is already present gem list should always display the platform (not only if there are more than 1) solution b: add an option to gem install that forces devkit build for specific platform so gem install will recognize that the platform is already present. ~~~ C:\apps\redmine_dev\bin>gem list *** LOCAL GEMS *** bundler (1.8.3) mysql2 (0.3.18 ruby x64-mingw32) ~~~ ~~~ C:\apps\redmine_dev\bin>gem env RubyGems Environment: - RUBYGEMS VERSION: 2.4.5 - RUBY VERSION: 2.2.1 (2015-02-26 patchlevel 85) [x64-mingw32] - INSTALLATION DIRECTORY: C:/apps/redmine_dev/ruby/lib/ruby/gems/2.2.0 - RUBY EXECUTABLE: C:/apps/redmine_dev/ruby/bin/ruby.exe - EXECUTABLE DIRECTORY: C:/apps/redmine_dev/ruby/bin - SPEC CACHE DIRECTORY: C:/Users/abaumgaertner/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData - RUBYGEMS PLATFORMS: - ruby - x64-mingw32 - GEM PATHS: - C:/apps/redmine_dev/ruby/lib/ruby/gems/2.2.0 - C:/Users/abaumgaertner/.gem/ruby/2.2.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - C:\apps\redmine_dev\ruby\bin - C:\apps\redmine_dev\libs - C:\apps\redmine_dev\ImageMagick - D:\apps\mercurial_dev - d:\msys64\mingw64\bin - d:\msys64\mingw64\lib - d:\msys64\usr\bin - C:\Windows\system32 - C:\Windows - C:\Windows\System32\Wbem - C:\Windows\System32\WindowsPowerShell\v1.0\ ~~~ -- https://bugs.ruby-lang.org/