Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/truffle-head'
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Nov 30, 2016
2 parents ddbc53b + 3b57e25 commit 399cf15
Show file tree
Hide file tree
Showing 117 changed files with 2,054 additions and 378 deletions.
19 changes: 19 additions & 0 deletions lib/ruby/truffle/cext/ruby.h
Expand Up @@ -45,6 +45,14 @@ extern "C" {

#define HAVE_RB_IO_T

// Overrides

#ifdef memcpy
#undef memcpy
#endif

#define memcpy truffle_managed_memcpy

// Macros

#define NORETURN(X) __attribute__((__noreturn__)) X
Expand Down Expand Up @@ -491,6 +499,17 @@ MUST_INLINE int rb_jt_scan_args_11(int argc, VALUE *argv, const char *format, VA
return argc - 1;
}

MUST_INLINE int rb_jt_scan_args_12(int argc, VALUE *argv, const char *format, VALUE *v1, VALUE *v2, VALUE *v3) {
if (argc < 1) {
rb_jt_error("rb_jt_scan_args_12 error case not implemented");
abort();
}
*v1 = argv[0];
if (argc >= 2) *v2 = argv[1];
if (argc >= 3) *v3 = argv[2];
return argc - 1;
}

int rb_scan_args(int argc, VALUE *argv, const char *format, ...);

// Calls
Expand Down
27 changes: 16 additions & 11 deletions mx.jruby/mx_jruby.py
Expand Up @@ -59,20 +59,27 @@ def getResults(self):
return [join(_suite.dir, f) for f in self.license_files]

def mavenSetup():
buildPack = join(_suite.dir, 'jruby-build-pack/maven')
mavenDir = buildPack if isdir(buildPack) else join(_suite.dir, 'mxbuild/mvn')
maven_repo_arg = '-Dmaven.repo.local=' + mavenDir
maven_args = []
env = os.environ.copy()
if not mx.get_opts().verbose:
maven_args.append('-q')

buildPack = join(_suite.dir, 'jruby-build-pack/maven')
if isdir(buildPack):
maven_args.append('-Dmaven.repo.local=' + buildPack)
elif 'CI' in env and 'TRAVIS' not in env:
maven_args.append('-Dmaven.repo.local=' + join(_suite.dir, 'mxbuild/mvn'))

if not mx.get_opts().verbose:
env['JRUBY_BUILD_MORE_QUIET'] = 'true'
# HACK: since the maven executable plugin does not configure the
# java executable that is used we unfortunately need to prepend it to the PATH
javaHome = os.getenv('JAVA_HOME')
if javaHome:
env["PATH"] = javaHome + '/bin' + os.pathsep + env["PATH"]
mx.logv('Setting PATH to {}'.format(os.environ["PATH"]))
mx.logv('Setting PATH to {}'.format(env["PATH"]))
mx.run(['java', '-version'], env=env)
return maven_repo_arg, env
return maven_args, env

class JRubyCoreMavenProject(mx.MavenProject):
def getBuildTask(self, args):
Expand Down Expand Up @@ -128,10 +135,9 @@ def needsBuild(self, newestInput):

def build(self):
cwd = _suite.dir
maven_repo_arg, env = mavenSetup()
maven_args, env = mavenSetup()
mx.log("Building jruby-core with Maven")
quiet = [] if mx.get_opts().verbose else ['-q']
mx.run_maven(quiet + ['-DskipTests', maven_repo_arg, '-Dcreate.sources.jar', '-pl', 'core,lib'], cwd=cwd, env=env)
mx.run_maven(maven_args + ['-DskipTests', '-Dcreate.sources.jar', '-pl', 'core,lib'], cwd=cwd, env=env)
# Install Bundler
gem_home = join(_suite.dir, 'lib', 'ruby', 'gems', 'shared')
env['GEM_HOME'] = gem_home
Expand All @@ -141,9 +147,8 @@ def build(self):
def clean(self, forBuild=False):
if forBuild:
return
maven_repo_arg, env = mavenSetup()
quiet = [] if mx.get_opts().verbose else ['-q']
mx.run_maven(quiet + [maven_repo_arg, 'clean'], nonZeroIsFatal=False, cwd=_suite.dir, env=env)
maven_args, env = mavenSetup()
mx.run_maven(maven_args + ['clean'], nonZeroIsFatal=False, cwd=_suite.dir, env=env)
jar = self.newestOutput()
if jar.exists():
os.remove(jar.path)
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/optional/capi/spec_helper.rb
Expand Up @@ -138,7 +138,7 @@ def compile_jruby_truffle_extconf_make(name, path, objdir)
system "#{RbConfig.ruby} extconf.rb"
system "make" # run make in temp dir
FileUtils.cp "#{ext}.su", lib_target # copy to .su file to library dir
FileUtils.cp "#{ext}.ll", objdir # copy to .ll file to library dir
FileUtils.cp "#{ext}.bc", objdir # copy to .bc file to library dir
end
ensure
FileUtils.remove_entry temp_dir
Expand Down
14 changes: 11 additions & 3 deletions spec/ruby/shared/process/spawn.rb
Expand Up @@ -250,19 +250,26 @@

# :unsetenv_others

before :each do
@minimal_env = {
"PATH" => ENV["PATH"],
"HOME" => ENV["HOME"]
}
end

platform_is_not :windows do
it "unsets other environment variables when given a true :unsetenv_others option" do
ENV["FOO"] = "BAR"
lambda do
Process.wait @object.spawn({"PATH" => ENV["PATH"]}, ruby_cmd(fixture(__FILE__, "env.rb"), options: "--disable-gems"), unsetenv_others: true)
Process.wait @object.spawn(@minimal_env, ruby_cmd(fixture(__FILE__, "env.rb"), options: "--disable-gems"), unsetenv_others: true)
$?.success?.should be_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({"PATH" => ENV["PATH"]}, ruby_cmd(fixture(__FILE__, "env.rb"), options: "--disable-gems"), unsetenv_others: :true)
Process.wait @object.spawn(@minimal_env, ruby_cmd(fixture(__FILE__, "env.rb"), options: "--disable-gems"), unsetenv_others: :true)
$?.success?.should be_true
end.should output_to_fd("")
end
Expand All @@ -287,7 +294,8 @@
platform_is_not :windows do
it "does not unset environment variables included in the environment hash" do
lambda do
Process.wait @object.spawn({"FOO" => "BAR"}, ruby_cmd(fixture(__FILE__, "env.rb"), options: "--disable-gems"), unsetenv_others: true)
env = @minimal_env.merge({"FOO" => "BAR"})
Process.wait @object.spawn(env, ruby_cmd(fixture(__FILE__, "env.rb"), options: "--disable-gems"), unsetenv_others: true)
$?.success?.should be_true
end.should output_to_fd("BAR")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/array/append_spec.rb
Expand Up @@ -21,7 +21,7 @@ def storage(ary)

it "empty array has null storage" do
ary = []
storage(ary).should == "null"
storage(ary).should == "fallback"
end

it "supports transitions from null storage" do
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/binding/of_caller_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/boot/source_of_caller_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/fixnum/and_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/gc/count_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/gc/time_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/graal/assert_constant_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/graal/graal_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/graal/substrate_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/graal/version_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/home_directory_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
1 change: 1 addition & 0 deletions spec/truffle/specs/truffle/ropes/complex_structure_spec.rb
Expand Up @@ -17,6 +17,7 @@
[(('abcd'*3)[1..-3]+('ABCD')), 'bcdabcdabABCD'],
[(('abcd'*3)[1..-4]+('ABCD')), 'bcdabcdaABCD'],
[(('abcd'*3)[1..-5]+('ABCD')), 'bcdabcdABCD'],
[(('ab'*4)+'0123456789')[1..-2]+'cd', 'bababab012345678cd']
].each_with_index do |(a, b), i|
it format('%d: %s', i, b) do
a.should == b
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/ropes/debug_print_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/ropes/dump_string_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
2 changes: 1 addition & 1 deletion spec/truffle/specs/truffle/system/host_os_spec.rb
@@ -1,4 +1,4 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
Expand Down
1 change: 1 addition & 0 deletions spec/truffle/tags/command_line/frozen_strings_tags.txt
@@ -0,0 +1 @@
fails:The --debug flag produces debugging info on attempted frozen string modification
1 change: 1 addition & 0 deletions spec/truffle/tags/core/file/constants/constants_tags.txt
@@ -1 +1,2 @@
fails(windows):File::Constants::BINARY is defined
fails:File::TMPFILE is defined
4 changes: 2 additions & 2 deletions spec/truffle/tags/core/file/flock_tags.txt
Expand Up @@ -7,5 +7,5 @@ solaris:File#flock exclusively locks a file
solaris:File#flock non-exclusively locks a file
solaris:File#flock blocks if trying to lock an exclusively locked file
solaris:File#flock returns 0 if trying to lock a non-exclusively locked file
solaris:File#flock on Solaris or Java fails with EBADF acquiring exclusive lock on read-only File
solaris:File#flock on Solaris or Java fails with EBADF acquiring shared lock on read-only File
solaris:File#flock on Solaris fails with EBADF acquiring exclusive lock on read-only File
solaris:File#flock on Solaris fails with EBADF acquiring shared lock on read-only File
4 changes: 3 additions & 1 deletion spec/truffle/tags/core/kernel/spawn_tags.txt
Expand Up @@ -120,4 +120,6 @@ slow:Kernel.spawn uses the current umask by default
slow:Kernel.spawn when passed close_others: false closes file descriptors >= 3 in the child process because they are set close_on_exec by default
slow: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
slow: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
fails:Kernel#spawn does not unset environment variables included in the environment hash
ci:Kernel#spawn unsets other environment variables when given a true :unsetenv_others option
ci:Kernel#spawn unsets other environment variables when given a non-false :unsetenv_others option
ci:Kernel#spawn does not unset environment variables included in the environment hash
2 changes: 0 additions & 2 deletions spec/truffle/tags/language/hash_tags.txt

