libv8 6.3.292.48.1 → 6.7.288.46.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +10 -34
  3. data/CHANGELOG.md +16 -0
  4. data/README.md +9 -63
  5. data/Rakefile +2 -2
  6. data/ext/libv8/builder.rb +22 -87
  7. data/ext/libv8/extconf.rb +1 -1
  8. data/ext/libv8/paths.rb +5 -18
  9. data/lib/libv8/version.rb +1 -1
  10. data/spec/location_spec.rb +1 -2
  11. data/spec/spec_helper.rb +0 -1
  12. data/vendor/depot_tools/.gitattributes +1 -2
  13. data/vendor/depot_tools/OWNERS +0 -1
  14. data/vendor/depot_tools/PRESUBMIT.py +11 -6
  15. data/vendor/depot_tools/README.md +0 -1
  16. data/vendor/depot_tools/WATCHLISTS +0 -6
  17. data/vendor/depot_tools/auth.py +129 -87
  18. data/vendor/depot_tools/autoninja +11 -1
  19. data/vendor/depot_tools/autoninja.bat +7 -1
  20. data/vendor/depot_tools/autoninja.py +14 -6
  21. data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
  22. data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +1 -1
  23. data/vendor/depot_tools/cipd +23 -2
  24. data/vendor/depot_tools/cipd.bat +2 -2
  25. data/vendor/depot_tools/cipd_client_version +1 -1
  26. data/vendor/depot_tools/cipd_manifest.txt +17 -7
  27. data/vendor/depot_tools/cit.py +7 -6
  28. data/vendor/depot_tools/cpplint.py +195 -35
  29. data/vendor/depot_tools/detect_host_arch.py +51 -0
  30. data/vendor/depot_tools/download_from_google_storage.py +85 -26
  31. data/vendor/depot_tools/fetch.py +11 -6
  32. data/vendor/depot_tools/fetch_configs/chromium.py +0 -1
  33. data/vendor/depot_tools/fetch_configs/goma_client.py +41 -0
  34. data/vendor/depot_tools/fetch_configs/infra.py +0 -1
  35. data/vendor/depot_tools/fetch_configs/infra_internal.py +0 -1
  36. data/vendor/depot_tools/gclient-new-workdir.py +4 -0
  37. data/vendor/depot_tools/gclient.py +732 -476
  38. data/vendor/depot_tools/gclient_eval.py +569 -58
  39. data/vendor/depot_tools/gclient_scm.py +258 -46
  40. data/vendor/depot_tools/gclient_utils.py +17 -1
  41. data/vendor/depot_tools/gerrit_util.py +46 -13
  42. data/vendor/depot_tools/git_cache.py +0 -2
  43. data/vendor/depot_tools/git_cl.py +176 -335
  44. data/vendor/depot_tools/git_common.py +19 -16
  45. data/vendor/depot_tools/git_footers.py +19 -5
  46. data/vendor/depot_tools/git_hyper_blame.py +9 -3
  47. data/vendor/depot_tools/git_new_branch.py +15 -3
  48. data/vendor/depot_tools/git_upstream_diff.py +7 -2
  49. data/vendor/depot_tools/gsutil.py +1 -1
  50. data/vendor/depot_tools/infra/config/cq.cfg +1 -2
  51. data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
  52. data/vendor/depot_tools/luci-auth +13 -0
  53. data/vendor/depot_tools/luci-auth.bat +8 -0
  54. data/vendor/depot_tools/man/html/depot_tools.html +0 -8
  55. data/vendor/depot_tools/man/html/git-upstream-diff.html +20 -3
  56. data/vendor/depot_tools/man/man1/git-upstream-diff.1 +27 -6
  57. data/vendor/depot_tools/man/man7/depot_tools.7 +0 -5
  58. data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +2 -2
  59. data/vendor/depot_tools/man/src/git-upstream-diff.txt +21 -3
  60. data/vendor/depot_tools/man/src/make_docs.sh +6 -0
  61. data/vendor/depot_tools/my_activity.py +283 -93
  62. data/vendor/depot_tools/owners.py +9 -4
  63. data/vendor/depot_tools/owners_finder.py +7 -3
  64. data/vendor/depot_tools/post_build_ninja_summary.py +322 -0
  65. data/vendor/depot_tools/presubmit_canned_checks.py +91 -106
  66. data/vendor/depot_tools/presubmit_support.py +219 -157
  67. data/vendor/depot_tools/prpc +13 -0
  68. data/vendor/depot_tools/prpc.bat +8 -0
  69. data/vendor/depot_tools/recipes/OWNERS +3 -1
  70. data/vendor/depot_tools/recipes/README.recipes.md +70 -111
  71. data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +12 -5
  72. data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +36 -68
  73. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +0 -8
  74. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange_oauth2_json.json → no_apply_patch_on_gclient.json} +64 -10
  75. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{no_shallow.json → shallow.json} +1 -1
  76. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob.json +0 -8
  77. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_empty_revision.json +0 -8
  78. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +0 -6
  79. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +0 -7
  80. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +0 -6
  81. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +44 -0
  82. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange_oauth2_buildbot.json → tryjob_gerrit_branch_heads.json} +51 -5
  83. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +0 -8
  84. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +48 -8
  85. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +19 -26
  86. data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +193 -155
  87. data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +9 -0
  88. data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +2 -7
  89. data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +31 -5
  90. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +37 -19
  91. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +37 -19
  92. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +37 -19
  93. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +37 -23
  94. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +4 -0
  95. data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +40 -8
  96. data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +3 -3
  97. data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +6 -3
  98. data/vendor/depot_tools/recipes/recipe_modules/gitiles/OWNERS +0 -1
  99. data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +0 -1
  100. data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +7 -56
  101. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +0 -1
  102. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +15 -16
  103. data/vendor/depot_tools/recipes/recipes.py +4 -2
  104. data/vendor/depot_tools/recipes/trigger_recipe_roller.txt +12 -0
  105. data/vendor/depot_tools/roll_dep.py +35 -37
  106. data/vendor/depot_tools/support/chromite_wrapper +1 -1
  107. data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +3 -3
  108. data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +2 -2
  109. data/vendor/depot_tools/third_party/logilab/astroid/astpeephole.py +86 -0
  110. data/vendor/depot_tools/third_party/logilab/astroid/bases.py +53 -66
  111. data/vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py +31 -31
  112. data/vendor/depot_tools/third_party/logilab/astroid/brain/pynose.py +39 -16
  113. data/vendor/depot_tools/third_party/logilab/astroid/brain/pysix_moves.py +225 -189
  114. data/vendor/depot_tools/third_party/logilab/astroid/inference.py +45 -41
  115. data/vendor/depot_tools/third_party/logilab/astroid/manager.py +1 -0
  116. data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +2 -2
  117. data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +3 -2
  118. data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +1 -0
  119. data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +57 -3
  120. data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +1 -1
  121. data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +21 -1
  122. data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +58 -33
  123. data/vendor/depot_tools/third_party/pylint/README.chromium +2 -2
  124. data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +3 -3
  125. data/vendor/depot_tools/third_party/pylint/checkers/base.py +6 -18
  126. data/vendor/depot_tools/third_party/pylint/checkers/classes.py +64 -63
  127. data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +25 -57
  128. data/vendor/depot_tools/third_party/pylint/checkers/format.py +14 -10
  129. data/vendor/depot_tools/third_party/pylint/checkers/python3.py +142 -37
  130. data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +10 -1
  131. data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +50 -7
  132. data/vendor/depot_tools/third_party/pylint/checkers/strings.py +1 -1
  133. data/vendor/depot_tools/third_party/pylint/epylint.py +2 -1
  134. data/vendor/depot_tools/third_party/pylint/gui.py +1 -1
  135. data/vendor/depot_tools/third_party/pylint/lint.py +88 -23
  136. data/vendor/depot_tools/third_party/pylint/reporters/html.py +37 -5
  137. data/vendor/depot_tools/third_party/pylint/testutils.py +1 -1
  138. data/vendor/depot_tools/third_party/pylint/utils.py +5 -0
  139. data/vendor/depot_tools/vpython +31 -1
  140. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +35 -2
  141. data/vendor/depot_tools/win_toolchain/package_from_installed.py +0 -15
  142. data/vendor/depot_tools/yapf +17 -0
  143. data/vendor/depot_tools/{apply_issue.bat → yapf.bat} +2 -2
  144. metadata +16 -58
  145. data/ext/libv8/compiler.rb +0 -39
  146. data/ext/libv8/compiler/apple_llvm.rb +0 -22
  147. data/ext/libv8/compiler/clang.rb +0 -22
  148. data/ext/libv8/compiler/gcc.rb +0 -22
  149. data/ext/libv8/compiler/generic_compiler.rb +0 -66
  150. data/ext/libv8/make.rb +0 -13
  151. data/ext/libv8/patcher.rb +0 -21
  152. data/patches/0001-Build-a-standalone-static-library.patch +0 -26
  153. data/patches/0002-Don-t-compile-unnecessary-stuff.patch +0 -85
  154. data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +0 -25
  155. data/patches/0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch +0 -25
  156. data/patches/0005-Remove-TryInstallOptimizedCode.patch +0 -321
  157. data/patches/mingw-generate-makefiles.sh +0 -97
  158. data/spec/compiler/apple_llvm_spec.rb +0 -37
  159. data/spec/compiler/clang_spec.rb +0 -37
  160. data/spec/compiler/gcc_spec.rb +0 -37
  161. data/spec/compiler/generic_compiler_spec.rb +0 -50
  162. data/spec/compiler_spec.rb +0 -45
  163. data/spec/support/compiler_helpers.rb +0 -47
  164. data/vendor/depot_tools/apply_issue +0 -8
  165. data/vendor/depot_tools/apply_issue.py +0 -315
  166. data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +0 -815
  167. data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +0 -80
  168. data/vendor/depot_tools/man/src/_git-cherry-pick-upload_desc.helper.txt +0 -1
  169. data/vendor/depot_tools/man/src/git-cherry-pick-upload.demo.1.sh +0 -17
  170. data/vendor/depot_tools/man/src/git-cherry-pick-upload.txt +0 -35
  171. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2.json +0 -8
  172. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2_json_win.json +0 -196
  173. data/vendor/depot_tools/recipes/recipe_modules/rietveld/__init__.py +0 -6
  174. data/vendor/depot_tools/recipes/recipe_modules/rietveld/api.py +0 -97
  175. data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/basic.json +0 -8
  176. data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/buildbot.json +0 -30
  177. data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/no_auth.json +0 -27
  178. data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.py +0 -38
  179. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_rietveld_patch.json +0 -69
  180. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_rietveld_patch_new.json +0 -69
  181. data/vendor/depot_tools/third_party/cq_client/OWNERS +0 -2
  182. data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +0 -2
  183. data/vendor/depot_tools/third_party/cq_client/README.md +0 -59
  184. data/vendor/depot_tools/third_party/cq_client/__init__.py +0 -3
  185. data/vendor/depot_tools/third_party/cq_client/v1/__init__.py +0 -3
  186. data/vendor/depot_tools/third_party/cq_client/v1/cq.pb.go +0 -810
  187. data/vendor/depot_tools/third_party/cq_client/v1/cq.proto +0 -281
  188. data/vendor/depot_tools/third_party/cq_client/v1/cq_pb2.py +0 -794
  189. data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_both.cfg +0 -71
  190. data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_gerrit.cfg +0 -58
  191. data/vendor/depot_tools/third_party/cq_client/v1/testdata/cq_rietveld.cfg +0 -60
  192. data/vendor/depot_tools/third_party/cq_client/v2/__init__.py +0 -3
  193. data/vendor/depot_tools/third_party/cq_client/v2/cq.pb.go +0 -792
  194. data/vendor/depot_tools/third_party/cq_client/v2/cq.proto +0 -270
  195. data/vendor/depot_tools/third_party/cq_client/v2/cq_pb2.py +0 -841
