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

Unified Diff: sky/tools/mojo_cache_linker.py

Issue 868253006: Replace usage of md5 with sha256 for generation of mojo app ids. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sky/tools/mojo_cache_linker.py
diff --git a/sky/tools/mojo_cache_linker.py b/sky/tools/mojo_cache_linker.py
index 10685af6fa7121400bab8f763e4812d24b06f7af..d848ecdf84b97431c676cfede406766dd6b7bc3c 100755
--- a/sky/tools/mojo_cache_linker.py
+++ b/sky/tools/mojo_cache_linker.py
@@ -44,10 +44,10 @@ def compute_path_to_app_id_map(paths, cache, cache_mtime):
for path in paths:
app_id = get_cached_app_id(path, cache, cache_mtime)
if not app_id:
- logging.info('md5sum %s' % path)
+ logging.info('sha256sum %s' % path)
# Example output:
# f82a3551478a9a0e010adccd675053b9 png_viewer.mojo
- output = subprocess.check_output(['md5sum', path])
+ output = subprocess.check_output(['sha256sum', path])
app_id = output.strip().split()[0]
path_to_app_id_map[path] = app_id
return path_to_app_id_map
@@ -78,8 +78,13 @@ def main():
' to match expected dlopen names from mojo_shell\'s NetworkLoader.')
parser.add_argument('links_dir', type=str)
parser.add_argument('build_dir', type=str)
+ parser.add_argument('-f', '--force', action='store_true')
+ parser.add_argument('-v', '--verbose', action='store_true')
args = parser.parse_args()
+ if args.verbose:
+ logging.getLogger().setLevel(logging.INFO)
+
if not os.path.isdir(args.links_dir):
logging.fatal('links_dir: %s is not a directory' % args.links_dir)
sys.exit(1)
@@ -87,6 +92,8 @@ def main():
# Some of the .so files are 100s of megabytes. Cache the md5s to save time.
cache_path = os.path.join(args.build_dir, '.app_id_cache')
cache, cache_mtime = read_app_id_cache(cache_path)
+ if args.force:
+ cache_mtime = None
paths = library_paths(args.build_dir)
path_to_app_id_map = compute_path_to_app_id_map(list(paths),

Powered by Google App Engine
This is Rietveld 408576698