From 33b71c76d3f191c1ca83c3b31d7d0ba66af4ec74 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Fri, 3 Jul 2015 14:55:40 -0500 Subject: [PATCH] move to full checkout of the v8 source --- .gitignore | 3 +++ .gitmodules | 3 --- Rakefile | 3 ++- ext/libv8/builder.rb | 31 ++++++++++++++++++++++++++++--- libv8.gemspec | 2 +- vendor/.gclient | 11 ----------- vendor/.gclient_entries | 12 ------------ vendor/v8 | 1 - 8 files changed, 34 insertions(+), 32 deletions(-) delete mode 100644 vendor/.gclient delete mode 100644 vendor/.gclient_entries delete mode 160000 vendor/v8 diff --git a/.gitignore b/.gitignore index 0ac7805..92449eb 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ lib/libv8/VERSION /ext/libv8/.location.yml /release/**/libv8 /release/**/.vagrant +/vendor/.gclient +/vendor/.gclient_entries +/vendor/v8/ diff --git a/.gitmodules b/.gitmodules index 65c228a..37ac743 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "vendor/v8"] - path = vendor/v8 - url = https://chromium.googlesource.com/v8/v8.git [submodule "vendor/depot_tools"] path = vendor/depot_tools url = https://chromium.googlesource.com/chromium/tools/depot_tools.git diff --git a/Rakefile b/Rakefile index 357c5f4..4d176da 100644 --- a/Rakefile +++ b/Rakefile @@ -74,8 +74,9 @@ end desc "clean up artifacts of the build" task :clean => [:clean_submodules] do sh "rm -rf pkg" + sh "rm -rf vendor/v8" sh "git clean -dxf" end task :default => [:compile, :spec] -task :build => [:clean_submodules] +task :build => [:clean] diff --git a/ext/libv8/builder.rb b/ext/libv8/builder.rb index 6534f68..60eeb3e 100644 --- a/ext/libv8/builder.rb +++ b/ext/libv8/builder.rb @@ -1,4 +1,8 @@ +unless $:.include? File.expand_path("../../../lib", __FILE__) + $:.unshift File.expand_path("../../../lib", __FILE__) +end require 'mkmf' +require 'libv8/version' require File.expand_path '../compiler', __FILE__ require File.expand_path '../arch', __FILE__ require File.expand_path '../make', __FILE__ @@ -51,10 +55,10 @@ module Libv8 end def build_libv8! + setup_python! + setup_build_deps! Dir.chdir(File.expand_path('../../../vendor/v8', __FILE__)) do fail 'No compilers available' if @compiler.nil? - setup_python! - setup_build_deps! patch! print_build_info puts 'Beginning compilation. This will take some time.' @@ -77,9 +81,30 @@ module Libv8 end end + ## + # The release tag to checkout. If this is version 4.5.95.0 of the libv8 gem, + # then this will be 4.5.95 + # + def source_version + Libv8::VERSION.gsub(/\.\d+$/, '') + end + + ## + # Checkout all of the V8 source and its dependencies using the + # chromium depot tools. + # + # https://chromium.googlesource.com/v8/v8.git#Getting-the-Code + # def setup_build_deps! + fetch = File.expand_path('../../../vendor/depot_tools/fetch', __FILE__) gclient = File.expand_path('../../../vendor/depot_tools/gclient', __FILE__) - `#{gclient} sync` + Dir.chdir(File.expand_path('../../../vendor', __FILE__)) do + `#{fetch} v8` + Dir.chdir('v8') do + `git checkout #{source_version}` + `#{gclient} sync` + end + end end private diff --git a/libv8.gemspec b/libv8.gemspec index 6254652..03830e0 100644 --- a/libv8.gemspec +++ b/libv8.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| submodules = `git submodule --quiet foreach 'echo $path'`.split("\n").map(&:chomp) submodules.each do |submodule| s.files += Dir.chdir(submodule) do - `git ls-files`.split("\n").reject {|f| f =~ /^out|^test|^benchmarks/}.map {|f| "#{submodule}/#{f}"} + `git ls-files`.split("\n").map {|f| "#{submodule}/#{f}"} end end diff --git a/vendor/.gclient b/vendor/.gclient deleted file mode 100644 index 67e6f82..0000000 --- a/vendor/.gclient +++ /dev/null @@ -1,11 +0,0 @@ -solutions = [ - { "name" : "v8", - "url" : "https://chromium.googlesource.com/v8/v8.git", - "deps_file" : "DEPS", - "managed" : True, - "custom_deps" : { - }, - "safesync_url": "", - }, -] -cache_dir = None diff --git a/vendor/.gclient_entries b/vendor/.gclient_entries deleted file mode 100644 index e4f122c..0000000 --- a/vendor/.gclient_entries +++ /dev/null @@ -1,12 +0,0 @@ -entries = { - 'v8': 'https://chromium.googlesource.com/v8/v8.git', - 'v8/build/gyp': 'https://chromium.googlesource.com/external/gyp.git@5122240c5e5c4d8da12c543d82b03d6089eb77c5', - 'v8/buildtools': 'https://chromium.googlesource.com/chromium/buildtools.git@ecc8e253abac3b6186a97573871a084f4c0ca3ae', - 'v8/testing/gmock': 'https://chromium.googlesource.com/external/googlemock.git@29763965ab52f24565299976b936d1265cb6a271', - 'v8/testing/gtest': 'https://chromium.googlesource.com/external/googletest.git@23574bf2333f834ff665f894c97bef8a5b33a0a9', - 'v8/third_party/icu': 'https://chromium.googlesource.com/chromium/deps/icu.git@7fe225d77f307fdbe24695179a84336ef95c1253', - 'v8/tools/clang': 'https://chromium.googlesource.com/chromium/src/tools/clang.git@73ec8804ed395b0886d6edf82a9f33583f4a7902', - 'v8/buildtools/clang_format/script': 'https://chromium.googlesource.com/chromium/llvm-project/cfe/tools/clang-format.git@81edd558fea5dd7855d67a1dc61db34ae8c1fd63', - 'v8/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxx.git@48198f9110397fff47fe7c37cbfa296be7d44d3d', - 'v8/buildtools/third_party/libc++abi/trunk': 'https://chromium.googlesource.com/chromium/llvm-project/libcxxabi.git@4ad1009ab3a59fa7a6896d74d5e4de5885697f95', -} diff --git a/vendor/v8 b/vendor/v8 deleted file mode 160000 index b0493ed..0000000 --- a/vendor/v8 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b0493ed16c0b363a0e92bf4a790d4fd851c74e70