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

Unified Diff: build/write_build_date_header.py

Issue 1846713002: Improve the error message in BuildTime.InThePast to help figure out the problem. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: With fix Created 4 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 side-by-side diff with in-line comments
Download patch
« base/build_time_unittest.cc ('K') | « base/build_time_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/write_build_date_header.py
diff --git a/build/write_build_date_header.py b/build/write_build_date_header.py
index 0ba47049b570377c4e090a4c9d1fc7884afb9261..37188950c91782f0792d53b7730857c5b99eb223 100755
--- a/build/write_build_date_header.py
+++ b/build/write_build_date_header.py
@@ -75,7 +75,13 @@ def main():
if args.build_date_override:
build_date = args.build_date_override
else:
- build_date = GetBuildDate(args.build_type, datetime.datetime.utcnow())
+ now = datetime.datetime.utcnow()
+ if now.hour < 5:
+ # The time is locked at 5:00 am in UTC to cause the build cache
+ # invalidation to not happen exactly at midnight. Take the day before.
+ # See //base/build_time.cc.
Nico 2016/03/30 20:34:00 This should also refer to the script that has the
M-A Ruel 2016/03/30 20:38:09 Humm what about changing the script to output the
+ now = now - datetime.timedelta(day=1)
+ build_date = GetBuildDate(args.build_type, now)
output = ('// Generated by //build/write_build_date_header.py\n'
'#ifndef BUILD_DATE\n'
« base/build_time_unittest.cc ('K') | « base/build_time_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698