File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
lib/truffle/rubygems/defaults Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ Bug fixes:
78
78
* Fixed linking of always-inline C API functions with ` -std=gnu90 ` (#1837 , #1879 ).
79
79
* Avoid race conditions during ` gem install ` by using a single download thread.
80
80
* ` RSTRING_PTR() ` now always returns a native pointer, resolving two bugs ` memcpy ` ing to (#1822 ) and from (#1772 ) Ruby Strings.
81
+ * Do not use gems precompiled for MRI on TruffleRuby (#1837 ).
81
82
82
83
Compatibility:
83
84
Original file line number Diff line number Diff line change @@ -16,4 +16,9 @@ module Gem
16
16
def self . default_dir
17
17
@default_dir ||= "#{ Truffle ::Boot . ruby_home or raise 'TruffleRuby home not found' } /lib/gems"
18
18
end
19
+
20
+ # Only report the RUBY platform as supported to make sure gems precompiled for MRI are not used.
21
+ # TruffleRuby has a different ABI and cannot reuse gems precompiled for MRI.
22
+ # See https://github.com/rubygems/rubygems/issues/2945
23
+ Gem . platforms = [ Gem ::Platform ::RUBY ]
19
24
end
Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. This
2
+ # code is released under a tri EPL/GPL/LGPL license. You can use it,
3
+ # redistribute it and/or modify it under the terms of the:
4
+ #
5
+ # Eclipse Public License version 2.0, or
6
+ # GNU General Public License version 2, or
7
+ # GNU Lesser General Public License version 2.1.
8
+ # OTHER DEALINGS IN THE SOFTWARE.
9
+
10
+ require_relative '../../ruby/spec_helper'
11
+ require 'rubygems'
12
+
13
+ describe "Gem.platforms" do
14
+ it "returns only [RUBY] on TruffleRuby to not use gems precompiled for MRI" do
15
+ Gem . platforms . should == [ Gem ::Platform ::RUBY ]
16
+ end
17
+ end
You can’t perform that action at this time.
0 commit comments