Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Ensure that bootstrap Melbourne is built for bootstrap ruby.

  • Loading branch information...
commit f68acf7948f36fa68f543186b79a7b4629a03eda 1 parent bb535a4
@brixen brixen authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 rakelib/extensions.rake
23 rakelib/extensions.rake
@@ -9,10 +9,14 @@
desc "Build extensions from lib/ext"
task :extensions
+def clean_extension(name)
+ rm_f FileList["lib/ext/#{name}/*.{o,#{$dlext}}"], :verbose => $verbose
namespace :extensions do
desc "Clean all lib/ext files"
task :clean do
- rm_f FileList["lib/ext/**/*.{o,#{$dlext}}"], :verbose => $verbose
+ clean_extension("**")
# TODO: implement per extension cleaning. This hack is for
# openssl and dl, which use extconf.rb and create Makefile.
rm_f FileList["lib/ext/**/Makefile"], :verbose => $verbose
@@ -83,6 +87,23 @@ def compile_ext(name, opts={})
Rake::Task[:extensions].prerequisites << "extensions:#{task_name}"
+# TODO: we must completely rebuild the bootstrap version of Melbourne if the
+# configured build ruby changes. We add the version to be extra sure.
+build_ruby = "lib/ext/melbourne/.build_ruby"
+build_version = "#{BUILD_CONFIG[:build_ruby]}:#{RUBY_VERSION}"
+if File.exists?(build_ruby)
+, "rb") do |f|
+ clean_extension("melbourne/**") if != build_version
+ end
+ clean_extension("melbourne/**")
+, "wb") do |f|
+ f.puts build_version
compile_ext "bigdecimal"
compile_ext "readline" if BUILD_CONFIG[:defines].include? "HAS_READLINE"
compile_ext "digest"
Please sign in to comment.
Something went wrong with that request. Please try again.