Skip to content

Commit

Permalink
Cleaned up load_order.txt and building kernel.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Jan 30, 2016
1 parent 7ae9bc7 commit 0037254
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 53 deletions.
51 changes: 0 additions & 51 deletions kernel/load_order.txt
Expand Up @@ -65,26 +65,18 @@ math.rb
posix.rb
struct.rb
union.rb
basic_object.rb
string_mirror.rb
class.rb
autoload.rb
module.rb
binding.rb
proc.rb
proc_mirror.rb
enumerable_helper.rb
enumerable.rb
enumerator.rb
argf.rb
tuple.rb
exception.rb
undefined.rb
type.rb
hash.rb
hash_hamt.rb
array.rb
kernel.rb
identity_map.rb
loaded_features.rb
global.rb
Expand All @@ -94,90 +86,47 @@ numeric_mirror.rb
numeric.rb
ctype.rb
integer.rb
bignum.rb
block_environment.rb
byte_array.rb
channel.rb
executable.rb
constant_scope.rb
hook.rb
code_loader.rb
compiled_code.rb
continuation.rb
delegated_method.rb
fixnum.rb
lru_cache.rb
encoding.rb
env.rb
errno.rb
eval.rb
false.rb
fiber.rb
io.rb
file.rb
dir.rb
dir_glob.rb
file_test.rb
stat.rb
float.rb
immediate.rb
location.rb
lookup_table.rb
main.rb
marshal.rb
math.rb
method.rb
method_equality.rb
method_table.rb
missing_method.rb
native_method.rb
nil.rb
object_space.rb
string.rb
range_mirror.rb
range.rb
struct.rb
process.rb
process_mirror.rb
random.rb
regexp.rb
signal.rb
splitter.rb
sprinter.rb
symbol.rb
mutex.rb
thread.rb
thread_group.rb
thread_group_mirror.rb
throw_catch.rb
time.rb
true.rb
variable_scope.rb
capi.rb
rational.rb
rationalizer.rb
complex.rb
complexifier.rb
gc.rb
ctype.rb
exception.rb
file.rb
rubinius.rb
runtime.rb
module.rb
class.rb
file_test.rb
kernel.rb
math.rb
options.rb
stats.rb
signal.rb
struct.rb
thread.rb
code_loader.rb
fsevent.rb
console.rb
ffi.rb
ruby_constants.rb
pack.rb
metrics.rb
Expand Down
33 changes: 31 additions & 2 deletions rakelib/kernel.rake
Expand Up @@ -26,7 +26,7 @@ end
# TODO: Build this functionality into the compiler
class KernelCompiler
def self.compile(file, output, line=1, transforms=[:default, :kernel])
compiler = Rubinius::ToolSets::Build::Compiler.new :file, :compiled_library
compiler = Rubinius::ToolSets::Build::Compiler.new :file, :compiled_file

parser = compiler.parser
parser.root Rubinius::ToolSets::Build::AST::Script
Expand Down Expand Up @@ -61,10 +61,12 @@ kernel_load_order = "kernel/load_order.txt"
kernel_files = FileList[]

IO.foreach kernel_load_order do |name|
kernel_files << "#{BUILD_CONFIG[:sourcedir]}/kernel/#{name.chomp}"
kernel_files << "kernel/#{name.chomp}"
end

file runtime_kernel_file => kernel_files + [signature_file] do |t|
rm_f t.name

t.prerequisites.each do |source|
puts "RBC #{File.basename source}"
KernelCompiler.compile source, t.name, 1, [:default, :kernel]
Expand Down Expand Up @@ -160,6 +162,33 @@ namespace :compiler do
require "rubinius/code/ast"
end

# TODO: Build this functionality into the compiler
class Rubinius::ToolSets::Build::Compiler::Writer
def run
return @input unless @name

dir = File.dirname(@name)
unless File.directory?(dir)
parts = []

until dir == "/" or dir == "."
parts << dir
dir = File.dirname(dir)
end

parts.reverse_each do |d|
Dir.mkdir d unless File.directory?(d)
end
end

File.open(@name, "ab") do |f|
@processor.new("!RBIX", @signature, @version).encode_to(f, @input)
end

@input
end
end

require File.expand_path("../../kernel/signature", __FILE__)
end

Expand Down

0 comments on commit 0037254

Please sign in to comment.