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

Side by Side Diff: win_toolchain/get_toolchain_if_necessary.py

Issue 2052533002: Update the VS toolchain hash computation caching. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 6 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
« 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Downloads and unpacks a toolchain for building on Windows. The contents are 6 """Downloads and unpacks a toolchain for building on Windows. The contents are
7 matched by sha1 which will be updated when the toolchain is updated. 7 matched by sha1 which will be updated when the toolchain is updated.
8 8
9 Having a toolchain script in depot_tools means that it's not versioned 9 Having a toolchain script in depot_tools means that it's not versioned
10 directly with the source code. That is, if the toolchain is upgraded, but 10 directly with the source code. That is, if the toolchain is upgraded, but
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 # ignored_directories list isn't relevant on non-Windows hosts. 81 # ignored_directories list isn't relevant on non-Windows hosts.
82 82
83 ignored_directories = ['wer\\reportqueue', 83 ignored_directories = ['wer\\reportqueue',
84 'win_sdk\\debuggers\\x86\\sym\\', 84 'win_sdk\\debuggers\\x86\\sym\\',
85 'win_sdk\\debuggers\\x64\\sym\\'] 85 'win_sdk\\debuggers\\x64\\sym\\']
86 for base, _, files in os.walk(root): 86 for base, _, files in os.walk(root):
87 paths = [os.path.join(base, f) for f in files] 87 paths = [os.path.join(base, f) for f in files]
88 for p in paths: 88 for p in paths:
89 if any(ignored_dir in p.lower() for ignored_dir in ignored_directories): 89 if any(ignored_dir in p.lower() for ignored_dir in ignored_directories):
90 continue 90 continue
91 file_list.append(p) 91 file_list.append(p.lower())
hans 2016/06/08 17:07:55 This would essentially undo https://codereview.chr
92 return sorted(file_list, key=lambda s: s.replace('/', '\\').lower()) 92 return sorted(file_list, key=lambda s: s.replace('/', '\\').lower())
93 93
94 94
95 def MakeTimestampsFileName(root, sha1): 95 def MakeTimestampsFileName(root, sha1):
96 return os.path.join(root, os.pardir, '%s.timestamps' % sha1) 96 return os.path.join(root, os.pardir, '%s.timestamps' % sha1)
97 97
98 98
99 def CalculateHash(root, expected_hash): 99 def CalculateHash(root, expected_hash):
100 """Calculates the sha1 of the paths to all files in the given |root| and the 100 """Calculates the sha1 of the paths to all files in the given |root| and the
101 contents of those files, and returns as a hex string. 101 contents of those files, and returns as a hex string.
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 if os.environ.get('GYP_MSVS_VERSION') == '2015': 536 if os.environ.get('GYP_MSVS_VERSION') == '2015':
537 InstallUniversalCRTIfNeeded(abs_toolchain_target_dir) 537 InstallUniversalCRTIfNeeded(abs_toolchain_target_dir)
538 538
539 RemoveUnusedToolchains(target_dir) 539 RemoveUnusedToolchains(target_dir)
540 540
541 return 0 541 return 0
542 542
543 543
544 if __name__ == '__main__': 544 if __name__ == '__main__':
545 sys.exit(main()) 545 sys.exit(main())
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