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: 1bcb3dd1a546
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: adaf871f8784
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 2, 2016

  1. 1
    Copy the full SHA
    d594981 View commit details
  2. Copy the full SHA
    adaf871 View commit details
Showing with 17 additions and 49 deletions.
  1. +14 −11 lib/ruby/truffle/jruby-truffle-tool/lib/truffle/tool.rb
  2. +0 −38 lib/ruby/truffle/truffle/bundler-workarounds.rb
  3. +3 −0 truffle/src/main/ruby/core/signal.rb
25 changes: 14 additions & 11 deletions lib/ruby/truffle/jruby-truffle-tool/lib/truffle/tool.rb
Original file line number Diff line number Diff line change
@@ -246,7 +246,8 @@ module OptionBlocks
before: ['--before SH_CMD', 'Commands to execute before setup', ADD_TO_ARRAY, []],
after: ['--after SH_CMD', 'Commands to execute after setup', ADD_TO_ARRAY, []],
file: ['--file NAME,CONTENT', Array, 'Create file in truffle_bundle_path', MERGE_TO_HASH, {}],
without: ['--without GROUP', 'Do not install listed gem group by bundler', ADD_TO_ARRAY, []]
without: ['--without GROUP', 'Do not install listed gem group by bundler', ADD_TO_ARRAY, []],
bundler: ['--[no-]bundler', 'Skip bundle install step', STORE_NEW_VALUE, true]
}.merge(shared_offline_options),
run: {
help: ['-h', '--help', 'Show this message', STORE_NEW_VALUE, false],
@@ -580,16 +581,18 @@ def subcommand_setup(rest)

gemfile_use_path!(target_gem_path) if @options[:setup][:offline]

execute_cmd([JRUBY_BIN.to_s,
'-X-C', # See https://github.com/jruby/jruby/issues/4171
"#{Gem.bindir}/bundle",
*bundle_options,
'install',
*(%w(--local --no-prune) if @options[:setup][:offline]),
'--standalone',
'--path', bundle_path,
*(['--without', @options[:setup][:without].join(' ')] unless @options[:setup][:without].empty?)].compact,
print_always: true)
if @options[:setup][:bundler]
execute_cmd([JRUBY_BIN.to_s,
'-X-C', # See https://github.com/jruby/jruby/issues/4171
"#{Gem.bindir}/bundle",
*bundle_options,
'install',
*(%w(--local --no-prune) if @options[:setup][:offline]),
'--standalone',
'--path', bundle_path,
*(['--without', @options[:setup][:without].join(' ')] unless @options[:setup][:without].empty?)].compact,
print_always: true)
end

@options[:setup][:file].each do |name, content|
log "creating file: #{mock_path}/#{name}" if verbose?
38 changes: 0 additions & 38 deletions lib/ruby/truffle/truffle/bundler-workarounds.rb
Original file line number Diff line number Diff line change
@@ -615,41 +615,3 @@ def build_extensions
end

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

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

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 ")}"
end
end
end

puts "==========================================" if $VERBOSE
end
3 changes: 3 additions & 0 deletions truffle/src/main/ruby/core/signal.rb
Original file line number Diff line number Diff line change
@@ -40,6 +40,9 @@ module Signal
end
remove_const :SIGNAL_LIST

# replace CLD with CHLD since CLD is not recognized by in `new sun.mics.Signal("CLD")`
Numbers[20] = 'CHLD'

@threads = {}
@handlers = {}