This file was deleted.

6 changes: 0 additions & 6 deletions spec/truffle/tags/language/heredoc_tags.txt

This file was deleted.

5 changes: 4 additions & 1 deletion spec/truffle/truffle.mspec
Expand Up @@ -27,7 +27,10 @@ class MSpecScript
-Xtruffle.graal.warn_unless=false
]
core_path = "#{JRUBY_DIR}/truffle/src/main/ruby"
flags << "-Xtruffle.core.load_path=#{core_path}" if File.directory?(core_path)
if File.directory?(core_path)
flags << "-Xtruffle.core.load_path=#{core_path}"
flags << "-Xtruffle.backtraces.hide_core_files=false"
end
set :flags, flags
end

Expand Down
4 changes: 0 additions & 4 deletions test/truffle/cexts/ruby-argon2/test.rb

This file was deleted.

4 changes: 2 additions & 2 deletions test/truffle/cexts/xml/ext/xml/extconf.rb
@@ -1,4 +1,4 @@
require 'mkmf'
$CFLAGS += " -I#{ENV['LIBXML_INCLUDE']}"
$LDFLAGS += " -l #{ENV['LIBXML_LIB']}"
$CFLAGS += " -I #{ENV['LIBXML_INCLUDE']}"
$LIBS += " -l #{ENV['LIBXML_LIB']}"
create_makefile('xml')
4 changes: 2 additions & 2 deletions test/truffle/cexts/xopenssl/ext/xopenssl/extconf.rb
@@ -1,4 +1,4 @@
require 'mkmf'
$CFLAGS += " -I#{ENV['OPENSSL_INCLUDE']}"
$LDFLAGS += " -l #{ENV['OPENSSL_LIB']}"
$CFLAGS += " -I #{ENV['OPENSSL_INCLUDE']}"
$LIBS += " -l #{ENV['OPENSSL_LIB']}"
create_makefile('xopenssl')
1 change: 1 addition & 0 deletions test/truffle/compiler/pe/pe.rb
Expand Up @@ -71,6 +71,7 @@ def counter(example)
require_relative 'language/metaprogramming_pe.rb'
require_relative 'language/super_pe.rb'
require_relative 'language/defined_pe.rb'
require_relative 'language/global_pe.rb'
require_relative 'core/truefalse_pe.rb'
require_relative 'core/fixnum_pe.rb'
require_relative 'core/float_pe.rb'
Expand Down
8 changes: 8 additions & 0 deletions test/truffle/integration/instrumentation-server/subject.rb
@@ -1,3 +1,11 @@
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

File.open("ready.txt", "w").close

loop do
Expand Down

0 comments on commit 399cf15

Please sign in to comment.