Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 1005693004: Assert when source is an absolute path (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 # Why this scheme and not some other one? 323 # Why this scheme and not some other one?
324 # 1) for a given input, you can compute all derived outputs by matching 324 # 1) for a given input, you can compute all derived outputs by matching
325 # its path, even if the input is brought via a gyp file with '..'. 325 # its path, even if the input is brought via a gyp file with '..'.
326 # 2) simple files like libraries and stamps have a simple filename. 326 # 2) simple files like libraries and stamps have a simple filename.
327 327
328 obj = 'obj' 328 obj = 'obj'
329 if self.toolset != 'target': 329 if self.toolset != 'target':
330 obj += '.' + self.toolset 330 obj += '.' + self.toolset
331 331
332 path_dir, path_basename = os.path.split(path) 332 path_dir, path_basename = os.path.split(path)
333 assert not os.path.isabs(path_dir), (
334 "'%s' can not be absolute path (see crbug.com/462153)." % path_dir)
335
333 if qualified: 336 if qualified:
334 path_basename = self.name + '.' + path_basename 337 path_basename = self.name + '.' + path_basename
335 return os.path.normpath(os.path.join(obj, self.base_dir, path_dir, 338 return os.path.normpath(os.path.join(obj, self.base_dir, path_dir,
336 path_basename)) 339 path_basename))
337 340
338 def WriteCollapsedDependencies(self, name, targets, order_only=None): 341 def WriteCollapsedDependencies(self, name, targets, order_only=None):
339 """Given a list of targets, return a path for a single file 342 """Given a list of targets, return a path for a single file
340 representing the result of building all the targets or None. 343 representing the result of building all the targets or None.
341 344
342 Uses a stamp file if necessary.""" 345 Uses a stamp file if necessary."""
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 arglists.append( 2382 arglists.append(
2380 (target_list, target_dicts, data, params, config_name)) 2383 (target_list, target_dicts, data, params, config_name))
2381 pool.map(CallGenerateOutputForConfig, arglists) 2384 pool.map(CallGenerateOutputForConfig, arglists)
2382 except KeyboardInterrupt, e: 2385 except KeyboardInterrupt, e:
2383 pool.terminate() 2386 pool.terminate()
2384 raise e 2387 raise e
2385 else: 2388 else:
2386 for config_name in config_names: 2389 for config_name in config_names:
2387 GenerateOutputForConfig(target_list, target_dicts, data, params, 2390 GenerateOutputForConfig(target_list, target_dicts, data, params,
2388 config_name) 2391 config_name)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698