libv8 6.0.286.44.0beta1 → 6.0.286.54.0beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -2
  3. data/ext/libv8/location.rb +1 -1
  4. data/ext/libv8/paths.rb +1 -1
  5. data/lib/libv8/version.rb +1 -1
  6. data/patches/0001-Build-a-standalone-static-library.patch +1 -1
  7. data/patches/0002-Don-t-compile-unnecessary-stuff.patch +9 -11
  8. data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +1 -1
  9. data/patches/0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch +1 -1
  10. data/patches/0005-Fix-GCC-7-build-errors.patch +1 -1
  11. data/spec/location_spec.rb +1 -1
  12. data/vendor/depot_tools/.gitattributes +1 -1
  13. data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
  14. data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +1 -1
  15. data/vendor/depot_tools/bootstrap/win/win_tools.bat +1 -1
  16. data/vendor/depot_tools/cipd +2 -3
  17. data/vendor/depot_tools/cipd.ps1 +2 -6
  18. data/vendor/depot_tools/cipd_bin_setup.bat +1 -1
  19. data/vendor/depot_tools/cipd_bin_setup.sh +3 -1
  20. data/vendor/depot_tools/cipd_client_version +1 -1
  21. data/vendor/depot_tools/cpplint.py +0 -31
  22. data/vendor/depot_tools/gclient.py +162 -88
  23. data/vendor/depot_tools/gclient_utils.py +5 -0
  24. data/vendor/depot_tools/gerrit_client.py +0 -0
  25. data/vendor/depot_tools/gerrit_util.py +2 -2
  26. data/vendor/depot_tools/git_cl.py +25 -12
  27. data/vendor/depot_tools/infra/config/recipes.cfg +2 -2
  28. data/vendor/depot_tools/led +1 -1
  29. data/vendor/depot_tools/led.bat +1 -1
  30. data/vendor/depot_tools/my_activity.py +26 -16
  31. data/vendor/depot_tools/presubmit_canned_checks.py +1 -1
  32. data/vendor/depot_tools/presubmit_support.py +15 -4
  33. data/vendor/depot_tools/recipes/README.recipes.md +21 -14
  34. data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +18 -11
  35. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref_custom.json +29 -0
  36. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_empty_revision.json +156 -0
  37. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +27 -1
  38. data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +11 -0
  39. data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +8 -9
  40. data/vendor/depot_tools/recipes/recipes.py +2 -2
  41. data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +162 -0
  42. data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.py +53 -0
  43. data/vendor/depot_tools/update_depot_tools +13 -7
  44. data/vendor/depot_tools/update_depot_tools.bat +7 -2
  45. data/vendor/depot_tools/vpython +1 -1
  46. data/vendor/depot_tools/vpython.bat +1 -1
  47. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +7 -3
  48. data/vendor/v8/AUTHORS +1 -0
  49. data/vendor/v8/codereview.settings +2 -4
  50. data/vendor/v8/include/v8-version.h +1 -1
  51. data/vendor/v8/src/builtins/builtins-array-gen.cc +1 -0
  52. data/vendor/v8/src/compiler/escape-analysis.cc +1 -4
  53. data/vendor/v8/src/compiler/load-elimination.cc +1 -1
  54. data/vendor/v8/src/d8.cc +1 -0
  55. data/vendor/v8/src/map-updater.cc +39 -2
  56. data/vendor/v8/src/map-updater.h +9 -2
  57. data/vendor/v8/src/objects-debug.cc +7 -1
  58. data/vendor/v8/src/objects.cc +33 -6
  59. data/vendor/v8/src/objects.h +0 -1
  60. data/vendor/v8/src/objects/map-inl.h +15 -0
  61. data/vendor/v8/src/objects/map.h +6 -0
  62. data/vendor/v8/src/v8.gyp +7 -0
  63. data/vendor/v8/src/wasm/wasm-module.cc +10 -8
  64. data/vendor/v8/tools/run-tests.py +1 -1
  65. metadata +6 -5
  66. data/vendor/depot_tools/win_toolchain/7z/7z.dll +0 -0
  67. data/vendor/depot_tools/win_toolchain/7z/7z.exe +0 -0
  68. data/vendor/depot_tools/win_toolchain/7z/LICENSE +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dc0a206307d9b091b3776c9b2153cb92cef4309
4
- data.tar.gz: '091690ca75c293d0a94512e316b8b9dec4219f76'
3
+ metadata.gz: 91d67fd3a863b85bccfc38a1416c7382ea245228
4
+ data.tar.gz: b0089b40f9d4baa10876231a50acc1460ff6599c
5
5
  SHA512:
6
- metadata.gz: 05ce392227aa95ee504ecab1908e953d980e2be090e58ecbb5241df263852bd3a02bb1933cb6fc7a40ee0eadba510a614e10b7658be40ed5d810042ceff13f35
7
- data.tar.gz: 6869dd017ad635874be096a503c6172b7dc62e6de0751c9fa91c2543c41ac8d4d2bea14a99e2ec711e15ace6b5d8fabc4b526a7afca7537ffcee3a94deb5a2ed
6
+ metadata.gz: c27163faaf1d7f9149315d3b0c2528a8ae680f0e486649f8d2e8889e18723e3f3fd631fb854346e3dd8fa275adae162abdd29e67fbfc7ef00d41ccc47901be91
7
+ data.tar.gz: 1278dcaed4fb81ed8636ec69d54b554ebc1b563c4c4df1cff1e357ddd8d9b597dfaf498f7af6a39edf297f810c364740e8c5198a56a0d070ef252dd28b18fb24
@@ -1,9 +1,11 @@
1
- ### v5.9.211.38.0beta1 - Unreleased
1
+ ### v6.0.286.54.0 - Unreleased
2
2
 