@@ -1,97 +0,0 @@
1
- #!/bin/sh
2
- # Copyright 2013 the V8 project authors. All rights reserved.
3
- # Redistribution and use in source and binary forms, with or without
4
- # modification, are permitted provided that the following conditions are
5
- # met:
6
- #
7
- # * Redistributions of source code must retain the above copyright
8
- # notice, this list of conditions and the following disclaimer.
9
- # * Redistributions in binary form must reproduce the above
10
- # copyright notice, this list of conditions and the following
11
- # disclaimer in the documentation and/or other materials provided
12
- # with the distribution.
13
- # * Neither the name of Google Inc. nor the names of its
14
- # contributors may be used to endorse or promote products derived
15
- # from this software without specific prior written permission.
16
- #
17
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
- # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
- # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
-
29
- # Monkey-patch GYP.
30
- cat > build/gyp/gyp.mingw << EOF
31
- #!/usr/bin/env python
32
-
33
- # Copyright (c) 2009 Google Inc. All rights reserved.
34
- # Use of this source code is governed by a BSD-style license that can be
35
- # found in the LICENSE file.
36
-
37
- import sys
38
-
39
- # TODO(mark): sys.path manipulation is some temporary testing stuff.
40
- try:
41
- import gyp
42
- except ImportError, e:
43
- import os.path
44
- sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
45
- import gyp
46
-
47
- def MonkeyBuildFileTargets(target_list, build_file):
48
- """From a target_list, returns the subset from the specified build_file.
49
- """
50
- build_file = build_file.replace('/', '\\\\')
51
- return [p for p in target_list if gyp.common.BuildFile(p) == build_file]
52
- gyp.common.BuildFileTargets = MonkeyBuildFileTargets
53
-
54
- import gyp.generator.make
55
- import os
56
- def Monkey_ITIP(self):
57
- """Returns the location of the final output for an installable target."""
58
- sep = os.path.sep
59
- # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files
60
- # rely on this. Emulate this behavior for mac.
61
- if (self.type == 'shared_library' and
62
- (self.flavor != 'mac' or self.toolset != 'target')):
63
- # Install all shared libs into a common directory (per toolset) for
64
- # convenient access with LD_LIBRARY_PATH.
65
- return '\$(builddir)%slib.%s%s%s' % (sep, self.toolset, sep, self.alias)
66
- return '\$(builddir)' + sep + self.alias
67
- gyp.generator.make.MakefileWriter._InstallableTargetInstallPath = Monkey_ITIP
68
-
69
- if __name__ == '__main__':
70
- sys.exit(gyp.main(sys.argv[1:]))
71
- EOF
72
-
73
- # Delete old generated Makefiles.
74
- find out -name '*.mk' -or -name 'Makefile*' -exec rm {} \;
75
-
76
- # Generate fresh Makefiles.
77
- mv build/gyp/gyp build/gyp/gyp.original
78
- mv build/gyp/gyp.mingw build/gyp/gyp
79
- make out/Makefile.ia32 out/Makefile.x64
80
- mv build/gyp/gyp build/gyp/gyp.mingw
81
- mv build/gyp/gyp.original build/gyp/gyp
82
-
83
- # Patch generated Makefiles: replace most backslashes with forward slashes,
84
- # fix library names in linker flags.
85
- FILES=$(find out -name '*.mk' -or -name 'Makefile*')
86
- for F in $FILES ; do
87
- echo "Patching $F..."
88
- cp $F $F.orig
89
- cat $F.orig \
90
- | sed -e 's|\([)a-zA-Z0-9]\)\\\([a-zA-Z]\)|\1/\2|g' \
91
- -e 's|\([)a-zA-Z0-9]\)\\\\\([a-zA-Z]\)|\1/\2|g' \
92
- -e 's|'%s/n'|'%s\\\\n'|g' \
93
- -e 's|-lwinmm\.lib|-lwinmm|g' \
94
- -e 's|-lws2_32\.lib|-lws2_32|g' \
95
- > $F
96
- rm $F.orig
97
- done
@@ -1,37 +0,0 @@
1
- require 'spec_helper'
2
- require 'compiler'
3
-
4
- module Libv8::Compiler
5
- describe AppleLLVM do
6
- subject { AppleLLVM.new 'c++' }
7
-
8
- describe '#name' do
9
- it 'returns Apple LLVM' do
10
- expect(subject.name).to eq 'Apple LLVM'
11
- end
12
- end
13
-
14
- describe '#version' do
15
- it 'returns the version of the compiler' do
16
- stub_as_available 'c++', :apple_llvm, '4.20'
17
- expect(subject.version).to eq '4.20'
18
- end
19
- end
20
-
21
- describe '#compatible?' do
22
- context 'when Apple LLVM\'s version is >= 4.3' do
23
- it 'returns true' do
24
- stub_as_available 'c++', :apple_llvm, '4.20'
25
- expect(subject).to be_compatible
26
- end
27
- end
28
-
29
- context 'when Apple LLVM\'s version is < 4.3' do
30
- it 'returns false' do
31
- stub_as_available 'c++', :apple_llvm, '4.2'
32
- expect(subject).to_not be_compatible
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +0,0 @@
1
- require 'spec_helper'
2
- require 'compiler'
3
-
4
- module Libv8::Compiler
5
- describe Clang do
6
- subject { Clang.new 'c++' }
7
-
8
- describe '#name' do
9
- it 'returns clang' do
10
- expect(subject.name).to eq 'clang'
11
- end
12
- end
13
-
14
- describe '#version' do
15
- it 'returns the version of the compiler' do
16
- stub_as_available 'c++', :clang, '3.4.1'
17
- expect(subject.version).to eq '3.4.1'
18
- end
19
- end
20
-
21
- describe '#compatible?' do
22
- context 'when clang\'s version is >= 3.1' do
23
- it 'returns true' do
24
- stub_as_available 'c++', :clang, '3.4.1'
25
- expect(subject).to be_compatible
26
- end
27
- end
28
-
29
- context 'when clang\'s version is < 3.1' do
30
- it 'returns false' do
31
- stub_as_available 'c++', :clang, '3.0.9'
32
- expect(subject).to_not be_compatible
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,37 +0,0 @@
1
- require 'spec_helper'
2
- require 'compiler'
3
-
4
- module Libv8::Compiler
5
- describe GCC do
6
- subject { GCC.new 'c++' }
7
-
8
- describe '#name' do
9
- it 'returns GCC' do
10
- expect(subject.name).to eq 'GCC'
11
- end
12
- end
13
-
14
- describe '#version' do
15
- it 'returns the version of the compiler' do
16
- stub_as_available 'c++', :gcc, '4.9.0'
17
- expect(subject.version).to eq '4.9.0'
18
- end
19
- end
20
-
21
- describe '#compatible?' do
22
- context 'when GCC\'s version is >= 4.8' do
23
- it 'returns true' do
24
- stub_as_available 'c++', :gcc, '4.9.0'
25
- expect(subject).to be_compatible
26
- end
27
- end
28
-
29
- context 'when GCC\'s version is < 4.3' do
30
- it 'returns false' do
31
- stub_as_available 'c++', :gcc, '4.2.1-freebsd'
32
- expect(subject).to_not be_compatible
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,50 +0,0 @@
1
- require 'spec_helper'
2
- require 'compiler'
3
-
4
- module Libv8::Compiler
5
- describe GenericCompiler do
6
- subject { GenericCompiler.new 'c++' }
7
-
8
- describe '#name' do
9
- it 'returns just the base name of the command' do
10
- expect(GenericCompiler.new('/usr/sbin/c++').name).to eq 'c++'
11
- end
12
- end
13
-
14
- describe '#to_s' do
15
- it 'should be the command used to call the compiler' do
16
- expect(subject.to_s).to eq 'c++'
17
- end
18
- end
19
-
20
- describe '#version' do
21
- it 'returns the version of the compiler' do
22
- stub_as_available 'c++', :clang, '3.4.1'
23
- expect(subject.version).to eq '3.4.1'
24
- end
25
-
26
- it 'returns nil when determining the version fails' do
27
- stub_as_unavailable 'c++'
28
- expect(subject.version).to be_nil
29
- end
30
- end
31
-
32
- describe '#target' do
33
- it 'returns the target of the compiler' do
34
- stub_as_available 'c++', :clang, '3.4.1'
35
- expect(subject.target).to eq 'x86_64-unknown-linux-gnu'
36
- end
37
-
38
- it 'returns nil when determining the target fails' do
39
- stub_as_unavailable 'c++'
40
- expect(subject.target).to be_nil
41
- end
42
- end
43
-
44
- describe '#compatible?' do
45
- it 'returns false' do
46
- expect(GenericCompiler.new('c++')).to_not be_compatible
47
- end
48
- end
49
- end
50
- end
@@ -1,45 +0,0 @@
1
- require 'spec_helper'
2
- require 'compiler'
3
-
4
- module Libv8
5
- describe Compiler do
6
- describe '::type_of' do
7
- it 'recognises correctly GCC' do
8
- stub_as_available 'c++', :gcc, '4.9.0'
9
- expect(Compiler.type_of('c++').new('c++')).to be_a Compiler::GCC
10
-
11
- stub_as_available 'g++', :gcc, '4.2.1-freebsd'
12
- expect(Compiler.type_of('g++').new('g++')).to be_a Compiler::GCC
13
- end
14
-
15
- it 'recognises correctly Clang' do
16
- stub_as_available 'c++', :clang, '3.4.1'
17
- expect(Compiler.type_of('c++').new('c++')).to be_a Compiler::Clang
18
-
19
- stub_as_available 'freebsd-clang++', :clang, '3.3-freebsd'
20
- expect(Compiler.type_of('freebsd-clang++').new('freebsd-clang++')).to be_a Compiler::Clang
21
- end
22
-
23
- it 'recognises correctly Apple\'s LLVM' do
24
- stub_as_available 'c++', :apple_llvm, '4.20'
25
- expect(Compiler.type_of('c++').new('c++')).to be_a Compiler::AppleLLVM
26
- end
27
- end
28
-
29
- describe '::version_string_of' do
30
- context 'when calling the compiler command succedes' do
31
- it 'returns the version string of the compiler' do
32
- stub_as_available 'c++', :clang, '3.4.1'
33
- expect(Compiler.version_string_of('c++')).to eq version_output_of(:clang, '3.4.1')
34
- end
35
- end
36
-
37
- context 'when calling the compiler command fails' do
38
- it 'raises an exception' do
39
- stub_as_unavailable 'c++'
40
- expect { Compiler.version_string_of('c++') }.to raise_exception(RuntimeError, /Could not get version string of compiler/)
41
- end
42
- end
43
- end
44
- end
45
- end
@@ -1,47 +0,0 @@
1
- module CompilerHelpers
2
- VERSION_OUTPUTS = {
3
- :gcc => {
4
- "4.2.1-freebsd" => %Q{Using built-in specs.\nTarget: i386-undermydesk-freebsd\nConfigured with: FreeBSD/i386 system compiler\nThread model: posix\ngcc version 4.2.1 20070831 patched [FreeBSD]\n},
5
- "4.9.0" => %Q{Using built-in specs.\nCOLLECT_GCC=c++\nCOLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper\nTarget: x86_64-unknown-linux-gnu\nConfigured with: /build/gcc-multilib/src/gcc-4.9-20140604/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-cloog-version-check --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-multilib --disable-werror --enable-checking=release\nThread model: posix\ngcc version 4.9.0 20140604 (prerelease) (GCC)\n}
6
- },
7
- :clang => {
8
- "3.0.9" => %Q{clang version 3.0.9 (tags/RELEASE_34/dot1-final)\nTarget: x86_64-unknown-linux-gnu\nThread model: posix\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\nSelected GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\n},
9
- "3.3-freebsd" => %Q{FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610\nTarget: i386-unknown-freebsd9.2\nThread model: posix},
10
- "3.4.1" => %Q{clang version 3.4.1 (tags/RELEASE_34/dot1-final)\nTarget: x86_64-unknown-linux-gnu\nThread model: posix\nFound candidate GCC installation: /usr/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0\nFound candidate GCC installation: /usr/lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\nSelected GCC installation: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.9.0\n},
11
- },
12
- :apple_llvm => {
13
- '4.20' => %Q{Configured with: --prefix=/Applications/Xcode.app/Contents/Developer//usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1\nApple LLVM version 4.20 (clang-503.0.38) (based on LLVM 3.4svn)\nTarget: x86_64-apple-darwin14.0.0\nThread model: posix\n},
14
- '4.2' => %Q{Configured with: --prefix=/Applications/Xcode.app/Contents/Developer//usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1\nApple LLVM version 4.2 (clang-503.0.38) (based on LLVM 3.4svn)\nTarget: x86_64-apple-darwin14.0.0\nThread model: posix\n}
15
- }
16
- }
17
-
18
- def version_output_of(name, version)
19
- VERSION_OUTPUTS[name][version]
20
- end
21
-
22
- def success_status
23
- double :success? => true
24
- end
25
-
26
- def failure_status
27
- double :success? => false
28
- end
29
-
30
- def stub_shell_command(command, output, status)
31
- allow(Libv8::Compiler).to receive(:execute_command).with(command) do
32
- double :output => output, :status => status
33
- end
34
- end
35
-
36
- def stub_as_available(command, name, version)
37
- stub_shell_command "env LC_ALL=C LANG=C #{command} -v 2>&1", version_output_of(name, version), success_status
38
- end
39
-
40
- def stub_as_unavailable(command)
41
- stub_shell_command(/^env LC_ALL=C LANG=C #{Regexp.escape(command)}/, '', failure_status)
42
- end
43
- end
44
-
45
- RSpec.configure do |c|
46
- c.include CompilerHelpers
47
- end
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3
- # Use of this source code is governed by a BSD-style license that can be
4
- # found in the LICENSE file.
5
-
6
- base_dir=$(dirname "$0")
7
-
8
- PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/apply_issue.py" "$@"
@@ -1,315 +0,0 @@
1
- #!/usr/bin/env python
2
- # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3
- # Use of this source code is governed by a BSD-style license that can be
4
- # found in the LICENSE file.
5
-
6
- """Applies an issue from Rietveld.
7
- """
8
- import json
9
- import logging
10
- import optparse
11
- import os
12
- import subprocess
13
- import sys
14
- import urllib2
15
-
16
-
17
- import annotated_gclient
18
- import auth
19
- import checkout
20
- import fix_encoding
21
- import gclient_utils
22
- import rietveld
23
- import scm
24
-
25
- BASE_DIR = os.path.dirname(os.path.abspath(__file__))
26
-
27
-
28
- RETURN_CODE_OK = 0
29
- RETURN_CODE_OTHER_FAILURE = 1 # any other failure, likely patch apply one.
30
- RETURN_CODE_ARGPARSE_FAILURE = 2 # default in python.
31
- RETURN_CODE_INFRA_FAILURE = 3 # considered as infra failure.
32
-
33
-
34
- class Unbuffered(object):
35
- """Disable buffering on a file object."""
36
- def __init__(self, stream):
37
- self.stream = stream
38
-
39
- def write(self, data):
40
- self.stream.write(data)
41
- self.stream.flush()
42
-
43
- def __getattr__(self, attr):
44
- return getattr(self.stream, attr)
45
-
46
-
47
- def _get_arg_parser():
48
- parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
49
- parser.add_option(
50
- '-v', '--verbose', action='count', default=0,
51
- help='Prints debugging infos')
52
- parser.add_option(
53
- '-e', '--email',
54
- help='Email address to access rietveld. If not specified, anonymous '
55
- 'access will be used.')
56
- parser.add_option(
57
- '-E', '--email-file',
58
- help='File containing the email address to access rietveld. '
59
- 'If not specified, anonymous access will be used.')
60
- parser.add_option(
61
- '-k', '--private-key-file',
62
- help='Path to file containing a private key in p12 format for OAuth2 '
63
- 'authentication with "notasecret" password (as generated by Google '
64
- 'Cloud Console).')
65
- parser.add_option(
66
- '-i', '--issue', type='int', help='Rietveld issue number')
67
- parser.add_option(
68
- '-p', '--patchset', type='int', help='Rietveld issue\'s patchset number')
69
- parser.add_option(
70
- '-r',
71
- '--root_dir',
72
- default=os.getcwd(),
73
- help='Root directory to apply the patch')
74
- parser.add_option(
75
- '-s',
76
- '--server',
77
- default='http://codereview.chromium.org',
78
- help='Rietveld server')
79
- parser.add_option('--no-auth', action='store_true',
80
- help='Do not attempt authenticated requests.')
81
- parser.add_option('--revision-mapping', default='{}',
82
- help='When running gclient, annotate the got_revisions '
83
- 'using the revision-mapping.')
84
- parser.add_option('-f', '--force', action='store_true',
85
- help='Really run apply_issue, even if .update.flag '
86
- 'is detected.')
87
- parser.add_option('-b', '--base_ref', help='DEPRECATED do not use.')
88
- parser.add_option('--whitelist', action='append', default=[],
89
- help='Patch only specified file(s).')
90
- parser.add_option('--blacklist', action='append', default=[],
91
- help='Don\'t patch specified file(s).')
92
- parser.add_option('-d', '--ignore_deps', action='store_true',
93
- help='Don\'t run gclient sync on DEPS changes.')
94
- parser.add_option('--extra_patchlevel', type='int',
95
- help='Number of directories the patch level number should '
96
- 'be incremented (useful for patches from repos with '
97
- 'different directory hierarchies).')
98
-
99
- auth.add_auth_options(parser)
100
- return parser
101
-
102
-
103
- def main():
104
- # TODO(pgervais,tandrii): split this func, it's still too long.
105
- sys.stdout = Unbuffered(sys.stdout)
106
- parser = _get_arg_parser()
107
- options, args = parser.parse_args()
108
- auth_config = auth.extract_auth_config_from_options(options)
109
-
110
- if options.whitelist and options.blacklist:
111
- parser.error('Cannot specify both --whitelist and --blacklist')
112
-
113
- if options.email and options.email_file:
114
- parser.error('-e and -E options are incompatible')
115
-
116
- if (os.path.isfile(os.path.join(os.getcwd(), 'update.flag'))
117
- and not options.force):
118
- print 'update.flag file found: bot_update has run and checkout is already '
119
- print 'in a consistent state. No actions will be performed in this step.'
120
- return 0
121
-
122
- logging.basicConfig(
123
- format='%(levelname)5s %(module)11s(%(lineno)4d): %(message)s',
124
- level=[logging.WARNING, logging.INFO, logging.DEBUG][
125
- min(2, options.verbose)])
126
- if args:
127
- parser.error('Extra argument(s) "%s" not understood' % ' '.join(args))
128
- if not options.issue:
129
- parser.error('Require --issue')
130
- options.server = options.server.rstrip('/')
131
- if not options.server:
132
- parser.error('Require a valid server')
133
-
134
- options.revision_mapping = json.loads(options.revision_mapping)
135
-
136
- # read email if needed
137
- if options.email_file:
138
- if not os.path.exists(options.email_file):
139
- parser.error('file does not exist: %s' % options.email_file)
140
- with open(options.email_file, 'rb') as f:
141
- options.email = f.read().strip()
142
-
143
- print('Connecting to %s' % options.server)
144
- # Always try un-authenticated first, except for OAuth2
145
- if options.private_key_file:
146
- # OAuth2 authentication
147
- rietveld_obj = rietveld.JwtOAuth2Rietveld(options.server,
148
- options.email,
149
- options.private_key_file)
150
- try:
151
- properties = rietveld_obj.get_issue_properties(options.issue, False)
152
- except urllib2.URLError:
153
- logging.exception('failed to fetch issue properties')
154
- sys.exit(RETURN_CODE_INFRA_FAILURE)
155
- else:
156
- # Passing None as auth_config disables authentication.
157
- rietveld_obj = rietveld.Rietveld(options.server, None)
158
- properties = None
159
- # Bad except clauses order (HTTPError is an ancestor class of
160
- # ClientLoginError)
161
- # pylint: disable=bad-except-order
162
- try:
163
- properties = rietveld_obj.get_issue_properties(options.issue, False)
164
- except urllib2.HTTPError as e:
165
- if e.getcode() != 302:
166
- raise
167
- if options.no_auth:
168
- exit('FAIL: Login detected -- is issue private?')
169
- # TODO(maruel): A few 'Invalid username or password.' are printed first,
170
- # we should get rid of those.
171
- except urllib2.URLError:
172
- logging.exception('failed to fetch issue properties')
173
- return RETURN_CODE_INFRA_FAILURE
174
- except rietveld.upload.ClientLoginError as e:
175
- # Fine, we'll do proper authentication.
176
- pass
177
- if properties is None:
178
- rietveld_obj = rietveld.Rietveld(options.server, auth_config,
179
- options.email)
180
- try:
181
- properties = rietveld_obj.get_issue_properties(options.issue, False)
182
- except rietveld.upload.ClientLoginError as e:
183
- print('Accessing the issue requires proper credentials.')
184
- return RETURN_CODE_OTHER_FAILURE
185
- except urllib2.URLError:
186
- logging.exception('failed to fetch issue properties')
187
- return RETURN_CODE_INFRA_FAILURE
188
-
189
- if not options.patchset:
190
- options.patchset = properties['patchsets'][-1]
191
- print('No patchset specified. Using patchset %d' % options.patchset)
192
-
193
- issues_patchsets_to_apply = [(options.issue, options.patchset)]
194
- try:
195
- depends_on_info = rietveld_obj.get_depends_on_patchset(
196
- options.issue, options.patchset)
197
- except urllib2.URLError:
198
- logging.exception('failed to fetch depends_on_patchset')
199
- return RETURN_CODE_INFRA_FAILURE
200
-
201
- while depends_on_info:
202
- depends_on_issue = int(depends_on_info['issue'])
203
- depends_on_patchset = int(depends_on_info['patchset'])
204
- try:
205
- depends_on_info = rietveld_obj.get_depends_on_patchset(depends_on_issue,
206
- depends_on_patchset)
207
- issues_patchsets_to_apply.insert(0, (depends_on_issue,
208
- depends_on_patchset))
209
- except urllib2.HTTPError:
210
- print ('The patchset that was marked as a dependency no longer '
211
- 'exists: %s/%d/#ps%d' % (
212
- options.server, depends_on_issue, depends_on_patchset))
213
- print 'Therefore it is likely that this patch will not apply cleanly.'
214
- print
215
- depends_on_info = None
216
- except urllib2.URLError:
217
- logging.exception('failed to fetch dependency issue')
218
- return RETURN_CODE_INFRA_FAILURE
219
-
220
- num_issues_patchsets_to_apply = len(issues_patchsets_to_apply)
221
- if num_issues_patchsets_to_apply > 1:
222
- print
223
- print 'apply_issue.py found %d dependent CLs.' % (
224
- num_issues_patchsets_to_apply - 1)
225
- print 'They will be applied in the following order:'
226
- num = 1
227
- for issue_to_apply, patchset_to_apply in issues_patchsets_to_apply:
228
- print ' #%d %s/%d/#ps%d' % (
229
- num, options.server, issue_to_apply, patchset_to_apply)
230
- num += 1
231
- print
232
-
233
- for issue_to_apply, patchset_to_apply in issues_patchsets_to_apply:
234
- issue_url = '%s/%d/#ps%d' % (options.server, issue_to_apply,
235
- patchset_to_apply)
236
- print('Downloading patch from %s' % issue_url)
237
- try:
238
- patchset = rietveld_obj.get_patch(issue_to_apply, patchset_to_apply)
239
- except urllib2.HTTPError:
240
- print(
241
- 'Failed to fetch the patch for issue %d, patchset %d.\n'
242
- 'Try visiting %s/%d') % (
243
- issue_to_apply, patchset_to_apply,
244
- options.server, issue_to_apply)
245
- # If we got this far, then this is likely missing patchset.
246
- # Thus, it's not infra failure.
247
- return RETURN_CODE_OTHER_FAILURE
248
- except urllib2.URLError:
249
- logging.exception(
250
- 'Failed to fetch the patch for issue %d, patchset %d',
251
- issue_to_apply, patchset_to_apply)
252
- return RETURN_CODE_INFRA_FAILURE
253
- if options.whitelist:
254
- patchset.patches = [patch for patch in patchset.patches
255
- if patch.filename in options.whitelist]
256
- if options.blacklist:
257
- patchset.patches = [patch for patch in patchset.patches
258
- if patch.filename not in options.blacklist]
259
- for patch in patchset.patches:
260
- print(patch)
261
- if options.extra_patchlevel:
262
- patch.patchlevel += options.extra_patchlevel
263
- full_dir = os.path.abspath(options.root_dir)
264
- scm_type = scm.determine_scm(full_dir)
265
- if scm_type == 'git':
266
- scm_obj = checkout.GitCheckout(full_dir, None, None, None, None)
267
- else:
268
- parser.error('Couldn\'t determine the scm')
269
-
270
- print('\nApplying the patch from %s' % issue_url)
271
- try:
272
- scm_obj.apply_patch(patchset, verbose=True)
273
- except checkout.PatchApplicationFailed as e:
274
- print(str(e))
275
- print('CWD=%s' % os.getcwd())
276
- print('Checkout path=%s' % scm_obj.project_path)
277
- return RETURN_CODE_OTHER_FAILURE
278
-
279
- if ('DEPS' in map(os.path.basename, patchset.filenames)
280
- and not options.ignore_deps):
281
- gclient_root = gclient_utils.FindGclientRoot(full_dir)
282
- if gclient_root and scm_type:
283
- print(
284
- 'A DEPS file was updated inside a gclient checkout, running gclient '
285
- 'sync.')
286
- gclient_path = os.path.join(BASE_DIR, 'gclient')
287
- if sys.platform == 'win32':
288
- gclient_path += '.bat'
289
- with annotated_gclient.temp_filename(suffix='gclient') as f:
290
- cmd = [
291
- gclient_path, 'sync',
292
- '--nohooks',
293
- '--delete_unversioned_trees',
294
- ]
295
- if options.revision_mapping:
296
- cmd.extend(['--output-json', f])
297
-
298
- retcode = subprocess.call(cmd, cwd=gclient_root)
299
-
300
- if retcode == 0 and options.revision_mapping:
301
- revisions = annotated_gclient.parse_got_revision(
302
- f, options.revision_mapping)
303
- annotated_gclient.emit_buildprops(revisions)
304
-
305
- return retcode
306
- return RETURN_CODE_OK
307
-
308
-
309
- if __name__ == "__main__":
310
- fix_encoding.fix_encoding()
311
- try:
312
- sys.exit(main())
313
- except KeyboardInterrupt:
314
- sys.stderr.write('interrupted\n')
315
- sys.exit(RETURN_CODE_OTHER_FAILURE)