Commit eb686109 authored by Timothy Gu's avatar Timothy Gu Committed by Commit Bot

Update fontconfig cache key handling

Since If6853404f1e87de4f95a24f6231282543814bd63, the "uuid" variable has
been referring to the MD5 of a fixed string. Update the comment as such,
and remove the now-unneeded .uuid file writing.

Also update test_fonts/README.chromium as the manual UUID change is no
longer necessary or effective.

Bug: 767754
Change-Id: I07a9b10a631e755877cbcb7df40a53359329f8a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209397
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Timothy Gu <timothygu@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770287}
parent 9fec9d78
......@@ -25,16 +25,14 @@
// determinism. We have no way of guaranteeing that this produces correct
// results, or even has the intended effect.
int main() {
// fontconfig generates a random uuid and uses it to match font folders with
// the font cache. Rather than letting fontconfig generate a random uuid,
// which introduces build non-determinism, we place a fixed uuid in the font
// folder, which fontconfig will use to generate the cache.
base::FilePath dir_module;
base::PathService::Get(base::DIR_MODULE, &dir_module);
base::FilePath uuid_file_path =
dir_module.Append("test_fonts").Append(".uuid");
const char uuid[] = "fb5c91b2895aa445d23aebf7f9e2189c";
WriteFile(uuid_file_path, uuid);
// This is the MD5 hash of "/test_fonts", which is used as the key of the
// fontconfig cache.
// $ echo -n /test_fonts | md5sum
// fb5c91b2895aa445d23aebf7f9e2189c -
const char cache_key[] = "fb5c91b2895aa445d23aebf7f9e2189c";
// fontconfig writes the mtime of the test_fonts directory into the cache. It
// presumably checks this later to ensure that the cache is still up to date.
......@@ -61,6 +59,6 @@ int main() {
// Check existence of intended fontconfig cache file.
CHECK(base::PathExists(
fontconfig_caches.Append(base::StrCat({uuid, "-le64.cache-7"}))));
fontconfig_caches.Append(base::StrCat({cache_key, "-le64.cache-7"}))));
return 0;
}
......@@ -27,9 +27,7 @@ How to update or add fonts:
6. Add all the font_bundle.tar.gz.sha1 file to the chromium src repository, by
executing the following command:
$ git add ./third_party/test_fonts/test_fonts.tar.gz.sha1
7. Update filename constant for fontconfig cache in //base/test/BUILD.gn and
//base/test/generate_fontconfig_caches.cc when test fonts change.
8. (optional) Update FONT_FILES in
7. (optional) Update FONT_FILES in
third_party/blink/tools/blinkpy/web_tests/port/base.py .
If you need access to the chromium-fonts bucket, contact Chrome infra.% For
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment