From 8d97b7a2903e64ad5c8b83660e1fd67faf572f02 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Fri, 3 Jul 2015 12:50:52 -0500 Subject: [PATCH] Update to the libv8 4.5.* build process --- .gitmodules | 12 +++----- ext/libv8/builder.rb | 5 ++-- ext/libv8/patcher.rb | 2 +- lib/libv8/version.rb | 2 +- patches/disable-building-tests.patch | 26 ++++++++-------- patches/link-dependencies.patch | 20 ------------- ...ve-variable-name-conflict-on-freebsd.patch | 30 ------------------- vendor/.gclient | 11 +++++++ vendor/.gclient_entries | 12 ++++++++ vendor/buildtools | 1 - vendor/depot_tools | 1 + vendor/gyp | 1 - vendor/v8 | 2 +- 13 files changed, 48 insertions(+), 77 deletions(-) delete mode 100644 patches/link-dependencies.patch delete mode 100644 patches/resolve-variable-name-conflict-on-freebsd.patch create mode 100644 vendor/.gclient create mode 100644 vendor/.gclient_entries delete mode 160000 vendor/buildtools create mode 160000 vendor/depot_tools delete mode 160000 vendor/gyp diff --git a/.gitmodules b/.gitmodules index 501611d..65c228a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,10 +1,6 @@ [submodule "vendor/v8"] path = vendor/v8 - url = https://github.com/v8/v8.git -[submodule "vendor/gyp"] - path = vendor/gyp - url = https://git.chromium.org/git/external/gyp.git -[submodule "vendor/buildtools"] - path = vendor/buildtools - url = https://chromium.googlesource.com/chromium/buildtools.git - + 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/ext/libv8/builder.rb b/ext/libv8/builder.rb index 528401e..6534f68 100644 --- a/ext/libv8/builder.rb +++ b/ext/libv8/builder.rb @@ -54,8 +54,8 @@ module Libv8 Dir.chdir(File.expand_path('../../../vendor/v8', __FILE__)) do fail 'No compilers available' if @compiler.nil? setup_python! - patch! setup_build_deps! + patch! print_build_info puts 'Beginning compilation. This will take some time.' system "env CXX=#{@compiler} LINK=#{@compiler} #{make} #{make_flags}" @@ -78,7 +78,8 @@ module Libv8 end def setup_build_deps! - `#{make} dependencies` + gclient = File.expand_path('../../../vendor/depot_tools/gclient', __FILE__) + `#{gclient} sync` end private diff --git a/ext/libv8/patcher.rb b/ext/libv8/patcher.rb index d365e42..ff08558 100644 --- a/ext/libv8/patcher.rb +++ b/ext/libv8/patcher.rb @@ -11,7 +11,7 @@ module Libv8 (available_patches - applied_patches).each do |patch| `patch -p1 -N < #{patch}` - fail 'failed to apply patch' unless $?.success? + fail "failed to apply patch #{patch}" unless $?.success? f.puts patch puts "Applying #{patch}" end diff --git a/lib/libv8/version.rb b/lib/libv8/version.rb index 38f5f15..eeafa02 100644 --- a/lib/libv8/version.rb +++ b/lib/libv8/version.rb @@ -1,3 +1,3 @@ module Libv8 - VERSION = "3.27.33.0" + VERSION = "4.5.95.0" end diff --git a/patches/disable-building-tests.patch b/patches/disable-building-tests.patch index cb53540..1854a9b 100644 --- a/patches/disable-building-tests.patch +++ b/patches/disable-building-tests.patch @@ -1,25 +1,27 @@ diff --git a/Makefile b/Makefile -index f49be61..89f0d47 100644 +index 9761265..80169b2 100644 --- a/Makefile +++ b/Makefile -@@ -227,7 +227,7 @@ NACL_ARCHES = nacl_ia32 nacl_x64 - # List of files that trigger Makefile regeneration: - GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \ - build/toolchain.gypi samples/samples.gyp src/d8.gyp \ -- test/cctest/cctest.gyp tools/gyp/v8.gyp -+ tools/gyp/v8.gyp - - # If vtunejit=on, the v8vtune.gyp will be appended. - ifeq ($(vtunejit), on) +@@ -248,8 +248,6 @@ NACL_ARCHES = nacl_ia32 nacl_x64 + GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \ + build/shim_headers.gypi build/features.gypi build/standalone.gypi \ + build/toolchain.gypi build/all.gyp build/mac/asan.gyp \ +- test/cctest/cctest.gyp \ +- test/unittests/unittests.gyp tools/gyp/v8.gyp \ + tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \ + buildtools/third_party/libc++abi/libc++abi.gyp \ + buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \ diff --git a/build/all.gyp b/build/all.gyp -index 3860379..176b60f 100644 +index 4aeb507..1ff2c7a 100644 --- a/build/all.gyp +++ b/build/all.gyp -@@ -10,7 +10,6 @@ +@@ -10,8 +10,6 @@ 'dependencies': [ '../samples/samples.gyp:*', '../src/d8.gyp:d8', - '../test/cctest/cctest.gyp:*', +- '../test/unittests/unittests.gyp:*', ], 'conditions': [ ['component!="shared_library"', { + diff --git a/patches/link-dependencies.patch b/patches/link-dependencies.patch deleted file mode 100644 index b2c5b23..0000000 --- a/patches/link-dependencies.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/Makefile b/Makefile -index f49be61..0626d02 100644 ---- a/Makefile -+++ b/Makefile -@@ -463,13 +463,5 @@ gtags.clean: - # Dependencies. - # Remember to keep these in sync with the DEPS file. - dependencies: -- svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ -- --revision 1831 -- svn checkout --force \ -- https://src.chromium.org/chrome/trunk/deps/third_party/icu46 \ -- third_party/icu --revision 258359 -- ( test -d buildtools || \ -- git clone https://chromium.googlesource.com/chromium/buildtools.git; \ -- cd buildtools; \ -- git fetch origin; \ -- git checkout 5d89977ce55240995d1596fe420b818468f5ec37 ) -+ ( test -h build/gyp || ln -s ../../gyp build/gyp ) -+ ( test -h buildtools || ln -s ../buildtools ) diff --git a/patches/resolve-variable-name-conflict-on-freebsd.patch b/patches/resolve-variable-name-conflict-on-freebsd.patch deleted file mode 100644 index 4ed9da9..0000000 --- a/patches/resolve-variable-name-conflict-on-freebsd.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/src/platform-freebsd.cc b/src/platform-freebsd.cc -index a1a0739..f21e254 100644 ---- a/src/platform-freebsd.cc -+++ b/src/platform-freebsd.cc -@@ -121,10 +121,10 @@ static unsigned StringToLong(char* buffer) { - - - std::vector OS::GetSharedLibraryAddresses() { -- std::vector result; -+ std::vector result2; - static const int MAP_LENGTH = 1024; - int fd = open("/proc/self/maps", O_RDONLY); -- if (fd < 0) return result; -+ if (fd < 0) return result2; - while (true) { - char addr_buffer[11]; - addr_buffer[0] = '0'; -@@ -155,10 +155,10 @@ std::vector OS::GetSharedLibraryAddresses() { - // There may be no filename in this line. Skip to next. - if (start_of_path == NULL) continue; - buffer[bytes_read] = 0; -- result.push_back(SharedLibraryAddress(start_of_path, start, end)); -+ result2.push_back(SharedLibraryAddress(start_of_path, start, end)); - } - close(fd); -- return result; -+ return result2; - } - - diff --git a/vendor/.gclient b/vendor/.gclient new file mode 100644 index 0000000..67e6f82 --- /dev/null +++ b/vendor/.gclient @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000..e4f122c --- /dev/null +++ b/vendor/.gclient_entries @@ -0,0 +1,12 @@ +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/buildtools b/vendor/buildtools deleted file mode 160000 index 5d89977..0000000 --- a/vendor/buildtools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5d89977ce55240995d1596fe420b818468f5ec37 diff --git a/vendor/depot_tools b/vendor/depot_tools new file mode 160000 index 0000000..faa4b4e --- /dev/null +++ b/vendor/depot_tools @@ -0,0 +1 @@ +Subproject commit faa4b4eb51757e38879a34c4005c4e56c2d360ad diff --git a/vendor/gyp b/vendor/gyp deleted file mode 160000 index f7bc250..0000000 --- a/vendor/gyp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f7bc250ccc4d619a1cf238db87e5979f89ff36d7 diff --git a/vendor/v8 b/vendor/v8 index 1d34d0a..b0493ed 160000 --- a/vendor/v8 +++ b/vendor/v8 @@ -1 +1 @@ -Subproject commit 1d34d0ae82dd018e86e7d6184e4026657d19755a +Subproject commit b0493ed16c0b363a0e92bf4a790d4fd851c74e70