Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.4.16 needs a java gem release for JRuby #125

Closed
flavorjones opened this issue Jan 11, 2020 · 4 comments
Closed

v1.4.16 needs a java gem release for JRuby #125

flavorjones opened this issue Jan 11, 2020 · 4 comments

Comments

@flavorjones
Copy link
Collaborator

See previous instance of this problem at #103 for v1.4.15

@flavorjones
Copy link
Collaborator Author

The error message I see when I try to install v1.4.16 under JRuby:

Building native extensions. This could take a while...
ERROR:  Error installing racc:
	ERROR: Failed to build gem native extension.

    current directory: /home/flavorjones/.rvm/gems/jruby-9.2.9.0/gems/racc-1.4.16/ext/racc/cparse
/home/flavorjones/.rvm/rubies/jruby-9.2.9.0/bin/jruby -r ./siteconf20200111-5290-1b2xrcs.rb extconf.rb
checking for rb_ary_subseq()... RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.

        try_do at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:456
     try_link0 at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:541
      try_link at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:556
      try_func at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:765
     have_func at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:1051
  checking_for at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:942
      postpone at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:350
          open at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:320
      postpone at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:350
          open at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:320
      postpone at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:346
  checking_for at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:941
     have_func at /home/flavorjones/.rvm/rubies/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:1050
        <main> at extconf.rb:6
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/home/flavorjones/.rvm/rubies/jruby-9.2.9.0/bin/jruby

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/flavorjones/.rvm/gems/jruby-9.2.9.0/extensions/universal-java-11/2.5.0/racc-1.4.16/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/flavorjones/.rvm/gems/jruby-9.2.9.0/gems/racc-1.4.16 for inspection.
Results logged to /home/flavorjones/.rvm/gems/jruby-9.2.9.0/extensions/universal-java-11/2.5.0/racc-1.4.16/gem_make.out

@flavorjones
Copy link
Collaborator Author

It looks like support for building a Java gem was removed in aa0e565, when Hoe was removed. One attempt to fix the JRuby build appears in 95230dd but that's not sufficient to build a java platform gem.

@flavorjones
Copy link
Collaborator Author

OK - I've locally modified the gemspec to do the right thing under JRuby, then generated a java platform gem from v1.4.16 tag (commit 04a7245), tested it and pushed it to rubygems.

patch:

