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

JRuby 1.7: Argument list not fully preserved when inproc=true #4305

Closed
olleolleolle opened this issue Nov 16, 2016 · 2 comments
Closed

JRuby 1.7: Argument list not fully preserved when inproc=true #4305

olleolleolle opened this issue Nov 16, 2016 · 2 comments
Milestone

Comments

@olleolleolle
Copy link
Member

olleolleolle commented Nov 16, 2016

Environment

  • JRuby version 1.7.26 with JRUBY_OPTS="-J-Djruby.launch.inproc=true"
  • OS X, Linux
  • use jruby-1.7.26
  • with in a inproc=true
  • call a subshell with system(cmd_string_here)
  • and have it take a --pattern arg with a glob-expanding argument, like *.exe
  • That last argument will be eaten

Background & observations:

  • Using rspec's Rake task to have a subshell open gives this stacktrace
  • This has no problems in 9.1.6.0

Two small programs collaborate to show output

#!/usr/bin/env ruby
#
# sys.rb
#
puts "SYS"
p ARGV

#
cmd='ruby reader.rb --pattern \*.rb' # ["--pattern", "*.rb"]
cmd='ruby reader.rb --pattern *.rb' # ["--pattern", "reader.rb", "sys.rb"]
cmd='ruby reader.rb --pattern {.rb' # ["--pattern"]
cmd='ruby reader.rb --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb' # ["--pattern"]

cmd='ruby reader.rb --pattern /\*.rb' # ["--pattern"] <- enebo's minimization

system(cmd)

and reader.rb:

#!/usr/bin/env ruby
puts 'READER'
p ARGV

Expected:

JRUBY_OPTS="-J-Djruby.launch.inproc=false" ruby sys.rb
SYS
[]
READER
["--pattern", "spec/**/*_spec.rb", "spec/**/*/**/*_spec.rb"]

Actual

RUBY_OPTS="-J-Djruby.launch.inproc=true" ruby sys.rb
SYS
[]
READER
["--pattern"]
@kares kares added this to the JRuby 1.7.27 milestone Dec 30, 2016
@headius
Copy link
Member

headius commented Mar 15, 2017

I suspect that 9k is not actually observing the inproc flag, which is probably why it's working there.

I would also be surprised if this is a recent regression.

@enebo enebo modified the milestones: Won't Fix, JRuby 1.7.27 Apr 24, 2017
@enebo
Copy link
Member

enebo commented Apr 24, 2017

1.7.x will be EOL after 1.7.28 and no one has stepped up to solve this.

@enebo enebo closed this as completed Apr 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants