https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112022-01-31T16:19:55ZRuby Issue Tracking SystemRuby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=962972022-01-31T16:19:55Zpeterzhu2118 (Peter Zhu)peter@peterzhu.ca
<ul></ul><p>I think this is expected. <code>GC.compact</code>, <code>GC.auto_compact=</code>, <code>GC.verify_compaction_references</code> will raise <code>NotImplementedError</code> when compaction is not supported on the platform.</p>
<p><code>GC.respond_to?(:compact)</code> is just to check that the method <code>GC.compact</code> exists (this method was added in Ruby 2.7).</p> Ruby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=962982022-01-31T16:38:20Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p><a class="user active user-mention" href="https://bugs.ruby-lang.org/users/42491">@peterzhu2118 (Peter Zhu)</a> JFYI: If the method body is <code>rb_f_notimplement</code>, <code>Kernel#respond_to?</code> returns false.</p>
<p>For example, <code>Kernel#fork</code> is defined as such in Windows. <a href="https://github.com/ruby/ruby/blob/605f226142a47c4f9e4cc88717c5d6170bc3d7f1/process.c#L4431" class="external">https://github.com/ruby/ruby/blob/605f226142a47c4f9e4cc88717c5d6170bc3d7f1/process.c#L4431</a></p>
<pre><code>PS C:\> ruby -ve 'p respond_to?(:fork); fork'
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
false
-e:1:in `fork': fork() function is unimplemented on this machine (NotImplementedError)
from -e:1:in `<main>'
</code></pre>
<p>However, I think it is currently impossible to define such a method in Ruby code, i.e., <code>gc.rb</code>. I have no opinion whether it is worth putting effort on this.</p> Ruby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=963142022-02-01T17:27:04Zvo.x (Vit Ondruch)v.ondruch@tiscali.cz
<ul></ul><p>Thx for the clarification. For now, I have reported the original issue to the PG upstream [1]. Keeping this open should there be a chance to follow the <code>fork</code> example.</p>
<p>[1] <a href="https://github.com/ged/ruby-pg/issues/423" class="external">https://github.com/ged/ruby-pg/issues/423</a></p> Ruby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=963222022-02-01T21:27:49ZEregon (Benoit Daloze)
<ul></ul><p>FWIW, TruffleRuby has <code>Primitive.method_unimplement</code> specifically to achieve to achieve the same as <code>rb_f_notimplement</code> but in Ruby code.<br>
Example usage: <a href="https://github.com/oracle/truffleruby/blob/4eddae9d18137567beb25e6e4ef2c932fa9de7ab/src/main/ruby/truffleruby/core/kernel.rb#L759" class="external">https://github.com/oracle/truffleruby/blob/4eddae9d18137567beb25e6e4ef2c932fa9de7ab/src/main/ruby/truffleruby/core/kernel.rb#L759</a></p> Ruby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=975332022-05-09T08:56:18Zjaruga (Jun Aruga)
<ul></ul><p>I remember the Ruby disabled GC compaction on platforms that can't support it, on <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: TestGCCompact#test_ast_compacts test failing again (Closed)" href="https://bugs.ruby-lang.org/issues/17871">#17871</a> .</p> Ruby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=977542022-05-25T20:00:29ZEregon (Benoit Daloze)
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/18779">Bug #18779</a>: `GC.compact` and other compaction related methods should be defined as rb_f_notimplement on non supported platforms. </i> added</li></ul> Ruby master - Bug #18560: "Compaction isn't available on this platform" error running PG test suite on ppc64lehttps://bugs.ruby-lang.org/issues/18560?journal_id=977552022-05-25T20:00:51ZEregon (Benoit Daloze)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>This seems the same as <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: `GC.compact` and other compaction related methods should be defined as rb_f_notimplement on non s... (Closed)" href="https://bugs.ruby-lang.org/issues/18779">#18779</a>, which just got fixed.</p>