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: 2bfe4454939e
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 01540ce1e6df
Choose a head ref
  • 12 commits
  • 18 files changed
  • 3 contributors

Commits on Aug 5, 2016

  1. [Truffle] Update File.mkfifo arg handling

    Brandon Fish committed Aug 5, 2016
    Copy the full SHA
    decc1a3 View commit details
  2. Copy the full SHA
    1890c06 View commit details
  3. Copy the full SHA
    a44b822 View commit details
  4. Copy the full SHA
    3d7d59e View commit details
  5. Copy the full SHA
    4a06018 View commit details
  6. Copy the full SHA
    301c6fe View commit details
  7. Copy the full SHA
    d76fa47 View commit details
  8. Copy the full SHA
    f415ec0 View commit details
  9. Copy the full SHA
    b334224 View commit details
  10. Copy the full SHA
    d1b6d5e View commit details
  11. Copy the full SHA
    13c55e2 View commit details
  12. Copy the full SHA
    01540ce View commit details
8 changes: 4 additions & 4 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ graal-core: {
downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.17",
version: "8u92-jvmci-0.18",
platformspecific: true
}
}
@@ -66,7 +66,7 @@ graal-enterprise: {
downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.17",
version: "8u92-jvmci-0.18",
platformspecific: true
}
}
@@ -300,7 +300,7 @@ test-cexts: {
downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.17",
version: "8u92-jvmci-0.18",
platformspecific: true
}
}
@@ -351,7 +351,7 @@ sulong-benchmarks: {
downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.17",
version: "8u92-jvmci-0.18",
platformspecific: true
}
}
1 change: 1 addition & 0 deletions spec/ruby/shared/process/fixtures/env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print ENV["FOO"]
26 changes: 13 additions & 13 deletions spec/ruby/shared/process/spawn.rb
Original file line number Diff line number Diff line change
@@ -170,56 +170,56 @@

