Skip to content

gem install psych on JRuby fails with --enable-frozen-string-literal #12

@dentarg

Description

@dentarg
$ docker run -it --rm jruby:9.4.9.0 bash
root@f2eb44db1237:/app# export RUBYOPT="--enable-frozen-string-literal --debug-frozen-string-literal"
root@f2eb44db1237:/app# gem install psych
Fetching psych-5.2.0-java.gem
  jar dependencies for psych-5.2.0-java.gemspec . . .
Installing gem 'ruby-maven' . . .
Fetching ruby-maven-3.3.13.gem
Fetching ruby-maven-libs-3.3.9.gem
Successfully installed ruby-maven-libs-3.3.9
Successfully installed ruby-maven-3.3.13

using maven for the first time results in maven
downloading all its default plugin and can take time.
as those plugins get cached on disk and further execution
of maven is much faster then the first time.

ERROR:  While executing gem ... (FrozenError)
    can't modify frozen String, created at /usr/local/bundle/gems/ruby-maven-3.3.13/lib/ruby_maven.rb:25
	org/jruby/RubyString.java:1526:in `replace'
	/usr/local/bundle/gems/ruby-maven-3.3.13/lib/ruby_maven.rb:63:in `version'
	/usr/local/bundle/gems/ruby-maven-3.3.13/lib/ruby_maven.rb:81:in `launch'
	/usr/local/bundle/gems/ruby-maven-3.3.13/lib/ruby_maven.rb:48:in `exec'
	/usr/local/bundle/gems/ruby-maven-3.3.13/lib/maven/ruby/maven.rb:112:in `exec'
	/opt/jruby/lib/ruby/stdlib/jars/maven_exec.rb:79:in `resolve_dependencies_list'
	/opt/jruby/lib/ruby/stdlib/jars/installer.rb:233:in `install_dependencies'
	/opt/jruby/lib/ruby/stdlib/jars/installer.rb:224:in `do_install'
	/opt/jruby/lib/ruby/stdlib/jars/installer.rb:170:in `vendor_jars'
	/opt/jruby/lib/ruby/stdlib/jars/post_install_hook.rb:28:in `block in <main>'
	/opt/jruby/lib/ruby/stdlib/rubygems/installer.rb:381:in `block in run_post_install_hooks'
	org/jruby/RubyArray.java:1981:in `each'
	/opt/jruby/lib/ruby/stdlib/rubygems/installer.rb:380:in `run_post_install_hooks'
	/opt/jruby/lib/ruby/stdlib/rubygems/installer.rb:345:in `install'
	/opt/jruby/lib/ruby/stdlib/rubygems/resolver/specification.rb:104:in `install'
	/opt/jruby/lib/ruby/stdlib/rubygems/request_set.rb:194:in `block in install'
	org/jruby/RubyArray.java:1981:in `each'
	/opt/jruby/lib/ruby/stdlib/rubygems/request_set.rb:182:in `install'
	/opt/jruby/lib/ruby/stdlib/rubygems/commands/install_command.rb:210:in `install_gem'
	/opt/jruby/lib/ruby/stdlib/rubygems/commands/install_command.rb:226:in `block in install_gems'
	org/jruby/RubyArray.java:1981:in `each'
	/opt/jruby/lib/ruby/stdlib/rubygems/commands/install_command.rb:219:in `install_gems'
	/opt/jruby/lib/ruby/stdlib/rubygems/commands/install_command.rb:167:in `execute'
	/opt/jruby/lib/ruby/stdlib/rubygems/command.rb:323:in `invoke_with_build_args'
	/opt/jruby/lib/ruby/stdlib/rubygems/command_manager.rb:185:in `process_args'
	/opt/jruby/lib/ruby/stdlib/rubygems/command_manager.rb:149:in `run'
	/opt/jruby/lib/ruby/stdlib/rubygems/gem_runner.rb:51:in `run'
	/opt/jruby/bin/jgem:21:in `<main>'
	org/jruby/RubyKernel.java:1223:in `load'
	/opt/jruby/bin/gem:4:in `<main>'

Something I noticed in Sinatra CI

cc @byroot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions