[gem install] installs multipe platforms
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.
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)
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\