diff --git a/racc.gemspec b/racc.gemspec
index 81bb6a4..19441b9 100644
--- a/racc.gemspec
+++ b/racc.gemspec
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
 
   s.executables = ["racc", "racc2y", "y2racc"]
   s.files = ["COPYING", "ChangeLog", "DEPENDS", "Manifest.txt", "README.ja.rdoc", "README.rdoc", "Rakefile", "TODO", "bin/racc", "bin/racc2y", "bin/y2racc", "ext/racc/MANIFEST", "ext/racc/com/headius/racc/Cparse.java", "ext/racc/cparse/cparse.c", "ext/racc/cparse/extconf.rb", "fastcache/extconf.rb", "fastcache/fastcache.c", "lib/racc.rb", "lib/racc/compat.rb", "lib/racc/debugflags.rb", "lib/racc/exception.rb", "lib/racc/grammar.rb", "lib/racc/grammarfileparser.rb", "lib/racc/info.rb", "lib/racc/iset.rb", "lib/racc/logfilegenerator.rb", "lib/racc/parser-text.rb", "lib/racc/parser.rb", "lib/racc/parserfilegenerator.rb", "lib/racc/pre-setup", "lib/racc/sourcetext.rb", "lib/racc/state.rb", "lib/racc/statetransitiontable.rb", "lib/racc/static.rb", "misc/dist.sh", "rdoc/en/NEWS.en.rdoc", "rdoc/en/grammar.en.rdoc", "rdoc/ja/NEWS.ja.rdoc", "rdoc/ja/command.ja.html", "rdoc/ja/debug.ja.rdoc", "rdoc/ja/grammar.ja.rdoc", "rdoc/ja/index.ja.html", "rdoc/ja/parser.ja.rdoc", "rdoc/ja/usage.ja.html", "sample/array.y", "sample/array2.y", "sample/calc-ja.y", "sample/calc.y", "sample/conflict.y", "sample/hash.y", "sample/lalr.y", "sample/lists.y", "sample/syntax.y", "sample/yyerr.y", "setup.rb", "tasks/doc.rb", "tasks/email.rb", "test/assets/cadenza.y", "test/assets/cast.y", "test/assets/chk.y", "test/assets/conf.y", "test/assets/csspool.y", "test/assets/digraph.y", "test/assets/echk.y", "test/assets/edtf.y", "test/assets/err.y", "test/assets/error_recovery.y", "test/assets/expect.y", "test/assets/firstline.y", "test/assets/huia.y", "test/assets/ichk.y", "test/assets/intp.y", "test/assets/journey.y", "test/assets/liquor.y", "test/assets/machete.y", "test/assets/macruby.y", "test/assets/mailp.y", "test/assets/mediacloth.y", "test/assets/mof.y", "test/assets/namae.y", "test/assets/nasl.y", "test/assets/newsyn.y", "test/assets/noend.y", "test/assets/nokogiri-css.y", "test/assets/nonass.y", "test/assets/normal.y", "test/assets/norule.y", "test/assets/nullbug1.y", "test/assets/nullbug2.y", "test/assets/opal.y", "test/assets/opt.y", "test/assets/percent.y", "test/assets/php_serialization.y", "test/assets/recv.y", "test/assets/riml.y", "test/assets/rrconf.y", "test/assets/ruby18.y", "test/assets/ruby19.y", "test/assets/ruby20.y", "test/assets/ruby21.y", "test/assets/ruby22.y", "test/assets/scan.y", "test/assets/syntax.y", "test/assets/tp_plus.y", "test/assets/twowaysql.y", "test/assets/unterm.y", "test/assets/useless.y", "test/assets/yyerr.y", "test/bench.y", "test/helper.rb", "test/infini.y", "test/regress/cadenza", "test/regress/cast", "test/regress/csspool", "test/regress/edtf", "test/regress/huia", "test/regress/journey", "test/regress/liquor", "test/regress/machete", "test/regress/mediacloth", "test/regress/mof", "test/regress/namae", "test/regress/nasl", "test/regress/nokogiri-css", "test/regress/opal", "test/regress/php_serialization", "test/regress/riml", "test/regress/ruby18", "test/regress/ruby22", "test/regress/tp_plus", "test/regress/twowaysql", "test/scandata/brace", "test/scandata/gvar", "test/scandata/normal", "test/scandata/percent", "test/scandata/slash", "test/src.intp", "test/start.y", "test/test_chk_y.rb", "test/test_grammar_file_parser.rb", "test/test_racc_command.rb", "test/test_scan_y.rb", "test/testscanner.rb", "web/racc.en.rhtml", "web/racc.ja.rhtml"]
-  s.extensions = ["ext/racc/cparse/extconf.rb"]
   s.rdoc_options = ["--main", "README.rdoc"]
   s.extra_rdoc_files = ["Manifest.txt", "README.ja.rdoc", "README.rdoc", "rdoc/en/NEWS.en.rdoc", "rdoc/en/grammar.en.rdoc", "rdoc/ja/NEWS.ja.rdoc", "rdoc/ja/debug.ja.rdoc", "rdoc/ja/grammar.ja.rdoc", "rdoc/ja/parser.ja.rdoc", "README.ja.rdoc", "README.rdoc"]
   s.require_paths = ["lib"]
@@ -22,5 +21,8 @@ Gem::Specification.new do |s|
 
   if RUBY_PLATFORM =~ /java/
     s.files << 'lib/racc/cparse-jruby.jar'
+    s.platform = 'java'
+  else
+    s.extensions = ["ext/racc/cparse/extconf.rb"]
   end
 end

@flavorjones
Copy link
Collaborator Author

I'll rebase this patch onto master and submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant