OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import collections | 5 import collections |
6 import copy | 6 import copy |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import os.path | 10 import os.path |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 # Why this scheme and not some other one? | 333 # Why this scheme and not some other one? |
334 # 1) for a given input, you can compute all derived outputs by matching | 334 # 1) for a given input, you can compute all derived outputs by matching |
335 # its path, even if the input is brought via a gyp file with '..'. | 335 # its path, even if the input is brought via a gyp file with '..'. |
336 # 2) simple files like libraries and stamps have a simple filename. | 336 # 2) simple files like libraries and stamps have a simple filename. |
337 | 337 |
338 obj = 'obj' | 338 obj = 'obj' |
339 if self.toolset != 'target': | 339 if self.toolset != 'target': |
340 obj += '.' + self.toolset | 340 obj += '.' + self.toolset |
341 | 341 |
342 path_dir, path_basename = os.path.split(path) | 342 path_dir, path_basename = os.path.split(path) |
| 343 assert not os.path.isabs(path_dir), ( |
| 344 "'%s' can not be absolute path (see crbug.com/462153)." % path_dir) |
| 345 |
343 if qualified: | 346 if qualified: |
344 path_basename = self.name + '.' + path_basename | 347 path_basename = self.name + '.' + path_basename |
345 return os.path.normpath(os.path.join(obj, self.base_dir, path_dir, | 348 return os.path.normpath(os.path.join(obj, self.base_dir, path_dir, |
346 path_basename)) | 349 path_basename)) |
347 | 350 |
348 def WriteCollapsedDependencies(self, name, targets, order_only=None): | 351 def WriteCollapsedDependencies(self, name, targets, order_only=None): |
349 """Given a list of targets, return a path for a single file | 352 """Given a list of targets, return a path for a single file |
350 representing the result of building all the targets or None. | 353 representing the result of building all the targets or None. |
351 | 354 |
352 Uses a stamp file if necessary.""" | 355 Uses a stamp file if necessary.""" |
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2385 arglists.append( | 2388 arglists.append( |
2386 (target_list, target_dicts, data, params, config_name)) | 2389 (target_list, target_dicts, data, params, config_name)) |
2387 pool.map(CallGenerateOutputForConfig, arglists) | 2390 pool.map(CallGenerateOutputForConfig, arglists) |
2388 except KeyboardInterrupt, e: | 2391 except KeyboardInterrupt, e: |
2389 pool.terminate() | 2392 pool.terminate() |
2390 raise e | 2393 raise e |
2391 else: | 2394 else: |
2392 for config_name in config_names: | 2395 for config_name in config_names: |
2393 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2396 GenerateOutputForConfig(target_list, target_dicts, data, params, |
2394 config_name) | 2397 config_name) |
OLD | NEW |