Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ec486f9e3757
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b239bfd63c40
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 25, 2016

  1. Copy the full SHA
    bc93a63 View commit details
  2. Copy the full SHA
    b239bfd View commit details
Showing with 31 additions and 42 deletions.
  1. +30 −28 lib/ruby/truffle/truffle/bundler-workarounds.rb
  2. +0 −12 truffle/src/main/java/org/jruby/truffle/core/VMPrimitiveNodes.java
  3. +1 −2 truffle/src/main/ruby/core/process.rb
58 changes: 30 additions & 28 deletions lib/ruby/truffle/truffle/bundler-workarounds.rb
Original file line number Diff line number Diff line change
@@ -616,38 +616,40 @@ def build_extensions

puts "==========================================" if $VERBOSE

native_extensions = <<-HEREDOC
if bundler_loaded
native_extensions = <<-HEREDOC
==========================================
Workaround: Do not setup signal traps
Error: Some signals are not recognized
HEREDOC
puts native_extensions if $VERBOSE
HEREDOC
puts native_extensions if $VERBOSE

require 'bundler/cli'
require 'bundler/cli/exec'

require 'bundler/cli'
require 'bundler/cli/exec'

module Bundler
class CLI::Exec
def kernel_load(file, *args)
args.pop if args.last.is_a?(Hash)
ARGV.replace(args)
$0 = file
Process.setproctitle(process_title(file, args)) if Process.respond_to?(:setproctitle)
ui = Bundler.ui
Bundler.ui = nil
require "bundler/setup"
signals = Signal.list.keys - RESERVED_SIGNALS
# signals.each {|s| trap(s, "DEFAULT") } Commented out
Kernel.load(file)
rescue SystemExit
raise
rescue Exception => e # rubocop:disable Lint/RescueException
Bundler.ui = ui
Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
backtrace = e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) }
abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
module Bundler
class CLI::Exec
def kernel_load(file, *args)
args.pop if args.last.is_a?(Hash)
ARGV.replace(args)
$0 = file
Process.setproctitle(process_title(file, args)) if Process.respond_to?(:setproctitle)
ui = Bundler.ui
Bundler.ui = nil
require "bundler/setup"
signals = Signal.list.keys - RESERVED_SIGNALS
# signals.each {|s| trap(s, "DEFAULT") } Commented out
Kernel.load(file)
rescue SystemExit
raise
rescue Exception => e # rubocop:disable Lint/RescueException
Bundler.ui = ui
Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
backtrace = e.backtrace.take_while { |bt| !bt.start_with?(__FILE__) }
abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
end
end
end
end

puts "==========================================" if $VERBOSE
puts "==========================================" if $VERBOSE
end
12 changes: 0 additions & 12 deletions truffle/src/main/java/org/jruby/truffle/core/VMPrimitiveNodes.java
Original file line number Diff line number Diff line change
@@ -590,16 +590,4 @@ public DynamicObject setClass(DynamicObject object, DynamicObject newClass) {

}

@Primitive(name = "vm_set_process_title", needsSelf = false)
public abstract static class VMSetProcessTitlePrimitiveNode extends PrimitiveArrayArgumentsNode {

@Specialization(guards = "isRubyString(title)")
public DynamicObject setClass(DynamicObject title) {
// no-op
return title;
}

}


}
3 changes: 1 addition & 2 deletions truffle/src/main/ruby/core/process.rb
Original file line number Diff line number Diff line change
@@ -126,8 +126,7 @@ def self.cpu_times
#
def self.setproctitle(title)
val = Rubinius::Type.coerce_to(title, String, :to_str)

Truffle.invoke_primitive(:vm_set_process_title, val)
$0 = val
end

def self.setrlimit(resource, cur_limit, max_limit=undefined)