Browse files

Added experimental 2.0 support.

  • Loading branch information...
1 parent 90fe9c7 commit 58a50eccb55fa0676b13e1d8e554df2a9ca2ed21 Brian Ford committed Oct 13, 2010
View
13 Rakefile
@@ -27,7 +27,7 @@ end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG
-unless BUILD_CONFIG[:config_version] == 21
+unless BUILD_CONFIG[:config_version] == 22
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
@@ -106,6 +106,12 @@ task :ci19 do
run_ci
end
+desc "Run CI in 2.0 mode"
+task :ci20 do
+ ENV['CI_MODE_FLAG'] = "-T -X20"
+ run_ci
+end
+
desc 'Remove rubinius build files'
task :clean => %w[
vm:clean
@@ -158,6 +164,11 @@ task :spec19 do
run_specs "-T -X19"
end
+desc "Run the CI specs in 2.0 mode but do not rebuild on failure"
+task :spec20 do
+ run_specs "-T -X20"
+end
+
desc "Run CI in default (configured) mode but do not rebuild on failure"
task :spec do
run_specs
View
14 configure
@@ -33,6 +33,7 @@ class Configure
@rake = ENV['RAKE'] || 'rake'
@install = false
@version_19 = false
+ @version_20 = false
# LLVM settings
@use_llvm = true
@@ -68,10 +69,10 @@ class Configure
@program_name = "rbx"
# Essential settings (modify these for creating releases)
- @libversion = "1.1"
- @version = "#{@libversion}.0"
- @release_date = "2010-09-23"
- @config_version = 21
+ @libversion = "1.2"
+ @version = "#{@libversion}.0dev"
+ @release_date = "xxxx-xx-xx"
+ @config_version = 22
if !ENV['RELEASE'] and File.directory?(root + "/.git")
@buildrev = `git rev-list --all | head -n1`.chomp
@@ -111,6 +112,10 @@ class Configure
@version_19 = true
end
+ o.on "--default-2.0", "Support Ruby version 2.0 by default" do
+ @version_20 = true
+ end
+
o.doc "\n Compiler settings"
o.on "--cc", "COMPILER", "Compiler to use (eg gcc, clang)" do |cc|
@@ -729,6 +734,7 @@ end
#define RBX_BUILD_REV "#{@buildrev}"
#define RBX_LDSHARED "#{@ldshared}"
#define RBX_DEFAULT_19 #{@version_19}
+#define RBX_DEFAULT_20 #{@version_20}
#define RBX_RELEASE_DATE "#{@release_date}"
#define RBX_SIZEOF_LONG #{@sizeof_long}
EOC
View
46 kernel/bootstrap/load_order20.txt
@@ -0,0 +1,46 @@
+alias.rbc
+array.rbc
+array19.rbc
+basicobject.rbc
+bignum.rbc
+block_environment.rbc
+bytearray.rbc
+channel.rbc
+class.rbc
+compactlookuptable.rbc
+compiled_method.rbc
+configuration.rbc
+dir.rbc
+exception.rbc
+executable.rbc
+false.rbc
+fixnum.rbc
+gc.rbc
+io.rbc
+iseq.rbc
+kernel19.rbc
+kernel.rbc
+lookuptable.rbc
+methodtable.rbc
+nil.rbc
+object.rbc
+proc.rbc
+process.rbc
+regexp.rbc
+rubinius.rbc
+rubinius19.rbc
+selector.rbc
+sendsite.rbc
+static_scope.rbc
+string.rbc
+symbol.rbc
+taskprobe.rbc
+thread.rbc
+thunk.rbc
+time.rbc
+true.rbc
+tuple.rbc
+type.rbc
+variable_scope.rbc
+vm.rbc
+weakref.rbc
View
5 kernel/bootstrap/rubinius.rb
@@ -110,4 +110,9 @@ def self.ruby19?
Ruby.primitive :vm_ruby19_p
raise PrimitiveFailure, "Rubinius.ruby19? failed"
end
+
+ def self.ruby20?
+ Ruby.primitive :vm_ruby20_p
+ raise PrimitiveFailure, "Rubinius.ruby20? failed"
+ end
end
View
95 kernel/common/load_order20.txt
@@ -0,0 +1,95 @@
+basicobject.rbc
+object.rbc
+class.rbc
+binding.rbc
+proc.rbc
+autoload.rbc
+module.rbc
+module19.rbc
+enumerable19.rbc
+enumerable.rbc
+enumerator.rbc
+enumerator19.rbc
+argf.rbc
+tuple.rbc
+exception.rbc
+undefined.rbc
+hash.rbc
+hash19.rbc
+type.rbc
+kernel.rbc
+kernel19.rbc
+identitymap.rbc
+array.rbc
+array19.rbc
+loadedfeatures.rbc
+global.rbc
+backtrace.rbc
+comparable.rbc
+numeric.rbc
+ctype.rbc
+precision.rbc
+integer.rbc
+integer19.rbc
+bignum.rbc
+block_environment.rbc
+bytearray.rbc
+channel.rbc
+executable.rbc
+static_scope.rbc
+static_scope19.rbc
+hook.rbc
+codeloader.rbc
+compiled_method.rbc
+continuation.rbc
+delegated_method.rbc
+fixnum.rbc
+dir.rbc
+dir19.rbc
+dir_glob.rbc
+dtrace.rbc
+encoding.rbc
+env.rbc
+errno.rbc
+eval.rbc
+false.rbc
+fiber.rbc
+io.rbc
+io19.rbc
+file.rbc
+file19.rbc
+filetest.rbc
+float.rbc
+immediate.rbc
+location.rbc
+lookuptable.rbc
+main.rbc
+marshal.rbc
+math.rbc
+method.rbc
+method_table.rbc
+moment.rbc
+native_method.rbc
+nil.rbc
+objectspace.rbc
+string.rbc
+string19.rbc
+range.rbc
+rubinius.rbc
+struct.rbc
+process.rbc
+random.rbc
+regexp.rbc
+selector.rbc
+signal.rbc
+sprintf.rbc
+symbol.rbc
+taskprobe.rbc
+thread.rbc
+thread_group.rbc
+throw_catch.rbc
+time.rbc
+true.rbc
+variable_scope.rbc
+vm.rbc
+capi.rbc
View
18 kernel/delta/load_order20.txt
@@ -0,0 +1,18 @@
+ctype.rbc
+class.rbc
+exception.rbc
+file.rbc
+ruby_constants20.rbc
+ruby_constants.rbc
+rubinius.rbc
+module.rbc
+filetest.rbc
+kernel.rbc
+math.rbc
+options.rbc
+stats.rbc
+profiler.rbc
+signal.rbc
+struct.rbc
+thread.rbc
+codeloader.rbc
View
2 kernel/delta/ruby_constants20.rb
@@ -0,0 +1,2 @@
+RUBY_VERSION = "2.0.0"
+RUBY_PATCHLEVEL = 0
View
7 kernel/loader.rb
@@ -72,11 +72,12 @@ def system_load_path
# This conforms more closely to MRI. It is necessary to support
# paths that mkmf adds when compiling and installing native exts.
additions = []
- if Rubinius.ruby19?
- additions << Rubinius::LIB_PATH + "/19"
+ if Rubinius.ruby19? or Rubinius.ruby20?
+ version_lib = "/19"
else
- additions << Rubinius::LIB_PATH + "/18"
+ version_lib = "/18"
end
+ additions << Rubinius::LIB_PATH + version_lib
additions << Rubinius::SITE_PATH
additions << "#{Rubinius::SITE_PATH}/#{Rubinius::CPU}-#{Rubinius::OS}"
additions << Rubinius::VENDOR_PATH
View
8 kernel/platform/load_order20.txt
@@ -0,0 +1,8 @@
+ffi.rbc
+library.rbc
+pointer.rbc
+env.rbc
+file.rbc
+math.rbc
+posix.rbc
+struct.rbc
View
2 rakelib/kernel.rake
@@ -53,7 +53,7 @@ def kernel_file_task(runtime, signature, rb, rbc=nil)
runtime << rbc
end
-["18", "19"].each do |ver|
+["18", "19", "20"].each do |ver|
dir_names.each do |dir|
directory(runtime_dir = "runtime/#{dir}")
runtime << runtime_dir
View
6 spec/library/config/rbconfig_spec.rb
@@ -74,9 +74,13 @@ def it_has_entries(name, entries)
it_has_entries 'RbConfig::CONFIG', "ruby_version" => "1.8"
end
- ruby_version_is "1.9" do
+ ruby_version_is "1.9"..."2.0" do
it_has_entries 'RbConfig::CONFIG', "ruby_version" => "1.9"
end
+
+ ruby_version_is "2.0" do
+ it_has_entries 'RbConfig::CONFIG', "ruby_version" => "2.0"
+ end
end
describe "RbConfig::MAKEFILE_CONFIG" do
View
173 spec/rbx.2.0.mspec
@@ -0,0 +1,173 @@
+# vim: filetype=ruby
+
+class MSpecScript
+ # Language features specs
+ set :language, [
+ 'spec/ruby/language',
+ 'spec/language'
+ ]
+
+ # Core library specs
+ set :core, [
+ 'spec/ruby/core',
+ 'spec/core',
+ ]
+
+ # Standard library specs
+ set :library, [
+ 'spec/ruby/library',
+ 'spec/library',
+
+ # obsolete libraries
+ '^library/cgi-lib',
+ '^library/date2',
+ '^library/enumerator',
+ '^library/eregex',
+ '^library/finalize',
+ '^library/ftools',
+ '^library/generator',
+ '^library/getopts',
+ '^library/importenv',
+ '^library/jcode',
+ '^library/mailread',
+ '^library/parsearg',
+ '^library/parsedate',
+ '^library/ping',
+ '^library/readbytes',
+ '^library/rubyunit',
+ '^library/runit',
+ '^library/soap',
+ '^library/wsdl',
+ '^library/xsd',
+ '^library/Win32API',
+
+ '^library/test/unit/collector',
+ '^library/test/unit/ui',
+ '^library/test/unit/util',
+
+ '^library/dl', # reimplemented and API changed
+ ]
+
+ # An ordered list of the directories containing specs to run
+ set :files, get(:language) + get(:core) + get(:library) +
+ get(:capi) + get(:compiler) + get(:build) + get(:command_line)
+
+ set :ruby, [
+ 'spec/ruby/language',
+ 'spec/ruby/core',
+ 'spec/ruby/library',
+
+ # obsolete libraries
+ '^library/cgi-lib',
+ '^library/date2',
+ '^library/enumerator',
+ '^library/eregex',
+ '^library/finalize',
+ '^library/ftools',
+ '^library/generator',
+ '^library/getopts',
+ '^library/importenv',
+ '^library/jcode',
+ '^library/mailread',
+ '^library/parsearg',
+ '^library/parsedate',
+ '^library/ping',
+ '^library/readbytes',
+ '^library/rubyunit',
+ '^library/runit',
+ '^library/soap',
+ '^library/wsdl',
+ '^library/xsd',
+ '^library/Win32API',
+
+ '^library/test/unit/collector',
+ '^library/test/unit/ui',
+ '^library/test/unit/util',
+
+ '^library/dl', # reimplemented and API changed
+ ]
+
+ # An ordered list of the directories containing specs to run
+ # as the CI process.
+ set :ci_files, [
+ 'spec/ruby/core',
+ 'spec/ruby/language',
+ 'spec/ruby/command_line',
+ 'spec/core',
+ 'spec/language',
+ 'spec/compiler',
+ 'spec/command_line',
+ 'spec/ruby/optional/capi',
+ 'spec/ruby/library',
+ 'spec/library',
+
+ 'spec/build',
+
+ # Excluded while building out basic 1.9 infrastructure
+ '^spec/ruby/core/basicobject/basic_object_class',
+ '^spec/ruby/core/basicobject/metaclass',
+ '^spec/ruby/core/encoding/default_internal',
+ '^spec/ruby/core/kernel/define_singleton_method',
+ '^spec/ruby/core/method/parameters',
+ '^spec/ruby/core/module/name',
+ '^spec/ruby/core/numeric/to_c',
+ '^spec/ruby/core/proc/parameters',
+ '^spec/ruby/language/array',
+ '^spec/ruby/language/block',
+ '^spec/ruby/language/case',
+ '^spec/ruby/language/literal_lambda',
+ '^spec/ruby/language/method',
+ '^spec/ruby/language/symbol',
+ '^spec/ruby/language/variables',
+ '^spec/ruby/command_line/dash_e',
+
+ # Excluded because the specs are extremely system dependent.
+ '^spec/ruby/library/syslog',
+
+ # obsolete libraries
+ '^library/cgi-lib',
+ '^library/date2',
+ '^library/enumerator',
+ '^library/eregex',
+ '^library/finalize',
+ '^library/ftools',
+ '^library/generator',
+ '^library/getopts',
+ '^library/importenv',
+ '^library/jcode',
+ '^library/mailread',
+ '^library/parsearg',
+ '^library/parsedate',
+ '^library/ping',
+ '^library/readbytes',
+ '^library/rubyunit',
+ '^library/runit',
+ '^library/soap',
+ '^library/wsdl',
+ '^library/xsd',
+ '^library/Win32API',
+
+ '^library/test/unit/collector',
+ '^library/test/unit/ui',
+ '^library/test/unit/util',
+
+ '^library/dl', # reimplemented and API changed
+ ]
+
+
+ # The set of substitutions to transform a spec filename
+ # into a tag filename.
+ set :tags_patterns, [
+ [%r(spec/), 'spec/tags/20/'],
+ [/_spec.rb$/, '_tags.txt']
+ ]
+
+ # Enable language features
+ MSpec.enable_feature :fiber
+ MSpec.enable_feature :fiber_library
+ MSpec.enable_feature :fork
+ MSpec.enable_feature :encoding
+
+ # These are encoding-aware methods backported to 1.8.7+ (eg String#bytes)
+ MSpec.enable_feature :encoding_transition
+end
View
4 vm/builtin/system.cpp
@@ -1011,4 +1011,8 @@ namespace rubinius {
Object* System::vm_ruby19_p(STATE) {
return state->shared.config.version_19 ? Qtrue : Qfalse;
}
+
+ Object* System::vm_ruby20_p(STATE) {
+ return state->shared.config.version_20 ? Qtrue : Qfalse;
+ }
}
View
3 vm/builtin/system.hpp
@@ -277,6 +277,9 @@ namespace rubinius {
// Ruby.primitive :vm_ruby19_p
static Object* vm_ruby19_p(STATE);
+ // Ruby.primitive :vm_ruby20_p
+ static Object* vm_ruby20_p(STATE);
+
public: /* Type info */
class Info : public TypeInfo {
View
5 vm/configuration.hpp
@@ -19,6 +19,7 @@ namespace rubinius {
// Language
config::Bool version_19;
+ config::Bool version_20;
// JIT/Interpreter
config::Bool dynamic_interpreter_enabled;
@@ -74,6 +75,7 @@ namespace rubinius {
, gc_autopack(this, "gc.autopack", true)
, version_19(this, "19", RBX_DEFAULT_19)
+ , version_20(this, "20", RBX_DEFAULT_20)
, dynamic_interpreter_enabled(this, "interpreter.dynamic")
, jit_dump_code(this, "jit.dump_code", default_jit_dump_code)
@@ -126,6 +128,9 @@ namespace rubinius {
version_19.set_description(
"Set the supported language version to 1.9");
+ version_20.set_description(
+ "Set the supported language version to 2.0");
+
jit_dump_code.set_description(
"1 == show simple IR, 2 == show optimized IR, 4 == show machine code");
View
4 vm/environment.cpp
@@ -532,7 +532,9 @@ namespace rubinius {
run_file(root + "/alpha.rbc");
std::string version;
- if(shared->config.version_19) {
+ if(shared->config.version_20) {
+ version = "20";
+ } else if(shared->config.version_19) {
version = "19";
} else {
version = "18";
View
8 vm/ontology.cpp
@@ -85,7 +85,7 @@ namespace rubinius {
// Now do Object
Class* basicobject = 0;
Class* object;
- if(state->shared.config.version_19) {
+ if(state->shared.config.version_19 || state->shared.config.version_20) {
basicobject = new_basic_class(force_as<Class>(Qnil));
GO(basicobject).set(basicobject);
basicobject->set_object_type(state, BasicObjectType);
@@ -143,7 +143,7 @@ namespace rubinius {
*/
// BasicObject's MetaClass instance has Class for a superclass
- if(state->shared.config.version_19) {
+ if(state->shared.config.version_19 || state->shared.config.version_20) {
MetaClass::attach(this, basicobject, cls);
}
@@ -156,7 +156,7 @@ namespace rubinius {
MetaClass::attach(this, cls, mc);
// See?
- if(state->shared.config.version_19) {
+ if(state->shared.config.version_19 || state->shared.config.version_20) {
assert(basicobject->superclass() == Qnil);
assert(object->superclass() == basicobject);
} else {
@@ -180,7 +180,7 @@ namespace rubinius {
// Now, finish initializing the basic Class/Module
G(object)->setup(this, "Object");
- if(state->shared.config.version_19) {
+ if(state->shared.config.version_19 || state->shared.config.version_20) {
G(basicobject)->setup(this, "BasicObject", G(object));
}
G(klass)->setup(this, "Class");

0 comments on commit 58a50ec

Please sign in to comment.