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

Side by Side Diff: pylib/gyp/common.py

Issue 1506733002: GYP: Make GYP build deterministic (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: All tested Created 5 years 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
« no previous file with comments | « no previous file | pylib/gyp/generator/ninja.py » ('j') | pylib/gyp/input.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 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 from __future__ import with_statement 5 from __future__ import with_statement
6 6
7 import collections 7 import collections
8 import errno 8 import errno
9 import filecmp 9 import filecmp
10 import os.path 10 import os.path
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 toolset = parsed_toolset 104 toolset = parsed_toolset
105 105
106 return [build_file, target, toolset] 106 return [build_file, target, toolset]
107 107
108 108
109 def BuildFile(fully_qualified_target): 109 def BuildFile(fully_qualified_target):
110 # Extracts the build file from the fully qualified target. 110 # Extracts the build file from the fully qualified target.
111 return ParseQualifiedTarget(fully_qualified_target)[0] 111 return ParseQualifiedTarget(fully_qualified_target)[0]
112 112
113 113
114 def OrderDeterministically(l, **kwargs):
Nico 2015/12/10 20:30:24 I'd just call sorted() directly everywhere. if som
Zachary Forman 2015/12/30 02:18:43 Yeah, seems reasonable. I've swapped it back to so
115 """ Sorts l so that it is ordered deterministically. """
116 return sorted(l, **kwargs)
117
118
114 def GetEnvironFallback(var_list, default): 119 def GetEnvironFallback(var_list, default):
115 """Look up a key in the environment, with fallback to secondary keys 120 """Look up a key in the environment, with fallback to secondary keys
116 and finally falling back to a default value.""" 121 and finally falling back to a default value."""
117 for var in var_list: 122 for var in var_list:
118 if var in os.environ: 123 if var in os.environ:
119 return os.environ[var] 124 return os.environ[var]
120 return default 125 return default
121 126
122 127
123 def QualifiedTarget(build_file, target, toolset): 128 def QualifiedTarget(build_file, target, toolset):
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 def CrossCompileRequested(): 604 def CrossCompileRequested():
600 # TODO: figure out how to not build extra host objects in the 605 # TODO: figure out how to not build extra host objects in the
601 # non-cross-compile case when this is enabled, and enable unconditionally. 606 # non-cross-compile case when this is enabled, and enable unconditionally.
602 return (os.environ.get('GYP_CROSSCOMPILE') or 607 return (os.environ.get('GYP_CROSSCOMPILE') or
603 os.environ.get('AR_host') or 608 os.environ.get('AR_host') or
604 os.environ.get('CC_host') or 609 os.environ.get('CC_host') or
605 os.environ.get('CXX_host') or 610 os.environ.get('CXX_host') or
606 os.environ.get('AR_target') or 611 os.environ.get('AR_target') or
607 os.environ.get('CC_target') or 612 os.environ.get('CC_target') or
608 os.environ.get('CXX_target')) 613 os.environ.get('CXX_target'))
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/generator/ninja.py » ('j') | pylib/gyp/input.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698