it "sets environment variables in the child environment" do
lambda do
Process.wait @object.spawn({"FOO" => "BAR"}, ruby_cmd('print ENV["FOO"]'))
Process.wait @object.spawn({"FOO" => "BAR"}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should output_to_fd("BAR")
end

it "unsets environment variables whose value is nil" do
ENV["FOO"] = "BAR"
lambda do
Process.wait @object.spawn({"FOO" => nil}, ruby_cmd('print ENV["FOO"]'))
Process.wait @object.spawn({"FOO" => nil}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should output_to_fd("")
end

it "calls #to_hash to convert the environment" do
o = mock("to_hash")
o.should_receive(:to_hash).and_return({"FOO" => "BAR"})
lambda do
Process.wait @object.spawn(o, ruby_cmd('print ENV["FOO"]'))
Process.wait @object.spawn(o, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should output_to_fd("BAR")
end

it "calls #to_str to convert the environment keys" do
o = mock("to_str")
o.should_receive(:to_str).and_return("FOO")
lambda do
Process.wait @object.spawn({o => "BAR"}, ruby_cmd('print ENV["FOO"]'))
Process.wait @object.spawn({o => "BAR"}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should output_to_fd("BAR")
end

it "calls #to_str to convert the environment values" do
o = mock("to_str")
o.should_receive(:to_str).and_return("BAR")
lambda do
Process.wait @object.spawn({"FOO" => o}, ruby_cmd('print ENV["FOO"]'))
Process.wait @object.spawn({"FOO" => o}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should output_to_fd("BAR")
end

it "raises an ArgumentError if an environment key includes an equals sign" do
lambda do
@object.spawn({"FOO=" => "BAR"}, ruby_cmd('print ENV["FOO"]'))
@object.spawn({"FOO=" => "BAR"}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should raise_error(ArgumentError)
end

it "raises an ArgumentError if an environment key includes a null byte" do
lambda do
@object.spawn({"\000" => "BAR"}, ruby_cmd('print ENV["FOO"]'))
@object.spawn({"\000" => "BAR"}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should raise_error(ArgumentError)
end

it "raises an ArgumentError if an environment value includes a null byte" do
lambda do
@object.spawn({"FOO" => "\000"}, ruby_cmd('print ENV["FOO"]'))
@object.spawn({"FOO" => "\000"}, ruby_cmd(fixture(__FILE__, "env.rb")))
end.should raise_error(ArgumentError)
end

@@ -228,34 +228,34 @@
it "unsets other environment variables when given a true :unsetenv_others option" do
ENV["FOO"] = "BAR"
lambda do
Process.wait @object.spawn(ruby_cmd('print ENV["FOO"]'), unsetenv_others: true)
Process.wait @object.spawn(ruby_cmd(fixture(__FILE__, "env.rb")), unsetenv_others: true)
end.should output_to_fd("")
end

it "unsets other environment variables when given a non-false :unsetenv_others option" do
ENV["FOO"] = "BAR"
lambda do
Process.wait @object.spawn(ruby_cmd('print ENV["FOO"]'), unsetenv_others: :true)
Process.wait @object.spawn(ruby_cmd(fixture(__FILE__, "env.rb")), unsetenv_others: :true)
end.should output_to_fd("")
end

it "does not unset other environment variables when given a false :unsetenv_others option" do
ENV["FOO"] = "BAR"
lambda do
Process.wait @object.spawn(ruby_cmd('print ENV["FOO"]'), unsetenv_others: false)
Process.wait @object.spawn(ruby_cmd(fixture(__FILE__, "env.rb")), unsetenv_others: false)
end.should output_to_fd("BAR")
end

it "does not unset other environment variables when given a nil :unsetenv_others option" do
ENV["FOO"] = "BAR"
lambda do
Process.wait @object.spawn(ruby_cmd('print ENV["FOO"]'), unsetenv_others: nil)
Process.wait @object.spawn(ruby_cmd(fixture(__FILE__, "env.rb")), unsetenv_others: nil)
end.should output_to_fd("BAR")
end

it "does not unset environment variables included in the environment hash" do
lambda do
Process.wait @object.spawn({"FOO" => "BAR"}, ruby_cmd('print ENV["FOO"]', options: '--disable-gems'), unsetenv_others: true)
Process.wait @object.spawn({"FOO" => "BAR"}, ruby_cmd(fixture(__FILE__, "env.rb"), options: '--disable-gems'), unsetenv_others: true)
end.should output_to_fd("BAR")
end

101 changes: 0 additions & 101 deletions spec/truffle/tags/core/kernel/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -1,116 +1,31 @@
fails:Kernel#spawn is a private method
fails:Kernel#spawn executes the given command
fails:Kernel#spawn returns the process ID of the new process as a Fixnum
fails:Kernel#spawn returns immediately
fails:Kernel#spawn sets environment variables in the child environment
fails:Kernel#spawn unsets environment variables whose value is nil
fails:Kernel#spawn calls #to_hash to convert the environment
fails:Kernel#spawn calls #to_str to convert the environment keys
fails:Kernel#spawn calls #to_str to convert the environment values
fails:Kernel#spawn raises an ArgumentError if an environment key includes an equals sign
fails:Kernel#spawn raises an ArgumentError if an environment key includes a null byte
fails:Kernel#spawn raises an ArgumentError if an environment value includes a null byte
fails:Kernel#spawn unsets other environment variables when given a true :unsetenv_others option
fails:Kernel#spawn unsets other environment variables when given a non-false :unsetenv_others option
fails:Kernel#spawn does not unset other environment variables when given a false :unsetenv_others option
fails:Kernel#spawn does not unset other environment variables when given a nil :unsetenv_others option
fails:Kernel#spawn does not unset environment variables included in the environment hash
fails:Kernel#spawn joins the current process group by default
fails:Kernel#spawn joins the current process if pgroup: false
fails:Kernel#spawn joins the current process if pgroup: nil
fails:Kernel#spawn joins a new process group if pgroup: true
fails:Kernel#spawn joins a new process group if pgroup: 0
fails:Kernel#spawn joins the specified process group if pgroup: pgid
fails:Kernel#spawn raises an ArgumentError if given a negative :pgroup option
fails:Kernel#spawn raises a TypeError if given a symbol as :pgroup option
fails:Kernel#spawn uses the current working directory as its working directory
fails:Kernel#spawn uses the current umask by default
fails:Kernel#spawn sets the umask if given the :umask option
fails:Kernel#spawn raises an ArgumentError if passed no command arguments
fails:Kernel#spawn raises an ArgumentError if passed env or options but no command arguments
fails:Kernel#spawn raises an ArgumentError if passed env and options but no command arguments
fails:Kernel#spawn raises an Errno::ENOENT for an empty string
fails:Kernel#spawn raises an Errno::ENOENT if the command does not exist
fails:Kernel#spawn raises an Errno::EACCES when the file does not have execute permissions
fails:Kernel#spawn raises an Errno::EACCES when passed a directory
fails:Kernel#spawn raises an ArgumentError when passed a string key in options
fails:Kernel#spawn raises an ArgumentError when passed an unknown option key
fails:Kernel#spawn with a single argument subjects the specified command to shell expansion
fails:Kernel#spawn with a single argument creates an argument array with shell parsing semantics for whitespace
fails:Kernel#spawn with a single argument calls #to_str to convert the argument to a String
fails:Kernel#spawn with a single argument raises an ArgumentError if the command includes a null byte
fails:Kernel#spawn with a single argument raises a TypeError if the argument does not respond to #to_str
fails:Kernel#spawn with multiple arguments does not subject the arguments to shell expansion
fails:Kernel#spawn with multiple arguments preserves whitespace in passed arguments
fails:Kernel#spawn with multiple arguments calls #to_str to convert the arguments to Strings
fails:Kernel#spawn with multiple arguments raises an ArgumentError if an argument includes a null byte
fails:Kernel#spawn with multiple arguments raises a TypeError if an argument does not respond to #to_str
fails:Kernel#spawn with a command array uses the first element as the command name and the second as the argv[0] value
fails:Kernel#spawn with a command array does not subject the arguments to shell expansion
fails:Kernel#spawn with a command array preserves whitespace in passed arguments
fails:Kernel#spawn with a command array calls #to_ary to convert the argument to an Array
fails:Kernel#spawn with a command array calls #to_str to convert the first element to a String
fails:Kernel#spawn with a command array calls #to_str to convert the second element to a String
fails:Kernel#spawn with a command array raises an ArgumentError if the Array does not have exactly two elements
fails:Kernel#spawn with a command array raises an ArgumentError if the Strings in the Array include a null byte
fails:Kernel#spawn with a command array raises a TypeError if an element in the Array does not respond to #to_str
fails:Kernel#spawn when passed :chdir changes to the directory passed for :chdir
fails:Kernel#spawn when passed :chdir calls #to_path to convert the :chdir value
fails:Kernel.spawn executes the given command
fails:Kernel.spawn returns the process ID of the new process as a Fixnum
fails:Kernel.spawn returns immediately
fails:Kernel.spawn sets environment variables in the child environment
fails:Kernel.spawn unsets environment variables whose value is nil
fails:Kernel.spawn calls #to_hash to convert the environment
fails:Kernel.spawn calls #to_str to convert the environment keys
fails:Kernel.spawn calls #to_str to convert the environment values
fails:Kernel.spawn raises an ArgumentError if an environment key includes an equals sign
fails:Kernel.spawn raises an ArgumentError if an environment key includes a null byte
fails:Kernel.spawn raises an ArgumentError if an environment value includes a null byte
fails:Kernel.spawn unsets other environment variables when given a true :unsetenv_others option
fails:Kernel.spawn unsets other environment variables when given a non-false :unsetenv_others option
fails:Kernel.spawn does not unset other environment variables when given a false :unsetenv_others option
fails:Kernel.spawn does not unset other environment variables when given a nil :unsetenv_others option
fails:Kernel.spawn does not unset environment variables included in the environment hash
fails:Kernel.spawn joins the current process group by default
fails:Kernel.spawn joins the current process if pgroup: false
fails:Kernel.spawn joins the current process if pgroup: nil
fails:Kernel.spawn joins a new process group if pgroup: true
fails:Kernel.spawn joins a new process group if pgroup: 0
fails:Kernel.spawn joins the specified process group if pgroup: pgid
fails:Kernel.spawn raises an ArgumentError if given a negative :pgroup option
fails:Kernel.spawn raises a TypeError if given a symbol as :pgroup option
fails:Kernel.spawn uses the current working directory as its working directory
fails:Kernel.spawn uses the current umask by default
fails:Kernel.spawn sets the umask if given the :umask option
fails:Kernel.spawn raises an ArgumentError if passed no command arguments
fails:Kernel.spawn raises an ArgumentError if passed env or options but no command arguments
fails:Kernel.spawn raises an ArgumentError if passed env and options but no command arguments
fails:Kernel.spawn raises an Errno::ENOENT for an empty string
fails:Kernel.spawn raises an Errno::ENOENT if the command does not exist
fails:Kernel.spawn raises an Errno::EACCES when the file does not have execute permissions
fails:Kernel.spawn raises an Errno::EACCES when passed a directory
fails:Kernel.spawn raises an ArgumentError when passed a string key in options
fails:Kernel.spawn raises an ArgumentError when passed an unknown option key
fails:Kernel.spawn with a single argument subjects the specified command to shell expansion
fails:Kernel.spawn with a single argument creates an argument array with shell parsing semantics for whitespace
fails:Kernel.spawn with a single argument calls #to_str to convert the argument to a String
fails:Kernel.spawn with a single argument raises an ArgumentError if the command includes a null byte
fails:Kernel.spawn with a single argument raises a TypeError if the argument does not respond to #to_str
fails:Kernel.spawn with multiple arguments does not subject the arguments to shell expansion
fails:Kernel.spawn with multiple arguments preserves whitespace in passed arguments
fails:Kernel.spawn with multiple arguments calls #to_str to convert the arguments to Strings
fails:Kernel.spawn with multiple arguments raises an ArgumentError if an argument includes a null byte
fails:Kernel.spawn with multiple arguments raises a TypeError if an argument does not respond to #to_str
fails:Kernel.spawn with a command array uses the first element as the command name and the second as the argv[0] value
fails:Kernel.spawn with a command array does not subject the arguments to shell expansion
fails:Kernel.spawn with a command array preserves whitespace in passed arguments
fails:Kernel.spawn with a command array calls #to_ary to convert the argument to an Array
fails:Kernel.spawn with a command array calls #to_str to convert the first element to a String
fails:Kernel.spawn with a command array calls #to_str to convert the second element to a String
fails:Kernel.spawn with a command array raises an ArgumentError if the Array does not have exactly two elements
fails:Kernel.spawn with a command array raises an ArgumentError if the Strings in the Array include a null byte
fails:Kernel.spawn with a command array raises a TypeError if an element in the Array does not respond to #to_str
fails:Kernel.spawn when passed :chdir changes to the directory passed for :chdir
fails:Kernel.spawn when passed :chdir calls #to_path to convert the :chdir value
fails:Kernel#spawn with Integer option keys maps the key to a file descriptor in the child that inherits the file descriptor from the parent specified by the value
@@ -130,23 +45,13 @@ slow:Kernel.spawn when passed close_others: false does not close STDIN
slow:Kernel.spawn when passed close_others: false does not close STDOUT
slow:Kernel.spawn when passed close_others: false does not close STDERR
fails:Kernel#spawn when passed close_others: true closes file descriptors >= 3 in the child process
fails:Kernel#spawn when passed close_others: false closes file descriptors >= 3 in the child process because they are set close_on_exec by default
fails:Kernel#spawn when passed close_others: false does not close file descriptors >= 3 in the child process if fds are set close_on_exec=false
fails:Kernel.spawn when passed close_others: true closes file descriptors >= 3 in the child process
fails:Kernel.spawn when passed close_others: false closes file descriptors >= 3 in the child process because they are set close_on_exec by default
fails:Kernel.spawn when passed close_others: false does not close file descriptors >= 3 in the child process if fds are set close_on_exec=false
fails:Kernel#spawn when passed close_others: true does not close STDIN
fails:Kernel#spawn when passed close_others: true does not close STDOUT
fails:Kernel#spawn when passed close_others: true does not close STDERR
fails:Kernel#spawn when passed close_others: false does not close STDIN
fails:Kernel#spawn when passed close_others: false does not close STDOUT
fails:Kernel#spawn when passed close_others: false does not close STDERR
fails:Kernel.spawn when passed close_others: true does not close STDIN
fails:Kernel.spawn when passed close_others: true does not close STDOUT
fails:Kernel.spawn when passed close_others: true does not close STDERR
fails:Kernel.spawn when passed close_others: false does not close STDIN
fails:Kernel.spawn when passed close_others: false does not close STDOUT
fails:Kernel.spawn when passed close_others: false does not close STDERR
slow:Kernel#spawn redirects STDOUT to the given file if out: String
slow:Kernel#spawn redirects STDOUT to the given file if out: [String name, String mode]
slow:Kernel#spawn redirects STDERR to the given file if err: String
@@ -169,9 +74,3 @@ slow:Kernel.spawn redirects STDERR to the given file descriptor if err: IO
slow:Kernel.spawn redirects STDERR to child STDOUT if :err => [:child, :out]
slow:Kernel.spawn redirects both STDERR and STDOUT to the given file descriptior
slow:Kernel.spawn redirects both STDERR and STDOUT to the given IO
fails:Kernel#spawn redirects STDOUT to the given file if out: String
fails:Kernel#spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel#spawn redirects STDERR to the given file if err: String
fails:Kernel.spawn redirects STDOUT to the given file if out: String
fails:Kernel.spawn redirects STDOUT to the given file if out: [String name, String mode]
fails:Kernel.spawn redirects STDERR to the given file if err: String
16 changes: 0 additions & 16 deletions spec/truffle/tags/core/process/kill_tags.txt

This file was deleted.

5 changes: 4 additions & 1 deletion tool/jruby_eclipse
Original file line number Diff line number Diff line change
@@ -4,7 +4,10 @@

JRUBY = File.expand_path('../..', __FILE__)

M2REPO = "#{Dir.home}/.m2/repository"
# Handle missing $HOME variable
home = Dir.home rescue "/home/#{`whoami`.chomp}"

M2REPO = "#{home}/.m2/repository"

TRUFFLE_VERSION = File.foreach("#{JRUBY}/truffle/pom.rb") { |line|
break $1 if /'truffle\.version' => '(\d+\.\d+|\h+-SNAPSHOT)'/ =~ line
5 changes: 5 additions & 0 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
@@ -1168,6 +1168,11 @@ public static boolean fitsIntoInteger(long value) {
return ((int) value) == value;
}

public static int long2int(long value) {
assert fitsIntoInteger(value);
return (int) value;
}

public RubyContext getContext() {
return context;
}
Loading