https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112021-10-23T06:03:22ZRuby Issue Tracking SystemRuby master - Bug #18263: "make install" crashed when Ruby3.0.2 clean install. (in japanese)https://bugs.ruby-lang.org/issues/18263?journal_id=942642021-10-23T06:03:22Zxtkoba (Tee KOBAYASHI)
<ul></ul><p>From <code>LOG.make</code>:</p>
<pre><code>compiling ../.././ext/psych/yaml/api.c
../.././ext/psych/yaml/api.c: 関数 ‘yaml_strdup’ 内:
../.././ext/psych/yaml/api.c:66:27: 警告: implicit declaration of function ‘strdup’; did you mean ‘cmp’? [-Wimplicit-function-declaration]
return (yaml_char_t *)strdup((char *)str);
^~~~~~
strcmp
../.././ext/psych/yaml/api.c:66:12: 警告: 異なるサイズの整数からポインタへのキャストです [-Wint-to-pointer-cast]
return (yaml_char_t *)strdup((char *)str);
^
</code></pre>
<p>The compiler assumes that <code>strdup(3)</code> is implicitly declared as <code>int strdup();</code>, which is of course not correct and should be instead as follows:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="kt">char</span> <span class="o">*</span><span class="nf">strdup</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">);</span>
</code></pre>
<p>I have no idea as to why <code>strdup(3)</code> is not declared here. For instance, on my GNU/Linux environment it is declared in <code><string.h></code> which is included (indirectly) in <code>ext/psych/yaml/api.c</code>.</p>
<p>A workaround would be to add the correct declaration in <code>ext/psych/yaml/api.c</code>.</p> Ruby master - Bug #18263: "make install" crashed when Ruby3.0.2 clean install. (in japanese)https://bugs.ruby-lang.org/issues/18263?journal_id=942722021-10-24T08:54:46Zxtkoba (Tee KOBAYASHI)
<ul></ul><p>Gotcha.</p>
<pre><code> CFLAGS = -std=c99 -pedantic -Wall
</code></pre>
<p><code>strdup(3)</code> is not declared because of <code>-std=c99</code>. Try instead with <code>-std=gnu99</code>. You can alternatively append <code>-D_DEFAULT_SOURCE</code> to make it declared.</p>
<p>You may also have an option to install <code>libyaml-devel</code> distributed by CentOS to avoid building libyaml which is bundled in a Ruby source tarball.</p> Ruby master - Bug #18263: "make install" crashed when Ruby3.0.2 clean install. (in japanese)https://bugs.ruby-lang.org/issues/18263?journal_id=942732021-10-24T14:42:39Ztksotn (TAKASHI OOTANI)
<ul></ul><p>Thank you xtkoba san.</p>
<p>After "dnf install libyaml-devel", "make install" and "make check" now completed without crash.<br>
and "gem list" etc. also completed normally.</p>
<p>"make check" still has some errors,</p>
<blockquote>
<p>Finished tests in 2156.244216s, 9.7883 tests/s, 1238.1214 assertions/s.<br>
21106 tests, 2669692 assertions, 188 failures, 14 errors, 52 skips</p>
</blockquote>
<p>but for the time being, the troubles have been resolved.</p>
<p>thank you very much.</p> Ruby master - Bug #18263: "make install" crashed when Ruby3.0.2 clean install. (in japanese)https://bugs.ruby-lang.org/issues/18263?journal_id=943142021-10-25T18:27:53Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Third Party's Issue</i></li></ul><p>It looks like this may be an issue with the embedded version of libyaml that Ruby ships. If so, it should be fixed upstream in libyaml (<a href="https://github.com/yaml/libyaml" class="external">https://github.com/yaml/libyaml</a>), and then a pull request or issue should be filed to <a href="https://github.com/ruby/psych" class="external">https://github.com/ruby/psych</a> to update the embedded copy.</p>