[go: nahoru, domu]

Improve error message when profile does not exist

This CL clarifies that 'checkout_pgo_profiles' should be set in the
.gclient file if the requested profile doesn't exist.

Bug: 1071576
Change-Id: I8cd52a9bec80382edcaa2ed8066d1e6a17428db4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2174940
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#764762}
diff --git a/tools/OWNERS b/tools/OWNERS
index 593fe0ee..ca46a760 100644
--- a/tools/OWNERS
+++ b/tools/OWNERS
@@ -57,3 +57,6 @@
 
 per-file download_optimization_profile.py=gbiv@chromium.org
 per-file download_optimization_profile.py=tcwang@chromium.org
+
+per-file update_pgo_profiles.py=liaoyuke@chromium.org
+per-file update_pgo_profiles.py=sebmarchand@chromium.org
diff --git a/tools/update_pgo_profiles.py b/tools/update_pgo_profiles.py
index 775604a..0f041db 100755
--- a/tools/update_pgo_profiles.py
+++ b/tools/update_pgo_profiles.py
@@ -103,8 +103,11 @@
   """
   profile_path = os.path.join(_PGO_PROFILE_DIR, _read_profile_name(args.target))
   if not os.path.isfile(profile_path):
-    raise RuntimeError('requested profile "%s" doesn\'t exist, please run '
-                       '"gclient runhooks" to download it')
+    raise RuntimeError(
+        'requested profile "%s" doesn\'t exist, please make sure '
+        '"checkout_pgo_profiles" is set to true in the "custom_vars" section '
+        'of your .gclient file and then run "gclient runhooks" to download it' %
+        profile_path)
 
   os.utime(profile_path, None)
   profile_path.rstrip(os.sep)