3
- * Update upstream v8 version to 6.0.286.44
3
+ * Update upstream v8 version to 6.0.286.54
4
4
  * V8 source is no longer pulled using the fetch command from depot_tools but is
5
5
  instead added as a submodule in the current tree
6
6
  * Hooks are no longer ran after syncing V8's upstream dependencies
7
+ * Reordered libraries in accordance with the V8 wiki
8
+ * Added groups around the library flags in accordance with the V8 wiki
7
9
 
8
10
  ### v5.9.211.38.0, v5.9.211.38.1 - 2017-07-26
9
11
 
@@ -29,7 +29,7 @@ module Libv8
29
29
 
30
30
  def configure(context = MkmfContext.new)
31
31
  context.incflags.insert 0, Libv8::Paths.include_paths.map{ |p| "-I#{p}" }.join(" ") + " "
32
- context.ldflags.insert 0, Libv8::Paths.object_paths.join(" ") + " "
32
+ context.ldflags.insert 0, "-Wl,--start-group " + Libv8::Paths.object_paths.join(" ") + " -Wl,--end-group "
33
33
  end
34
34
 
35
35
  def verify_installation!
@@ -11,7 +11,7 @@ module Libv8
11
11
  end
12
12
 
13
13
  def object_paths
14
- [:base, :libplatform, :libsampler, :libbase, :snapshot].map do |name|
14
+ [:base, :libbase, :snapshot, :libplatform, :libsampler].map do |name|
15
15
  Shellwords.escape libv8_object(name)
16
16
  end
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module Libv8
2
- VERSION = "6.0.286.44.0beta1"
2
+ VERSION = "6.0.286.54.0beta1"
3
3
  end
@@ -1,4 +1,4 @@
1
- From b3d75137651a41d141c29c55725bc97485b247d8 Mon Sep 17 00:00:00 2001
1
+ From 6c28fb0319c5e2e7afad4b5731fc0ded86e1f7e7 Mon Sep 17 00:00:00 2001
2
2
  From: Petko Bordjukov <bordjukov@gmail.com>
3
3
  Date: Mon, 25 Jul 2016 00:00:19 +0300
4
4
  Subject: [PATCH 1/5] Build a standalone static library
@@ -1,18 +1,18 @@
1
- From 45000acd2fe5ccf48d1061f76eea2333524ebe74 Mon Sep 17 00:00:00 2001
1
+ From 31d199f67ff88be5576869abcc23ecf219fa1e6f Mon Sep 17 00:00:00 2001
2
2
  From: Petko Bordjukov <bordjukov@gmail.com>
3
- Date: Tue, 28 Feb 2017 00:04:26 +0200
3
+ Date: Fri, 28 Jul 2017 11:11:08 +0300
4
4
  Subject: [PATCH 2/5] Don't compile unnecessary stuff
5
5
 
6
6
  ---
7
- Makefile | 14 ++++----------
7
+ Makefile | 12 +++---------
8
8
  gypfiles/all.gyp | 33 ---------------------------------
9
- 2 files changed, 4 insertions(+), 43 deletions(-)
9
+ 2 files changed, 3 insertions(+), 42 deletions(-)
10
10
 
11
11
  diff --git a/Makefile b/Makefile
12
- index ed5b3a7fab..360dc3a1a1 100644
12
+ index ed5b3a7fab..04eddb5e8a 100644
13
13
  --- a/Makefile
14
14
  +++ b/Makefile
15
- @@ -265,16 +265,10 @@ ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
15
+ @@ -265,15 +265,9 @@ ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \
16
16
  android_mipsel android_x87
17
17
 
18
18
  # List of files that trigger Makefile regeneration:
@@ -25,14 +25,12 @@ index ed5b3a7fab..360dc3a1a1 100644
25
25
  - tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
26
26
  - buildtools/third_party/libc++abi/libc++abi.gyp \
27
27
  - buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \
28
- - src/third_party/vtune/v8vtune.gyp src/d8.gyp
29
28
  +GYPFILES = gypfiles/shim_headers.gypi gypfiles/features.gypi \
30
- + gypfiles/standalone.gypi gypfiles/toolchain.gypi \
31
- + gypfiles/all.gyp gypfiles/mac/asan.gyp \
32
- + tools/parser-shell.gyp src/d8.gyp
29
+ + gypfiles/standalone.gypi gypfiles/all.gyp \
30
+ + gypfiles/mac/asan.gyp src/v8.gyp tools/parser-shell.gyp \
31
+ src/third_party/vtune/v8vtune.gyp src/d8.gyp
33
32
 
34
33
  # If vtunejit=on, the v8vtune.gyp will be appended.
35
- ifeq ($(vtunejit), on)
36
34
  diff --git a/gypfiles/all.gyp b/gypfiles/all.gyp
37
35
  index bc9d9650eb..96820a0ecc 100644
38
36
  --- a/gypfiles/all.gyp
@@ -1,4 +1,4 @@
1
- From 185c0249653dafb4ae20d21f2a0cc241c3e96c64 Mon Sep 17 00:00:00 2001
1
+ From fe76837b00357250a01ad71c4cce4b7524dd765f Mon Sep 17 00:00:00 2001
2
2
  From: Petko Bordjukov <bordjukov@gmail.com>
3
3
  Date: Mon, 25 Jul 2016 00:05:47 +0300
4
4
  Subject: [PATCH 3/5] Use the -fPIC flag for the static library
@@ -1,4 +1,4 @@
1
- From 596e88c9c1a158abc878bd81112aa9b5ec38033a Mon Sep 17 00:00:00 2001
1
+ From 7b00cf7c2c13d4c528bccd3bc4a91426f4e35145 Mon Sep 17 00:00:00 2001
2
2
  From: Jb Aviat <jb@sqreen.io>
3
3
  Date: Mon, 27 Feb 2017 11:14:42 +0200
4
4
  Subject: [PATCH 4/5] Do not embed debug symbols in macOS libraries
@@ -1,4 +1,4 @@
1
- From da4cfa16ed1cbbc5e2ecfeecb64cbe939029ff36 Mon Sep 17 00:00:00 2001
1
+ From a8f772b3a6bcfad871b4d09935727032faf84df2 Mon Sep 17 00:00:00 2001
2
2
  From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <mic.besace@gmail.com>
3
3
  Date: Tue, 20 Jun 2017 13:14:38 +0200
4
4
  Subject: [PATCH 5/5] Fix GCC 7 build errors
@@ -64,7 +64,7 @@ describe "libv8 locations" do
64
64
  end
65
65
 
66
66
  it "prepends the locations of any libv8 objects on the the ldflags" do
67
- expect(@context.ldflags).to eql "/foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libplatform.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libsampler.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libbase.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a -lobjc -lpthread"
67
+ expect(@context.ldflags).to eql "-Wl,--start-group /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libbase.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libplatform.a /foo\\ bar/v8/out/x64.release/obj.target/tools/gyp/libv8_libsampler.a -Wl,--end-group -lobjc -lpthread"
68
68
  end
69
69
  end
70
70
  end
@@ -9,7 +9,7 @@
9
9
  /*.py recipes
10
10
  /*.sh recipes
11
11
 
12
- # Extensionless tools we want
12
+ # Extensionless tools we want and support scripts.
13
13
  /apply_issue recipes
14
14
  /clang* recipes
15
15
  /depot-tools-auth recipes
@@ -15,4 +15,4 @@
15
15
  infra/python/cpython/windows-386 version:2.7.6
16
16
 
17
17
  @Subdir git
18
- infra/git/${platform} version:2.10.0
18
+ infra/git/${platform} version:2.14.1.chromium10
@@ -15,4 +15,4 @@
15
15
  infra/python/cpython/${platform} version:2.7.13.chromium7
16
16
 
17
17
  @Subdir git
18
- infra/git/${platform} version:2.10.0
18
+ infra/git/${platform} version:2.14.1.chromium10
@@ -58,7 +58,7 @@ set WIN_TOOLS_EXTRA_ARGS=%WIN_TOOLS_EXTRA_ARGS% --win-tools-name "%WIN_TOOLS_NAM
58
58
  :: Install our CIPD packages. The CIPD client self-bootstraps.
59
59
  :: See "//cipd.bat" and "//cipd.ps1" for more information.
60
60
  set CIPD_EXE=%WIN_TOOLS_ROOT_DIR%\cipd.bat
61
- call "%CIPD_EXE%" ensure -ensure-file "%~dp0%CIPD_MANIFEST%" -root "%WIN_TOOLS_PATH%"
61
+ call "%CIPD_EXE%" ensure -log-level warning -ensure-file "%~dp0%CIPD_MANIFEST%" -root "%WIN_TOOLS_PATH%"
62
62
  if errorlevel 1 goto :END
63
63
 
64
64
  :: This executes "win_tools.py" using the bundle's Python interpreter.
@@ -49,8 +49,7 @@ CLIENT="$MYPATH/.cipd_client"
49
49
  USER_AGENT="depot_tools/$(git -C $MYPATH rev-parse HEAD 2>/dev/null || echo "???")"
50
50
 
51
51
  if [ ! -e "$CLIENT" ]; then
52
- echo "Bootstrapping cipd client for ${PLAT}-${ARCH}..."
53
- echo "From $URL"
52
+ echo "Bootstrapping cipd client for ${PLAT}-${ARCH} from ${URL}..."
54
53
  if hash curl 2> /dev/null ; then
55
54
  # Download the client into a temporary file, then move it into the final
56
55
  # location atomically.
@@ -60,7 +59,7 @@ if [ ! -e "$CLIENT" ]; then
60
59
  mktemp -p "$MYPATH" 2>/dev/null || \
61
60
  mktemp "$MYPATH/.cipd_client.XXXXXXX")
62
61
 
63
- curl "$URL" -f -A "$USER_AGENT" -L -o "$CIPD_CLIENT_TMP"
62
+ curl "$URL" -s --show-error -f -A "$USER_AGENT" -L -o "$CIPD_CLIENT_TMP"
64
63
  chmod +x "$CIPD_CLIENT_TMP"
65
64
 
66
65
  set +e
@@ -49,12 +49,8 @@ while ($true) {
49
49
  $cipd_lock_file = [IO.File]::OpenWrite($cipd_lock)
50
50
 
51
51
  if (!(Test-Path $client)) {
52
- echo "Bootstrapping cipd client for $plat-$arch..."
53
- echo "From $url"
52
+ echo "Bootstrapping cipd client for $plat-$arch from $url..."
54
53
 
55
- # TODO(iannucci): It would be really nice if there was a way to get this to
56
- # show progress without also completely destroying the download speed, but
57
- # I can't seem to find a way to do it. Patches welcome :)
58
54
  $wc = (New-Object System.Net.WebClient)
59
55
  $wc.Headers.add('User-Agent', $user_agent)
60
56
  $wc.DownloadFile($url, $client)
@@ -68,4 +64,4 @@ while ($true) {
68
64
  $cipd_lock_file.close()
69
65
  }
70
66
  }
71
- }
67
+ }
@@ -3,4 +3,4 @@
3
3
  :: Use of this source code is governed by a BSD-style license that can be
4
4
  :: found in the LICENSE file.
5
5
 
6
- "%~dp0\cipd.bat" ensure -ensure-file "%~dp0\cipd_manifest.txt" -root "%~dp0\.cipd_bin"
6
+ "%~dp0\cipd.bat" ensure -log-level warning -ensure-file "%~dp0\cipd_manifest.txt" -root "%~dp0\.cipd_bin"
@@ -5,6 +5,8 @@
5
5
  function cipd_bin_setup {
6
6
  local MYPATH=$(dirname "${BASH_SOURCE[0]}")
7
7
 
8
- "$MYPATH/cipd" ensure -ensure-file "$MYPATH/cipd_manifest.txt" \
8
+ "$MYPATH/cipd" ensure \
9
+ -log-level warning \
10
+ -ensure-file "$MYPATH/cipd_manifest.txt" \
9
11
  -root "$MYPATH/.cipd_bin"
10
12
  }
@@ -1 +1 @@
1
- git_revision:5cf65fdf804a9b3f3023f79d5b3cab2a88ccd09e
1
+ git_revision:cf5b0de14e94b06274d15e84b19449f580576e80
@@ -3045,36 +3045,6 @@ def CheckComment(line, filename, linenum, next_line_start, error):
3045
3045
  'Should have a space between // and comment')
3046
3046
 
3047
3047
 
3048
- def CheckAccess(filename, clean_lines, linenum, nesting_state, error):
3049
- """Checks for improper use of DISALLOW* macros.
3050
-
3051
- Args:
3052
- filename: The name of the current file.
3053
- clean_lines: A CleansedLines instance containing the file.
3054
- linenum: The number of the line to check.
3055
- nesting_state: A NestingState instance which maintains information about
3056
- the current stack of nested blocks being parsed.
3057
- error: The function to call with any errors found.
3058
- """
3059
- line = clean_lines.elided[linenum] # get rid of comments and strings
3060
-
3061
- matched = Match((r'\s*(DISALLOW_COPY_AND_ASSIGN|'
3062
- r'DISALLOW_IMPLICIT_CONSTRUCTORS)'), line)
3063
- if not matched:
3064
- return
3065
- if nesting_state.stack and isinstance(nesting_state.stack[-1], _ClassInfo):
3066
- if nesting_state.stack[-1].access != 'private':
3067
- error(filename, linenum, 'readability/constructors', 3,
3068
- '%s must be in the private: section' % matched.group(1))
3069
-
3070
- else:
3071
- # Found DISALLOW* macro outside a class declaration, or perhaps it
3072
- # was used inside a function when it should have been part of the
3073
- # class declaration. We could issue a warning here, but it
3074
- # probably resulted in a compiler error already.
3075
- pass
3076
-
3077
-
3078
3048
  def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
3079
3049
  """Checks for the correctness of various spacing issues in the code.
3080
3050
 
@@ -4303,7 +4273,6 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
4303
4273
  CheckBraces(filename, clean_lines, linenum, error)
4304
4274
  CheckTrailingSemicolon(filename, clean_lines, linenum, error)
4305
4275
  CheckEmptyBlockBody(filename, clean_lines, linenum, error)
4306
- CheckAccess(filename, clean_lines, linenum, nesting_state, error)
4307
4276
  CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
4308
4277
  CheckOperatorSpacing(filename, clean_lines, linenum, error)
4309
4278
  CheckParenthesisSpacing(filename, clean_lines, linenum, error)
@@ -194,7 +194,8 @@ class Hook(object):
194
194
  not gclient_eval.EvaluateCondition(self._condition, self._variables)):
195
195
  return
196
196
 
197
- cmd = list(self._action)
197
+ cmd = [arg.format(**self._variables) for arg in self._action]
198
+
198
199
  if cmd[0] == 'python':
199
200
  # If the hook specified "python" as the first item, the action is a
200
201
  # Python script. Run it by starting a new copy of the same
@@ -221,32 +222,16 @@ class Hook(object):
221
222
  gclient_utils.CommandToStr(cmd), elapsed_time))
222
223
 
223
224
 
224
- class GClientKeywords(object):
225
- class VarImpl(object):
226
- def __init__(self, custom_vars, local_scope):
227
- self._custom_vars = custom_vars
228
- self._local_scope = local_scope
229
-
230
- def Lookup(self, var_name):
231
- """Implements the Var syntax."""
232
- if var_name in self._custom_vars:
233
- return self._custom_vars[var_name]
234
- elif var_name in self._local_scope.get("vars", {}):
235
- return self._local_scope["vars"][var_name]
236
- raise gclient_utils.Error("Var is not defined: %s" % var_name)
237
-
238
-
239
- class DependencySettings(GClientKeywords):
225
+ class DependencySettings(object):
240
226
  """Immutable configuration settings."""
241
227
  def __init__(
242
- self, parent, url, managed, custom_deps, custom_vars,
228
+ self, parent, raw_url, url, managed, custom_deps, custom_vars,
243
229
  custom_hooks, deps_file, should_process, relative,
244
230
  condition, condition_value):
245
- GClientKeywords.__init__(self)
246
-
247
231
  # These are not mutable:
248
232
  self._parent = parent
249
233
  self._deps_file = deps_file
234
+ self._raw_url = raw_url
250
235
  self._url = url
251
236
  # The condition as string (or None). Useful to keep e.g. for flatten.
252
237
  self._condition = condition
@@ -324,8 +309,14 @@ class DependencySettings(GClientKeywords):
324
309
  def custom_hooks(self):
325
310
  return self._custom_hooks[:]
326
311
 
312
+ @property
313
+ def raw_url(self):
314
+ """URL before variable expansion."""
315
+ return self._raw_url
316
+
327
317
  @property
328
318
  def url(self):
319
+ """URL after variable expansion."""
329
320
  return self._url
330
321
 
331
322
  @property
@@ -354,12 +345,12 @@ class DependencySettings(GClientKeywords):
354
345
  class Dependency(gclient_utils.WorkItem, DependencySettings):
355
346
  """Object that represents a dependency checkout."""
356
347
 
357
- def __init__(self, parent, name, url, managed, custom_deps,
348
+ def __init__(self, parent, name, raw_url, url, managed, custom_deps,
358
349
  custom_vars, custom_hooks, deps_file, should_process,
359
350
  relative, condition, condition_value):
360
351
  gclient_utils.WorkItem.__init__(self, name)
361
352
  DependencySettings.__init__(
362
- self, parent, url, managed, custom_deps, custom_vars,
353
+ self, parent, raw_url, url, managed, custom_deps, custom_vars,
363
354
  custom_hooks, deps_file, should_process, relative,
364
355
  condition, condition_value)
365
356
 
@@ -553,7 +544,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
553
544
  raise gclient_utils.Error('Unknown url type')
554
545
 
555
546
  @staticmethod
556
- def MergeWithOsDeps(deps, deps_os, target_os_list):
547
+ def MergeWithOsDeps(deps, deps_os, target_os_list, process_all_deps):
557
548
  """Returns a new "deps" structure that is the deps sent in updated
558
549
  with information from deps_os (the deps_os section of the DEPS
559
550
  file) that matches the list of target os."""
@@ -570,7 +561,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
570
561
  if isinstance(value, basestring):
571
562
  value = {'url': value}
572
563
  assert isinstance(value, collections.Mapping), (key, value)
573
- value['should_process'] = dep_os in target_os_list
564
+ value['should_process'] = dep_os in target_os_list or process_all_deps
574
565
 
575
566
  # Handle collisions/overrides.
576
567
  if key in new_deps and new_deps[key] != value:
@@ -636,21 +627,25 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
636
627
  condition = None
637
628
  condition_value = True
638
629
  if isinstance(dep_value, basestring):
639
- url = dep_value
630
+ raw_url = dep_value
640
631
  else:
641
632
  # This should be guaranteed by schema checking in gclient_eval.
642
633
  assert isinstance(dep_value, collections.Mapping)
643
- url = dep_value['url']
634
+ raw_url = dep_value['url']
644
635
  # Take into account should_process metadata set by MergeWithOsDeps.
645
636
  should_process = (should_process and
646
637
  dep_value.get('should_process', True))
647
638
  condition = dep_value.get('condition')
639
+
640
+ url = raw_url.format(**self.get_vars())
641
+
648
642
  if condition:
649
643
  condition_value = gclient_eval.EvaluateCondition(
650
644
  condition, self.get_vars())
651
- should_process = should_process and condition_value
645
+ if not self._get_option('process_all_deps', False):
646
+ should_process = should_process and condition_value
652
647
  deps_to_add.append(Dependency(
653
- self, name, url, None, None, self.custom_vars, None,
648
+ self, name, raw_url, url, None, None, self.custom_vars, None,
654
649
  deps_file, should_process, use_relative_paths, condition,
655
650
  condition_value))
656
651
  deps_to_add.sort(key=lambda x: x.name)
@@ -685,10 +680,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
685
680
 
686
681
  local_scope = {}
687
682
  if deps_content:
688
- # One thing is unintuitive, vars = {} must happen before Var() use.
689
- var = self.VarImpl(self.custom_vars, local_scope)
690
683
  global_scope = {
691
- 'Var': var.Lookup,
684
+ 'Var': lambda var_name: '{%s}' % var_name,
692
685
  'deps_os': {},
693
686
  }
694
687
  # Eval the content.
@@ -715,9 +708,14 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
715
708
  self._gn_args_file = local_scope.get('gclient_gn_args_file')
716
709
  self._gn_args = local_scope.get('gclient_gn_args', [])
717
710
 
711
+ self._vars = local_scope.get('vars', {})
712
+ if self.parent:
713
+ for key, value in self.parent.get_vars().iteritems():
714
+ if key in self._vars:
715
+ self._vars[key] = value
718
716
  # Since we heavily post-process things, freeze ones which should
719
717
  # reflect original state of DEPS.
720
- self._vars = gclient_utils.freeze(local_scope.get('vars', {}))
718
+ self._vars = gclient_utils.freeze(self._vars)
721
719
 
722
720
  # If use_relative_paths is set in the DEPS file, regenerate
723
721
  # the dictionary using paths relative to the directory containing
@@ -734,7 +732,10 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
734
732
  elif self._relative:
735
733
  rel_prefix = os.path.dirname(self.name)
736
734
 
737
- deps = local_scope.get('deps', {})
735
+ deps = {}
736
+ for key, value in local_scope.get('deps', {}).iteritems():
737
+ deps[key.format(**self.get_vars())] = value
738
+
738
739
  if 'recursion' in local_scope:
739
740
  self.recursion_override = local_scope.get('recursion')
740
741
  logging.warning(
@@ -770,7 +771,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
770
771
  if target_os_list and not self._get_option(
771
772
  'do_not_merge_os_specific_entries', False):
772
773
  deps = self.MergeWithOsDeps(
773
- deps, local_scope['deps_os'], target_os_list)
774
+ deps, local_scope['deps_os'], target_os_list,
775
+ self._get_option('process_all_deps', False))
774
776
 
775
777
  deps_to_add = self._deps_to_objects(
776
778
  self._postprocess_deps(deps, rel_prefix), use_relative_paths)
@@ -1168,6 +1170,7 @@ class GClient(Dependency):
1168
1170
  "linux2": "unix",
1169
1171
  "linux3": "unix",
1170
1172
  "android": "android",
1173
+ "ios": "ios",
1171
1174
  }
1172
1175
 
1173
1176
  DEFAULT_CLIENT_FILE_TEXT = ("""\
@@ -1203,7 +1206,7 @@ solutions = [
1203
1206
  # Do not change previous behavior. Only solution level and immediate DEPS
1204
1207
  # are processed.
1205
1208
  self._recursion_limit = 2
1206
- Dependency.__init__(self, None, None, None, True, None, None, None,
1209
+ Dependency.__init__(self, None, None, None, None, True, None, None, None,
1207
1210
  'unused', True, None, None, True)
1208
1211
  self._options = options
1209
1212
  if options.deps_os:
@@ -1267,7 +1270,7 @@ it or fix the checkout.
1267
1270
  else:
1268
1271
  self._enforced_os = tuple(set(self._enforced_os).union(target_os))
1269
1272
 
1270
- cache_dir = config_dict.get('cache_dir')
1273
+ cache_dir = config_dict.get('cache_dir', self._options.cache_dir)
1271
1274
  if cache_dir:
1272
1275
  cache_dir = os.path.join(self.root_dir, cache_dir)
1273
1276
  cache_dir = os.path.abspath(cache_dir)
@@ -1286,7 +1289,7 @@ it or fix the checkout.
1286
1289
  for s in config_dict.get('solutions', []):
1287
1290
  try:
1288
1291
  deps_to_add.append(Dependency(
1289
- self, s['name'], s['url'],
1292
+ self, s['name'], s['url'], s['url'],
1290
1293
  s.get('managed', True),
1291
1294
  s.get('custom_deps', {}),
1292
1295
  s.get('custom_vars', {}),
@@ -1719,6 +1722,31 @@ class Flattener(object):
1719
1722
  assert self._deps_string is not None
1720
1723
  return self._deps_string
1721
1724
 
1725
+ def _pin_dep(self, dep):
1726
+ """Pins a dependency to specific full revision sha.
1727
+
1728
+ Arguments:
1729
+ dep (Dependency): dependency to process
1730
+ """
1731
+ if dep.parsed_url is None:
1732
+ return
1733
+
1734
+ # Make sure the revision is always fully specified (a hash),
1735
+ # as opposed to refs or tags which might change. Similarly,
1736
+ # shortened shas might become ambiguous; make sure to always
1737
+ # use full one for pinning.
1738
+ url, revision = gclient_utils.SplitUrlRevision(dep.parsed_url)
1739
+ if revision and gclient_utils.IsFullGitSha(revision):
1740
+ return
1741
+
1742
+ scm = gclient_scm.CreateSCM(
1743
+ dep.parsed_url, self._client.root_dir, dep.name, dep.outbuf)
1744
+ revinfo = scm.revinfo(self._client._options, [], None)
1745
+
1746
+ dep._parsed_url = dep._url = '%s@%s' % (url, revinfo)
1747
+ raw_url, _ = gclient_utils.SplitUrlRevision(dep._raw_url)
1748
+ dep._raw_url = '%s@%s' % (raw_url, revinfo)
1749
+
1722
1750
  def _flatten(self, pin_all_deps=False):
1723
1751
  """Runs the flattener. Saves resulting DEPS string.
1724
1752
 
@@ -1727,19 +1755,29 @@ class Flattener(object):
1727
1755
  in DEPS
1728
1756
  """
1729
1757
  for solution in self._client.dependencies:
1730
- self._flatten_solution(solution)
1758
+ self._add_dep(solution)
1759
+ self._flatten_dep(solution)
1731
1760
 
1732
1761
  if pin_all_deps:
1733
1762
  for dep in self._deps.itervalues():
1734
- if dep.parsed_url is None:
1735
- continue
1736
- url, revision = gclient_utils.SplitUrlRevision(dep.parsed_url)
1737
- if revision and gclient_utils.IsGitSha(revision):
1738
- continue
1739
- scm = gclient_scm.CreateSCM(
1740
- dep.parsed_url, self._client.root_dir, dep.name, dep.outbuf)
1741
- dep._parsed_url = dep._url = '%s@%s' % (
1742
- url, scm.revinfo(self._client._options, [], None))
1763
+ self._pin_dep(dep)
1764
+
1765
+ for os_deps in self._deps_os.itervalues():
1766
+ for dep in os_deps.itervalues():
1767
+ self._pin_dep(dep)
1768
+
1769
+ deps_files = set()
1770
+ def add_deps_file(dep):
1771
+ deps_path = os.path.join(self._client.root_dir, dep.name, dep.deps_file)
1772
+ if not os.path.exists(deps_path):
1773
+ return
1774
+ assert dep.parsed_url
1775
+ deps_files.add((dep.parsed_url, dep.deps_file))
1776
+ for dep in self._deps.itervalues():
1777
+ add_deps_file(dep)
1778
+ for os_deps in self._deps_os.itervalues():
1779
+ for dep in os_deps.itervalues():
1780
+ add_deps_file(dep)
1743
1781
 
1744
1782
  self._deps_string = '\n'.join(
1745
1783
  _GNSettingsToLines(
@@ -1752,65 +1790,95 @@ class Flattener(object):
1752
1790
  _HooksToLines('pre_deps_hooks', self._pre_deps_hooks) +
1753
1791
  _HooksOsToLines(self._hooks_os) +
1754
1792
  _VarsToLines(self._vars) +
1793
+ ['# %s, %s' % (url, deps_file)
1794
+ for url, deps_file in sorted(deps_files)] +
1755
1795
  ['']) # Ensure newline at end of file.
1756
1796
 
1757
- def _flatten_solution(self, solution):
1758
- """Visits a solution in order to flatten it (see CMDflatten).
1797
+ def _add_dep(self, dep):
1798
+ """Helper to add a dependency to flattened DEPS.
1759
1799
 
1760
1800
  Arguments:
1761
- solution (Dependency): one of top-level solutions in .gclient
1801
+ dep (Dependency): dependency to add
1762
1802
  """
1763
- self._flatten_dep(solution)
1764
- self._flatten_recurse(solution)
1803
+ assert dep.name not in self._deps or self._deps.get(dep.name) == dep, (
1804
+ dep.name, self._deps.get(dep.name))
1805
+ if dep.url:
1806
+ self._deps[dep.name] = dep
1807
+
1808
+ def _add_os_dep(self, os_dep, dep_os):
1809
+ """Helper to add an OS-specific dependency to flattened DEPS.
1765
1810
 
1766
- def _flatten_dep(self, dep):
1811
+ Arguments:
1812
+ os_dep (Dependency): dependency to add
1813
+ dep_os (str): name of the OS
1814
+ """
1815
+ assert (
1816
+ os_dep.name not in self._deps_os.get(dep_os, {}) or
1817
+ self._deps_os.get(dep_os, {}).get(os_dep.name) == os_dep), (
1818
+ os_dep.name, self._deps_os.get(dep_os, {}).get(os_dep.name))
1819
+ if os_dep.url:
1820
+ # OS-specific deps need to have their full URL resolved manually.
1821
+ assert not os_dep.parsed_url, (os_dep, os_dep.parsed_url)
1822
+ os_dep._parsed_url = os_dep.LateOverride(os_dep.url)
1823
+
1824
+ self._deps_os.setdefault(dep_os, {})[os_dep.name] = os_dep
1825
+
1826
+ def _flatten_dep(self, dep, dep_os=None):
1767
1827
  """Visits a dependency in order to flatten it (see CMDflatten).
1768
1828
 
1769
1829
  Arguments:
1770
1830
  dep (Dependency): dependency to process
1831
+ dep_os (str or None): name of the OS |dep| is specific to
1771
1832
  """
1772
- self._allowed_hosts.update(dep.allowed_hosts)
1833
+ logging.debug('_flatten_dep(%s, %s)', dep.name, dep_os)
1773
1834
 
1774
- assert dep.name not in self._deps
1775
- self._deps[dep.name] = dep
1835
+ if not dep.deps_parsed:
1836
+ dep.ParseDepsFile()
1837
+
1838
+ self._allowed_hosts.update(dep.allowed_hosts)
1776
1839
 
1777
1840
  for key, value in dep.get_vars().iteritems():
1778
- assert key not in self._vars
1841
+ # Make sure there are no conflicting variables. It is fine however
1842
+ # to use same variable name, as long as the value is consistent.
1843
+ assert key not in self._vars or self._vars[key][1] == value
1779
1844
  self._vars[key] = (dep, value)
1780
1845
 
1781
- self._hooks.extend([(dep, hook) for hook in dep.deps_hooks])
1782
1846
  self._pre_deps_hooks.extend([(dep, hook) for hook in dep.pre_deps_hooks])
1783
1847
 
1848
+ if dep_os:
1849
+ if dep.deps_hooks:
1850
+ self._hooks_os.setdefault(dep_os, []).extend(
1851
+ [(dep, hook) for hook in dep.deps_hooks])
1852
+ else:
1853
+ self._hooks.extend([(dep, hook) for hook in dep.deps_hooks])
1854
+
1855
+ for sub_dep in dep.dependencies:
1856
+ if dep_os:
1857
+ self._add_os_dep(sub_dep, dep_os)
1858
+ else:
1859
+ self._add_dep(sub_dep)
1860
+
1784
1861
  for hook_os, os_hooks in dep.os_deps_hooks.iteritems():
1785
1862
  self._hooks_os.setdefault(hook_os, []).extend(
1786
1863
  [(dep, hook) for hook in os_hooks])
1787
1864
 
1788
- self._add_deps_os(dep)
1789
-
1790
- deps_by_name = dict((d.name, d) for d in dep.dependencies)
1791
- for recurse_dep_name in (dep.recursedeps or []):
1792
- self._flatten_recurse(deps_by_name[recurse_dep_name])
1793
-
1794
- def _flatten_recurse(self, dep):
1795
- """Helper for flatten that recurses into |dep|'s dependencies.
1796
-
1797
- Arguments:
1798
- dep (Dependency): dependency to process
1799
- """
1800
- self._add_deps_os(dep)
1801
-
1802
- for sub_dep in dep.dependencies:
1803
- self._flatten_dep(sub_dep)
1804
-
1805
- def _add_deps_os(self, dep):
1806
- """Helper for flatten that collects deps_os from |dep|.
1865
+ for sub_dep_os, os_deps in dep.os_dependencies.iteritems():
1866
+ for os_dep in os_deps:
1867
+ self._add_os_dep(os_dep, sub_dep_os)
1807
1868
 
1808
- Arguments:
1809
- dep (Dependency): dependency to process
1810
- """
1811
- for dep_os, os_deps in dep.os_dependencies.iteritems():
1869
+ # Process recursedeps. |deps_by_name| is a map where keys are dependency
1870
+ # names, and values are maps of OS names to |Dependency| instances.
1871
+ # |None| in place of OS name means the dependency is not OS-specific.
1872
+ deps_by_name = dict((d.name, {None: d}) for d in dep.dependencies)
1873
+ for sub_dep_os, os_deps in dep.os_dependencies.iteritems():
1812
1874
  for os_dep in os_deps:
1813
- self._deps_os.setdefault(dep_os, {})[os_dep.name] = os_dep
1875
+ assert sub_dep_os not in deps_by_name.get(os_dep.name, {}), (
1876
+ os_dep.name, sub_dep_os)
1877
+ deps_by_name.setdefault(os_dep.name, {})[sub_dep_os] = os_dep
1878
+ for recurse_dep_name in (dep.recursedeps or []):
1879
+ dep_info = deps_by_name[recurse_dep_name]
1880
+ for sub_dep_os, os_dep in dep_info.iteritems():
1881
+ self._flatten_dep(os_dep, dep_os=(sub_dep_os or dep_os))
1814
1882
 
1815
1883
 
1816
1884
  def CMDflatten(parser, args):
@@ -1824,6 +1892,7 @@ def CMDflatten(parser, args):
1824
1892
 
1825
1893
  options.do_not_merge_os_specific_entries = True
1826
1894
  options.nohooks = True
1895
+ options.process_all_deps = True
1827
1896
  client = GClient.LoadCurrentConfig(options)
1828
1897
 
1829
1898
  # Only print progress if we're writing to a file. Otherwise, progress updates
@@ -1875,7 +1944,7 @@ def _DepsToLines(deps):
1875
1944
  s.extend([
1876
1945
  ' # %s' % dep.hierarchy(include_url=False),
1877
1946
  ' "%s": {' % (name,),
1878
- ' "url": "%s",' % (dep.url,),
1947
+ ' "url": "%s",' % (dep.raw_url,),
1879
1948
  ] + condition_part + [
1880
1949
  ' },',
1881
1950
  '',
@@ -1897,7 +1966,7 @@ def _DepsOsToLines(deps_os):
1897
1966
  s.extend([
1898
1967
  ' # %s' % dep.hierarchy(include_url=False),
1899
1968
  ' "%s": {' % (name,),
1900
- ' "url": "%s",' % (dep.url,),
1969
+ ' "url": "%s",' % (dep.raw_url,),
1901
1970
  ] + condition_part + [
1902
1971
  ' },',
1903
1972
  '',
@@ -2043,10 +2112,6 @@ def CMDconfig(parser, args):
2043
2112
  'to have the main solution untouched by gclient '
2044
2113
  '(gclient will check out unmanaged dependencies but '
2045
2114
  'will never sync them)')
2046
- parser.add_option('--cache-dir',
2047
- help='(git only) Cache all git repos into this dir and do '
2048
- 'shared clones from the cache, instead of cloning '
2049
- 'directly from the remote. (experimental)')
2050
2115
  parser.set_defaults(config_filename=None)
2051
2116
  (options, args) = parser.parse_args(args)
2052
2117
  if options.output_config_file:
@@ -2197,6 +2262,9 @@ def CMDsync(parser, args):
2197
2262
  parser.add_option('--do-not-merge-os-specific-entries', action='store_true',
2198
2263
  help='INTERNAL ONLY - disables merging of deps_os and '
2199
2264
  'hooks_os to dependencies and hooks')
2265
+ parser.add_option('--process-all-deps', action='store_true',
2266
+ help='Check out all deps, even for different OS-es, '
2267
+ 'or with conditions evaluating to false')
2200
2268
  parser.add_option('--upstream', action='store_true',
2201
2269
  help='Make repo state match upstream branch.')
2202
2270
  parser.add_option('--output-json',
@@ -2417,6 +2485,12 @@ class OptionParser(optparse.OptionParser):
2417
2485
  '--spec',
2418
2486
  help='create a gclient file containing the provided string. Due to '
2419
2487
  'Cygwin/Python brokenness, it can\'t contain any newlines.')
2488
+ self.add_option(
2489
+ '--cache-dir',
2490
+ help='(git only) Cache all git repos into this dir and do '
2491
+ 'shared clones from the cache, instead of cloning '
2492
+ 'directly from the remote. (experimental)',
2493
+ default=os.environ.get('GCLIENT_CACHE_DIR'))
2420
2494
  self.add_option(
2421
2495
  '--no-nag-max', default=False, action='store_true',
2422
2496
  help='Ignored for backwards compatibility.')