1Multiple repo Chromium trybots 2============================== 3 4When a proposed Skia change will require a change in Chromium or Blink it is 5often helpful to locally create the Chromium and Blink changes and test with the 6proposed Skia change. This often happens with Skia API changes and changes 7which affect Blink layout tests. While simple to do locally, this explains how 8to do so on the Chromium trybots. 9 10Skia only changes 11----------------- 12If the Skia patch is already in Gerrit and there are no associated Chromium 13changes, then it is possible to just run the Chromium trybots. This will apply 14the Skia patch and run the bot. 15 16Skia and Chromium changes 17------------------------- 18If the Skia patch is already in Gerrit and there are associated Chromium 19changes, then in the Chromium CL add the following to 20\<chromium>/src/DEPS in the 'hooks' array. 21 22 { 23 'name': 'fetch_custom_patch', 24 'pattern': '.', 25 'action': [ 'git', '-C', 'src/third_party/skia/', 26 'fetch', 'https://skia.googlesource.com/skia', 'refs/changes/13/10513/13', 27 ], 28 }, 29 { 30 'name': 'apply_custom_patch', 31 'pattern': '.', 32 'action': ['git', '-C', 'src/third_party/skia/', 33 '-c', 'user.name=Custom Patch', '-c', 'user.email=custompatch@example.com', 34 'cherry-pick', 'FETCH_HEAD', 35 ], 36 }, 37 38Modify the 'refs/changes/XX/YYYY/ZZ' to the appropriate values (where YYYY is 39the numeric change number, ZZ is the patch set number and XX is the last two 40digits of the numeric change number). This can be seen in the 'Download' link on 41Gerrit. 42 43If this is for a project other than Skia, update the checkout directory and 44fetch source. Note that this can be used multiple times to apply multiple 45issues. 46 47An example of this being used can be seen at 48https://crrev.com/2786433004/#ps1 . 49 50To test locally, run `gclient runhooks` to update the Skia source code. 51Note that if your local skia patch in `third_party/skia` isn't clean (e.g., you 52already applied some patch to it), then `gclient runhooks` won't successfully 53run. In that case, run `git reset --hard` inside `third_party/skia` before 54`gclient runhooks`. 55 56Arbitrary changes 57----------------- 58If the patch is to files where the above is not possible, then it is still 59possible to patch the files manually by adding the following to 60\<chromium>/src/DEPS in the 'hooks' array just before the 'gyp' hook. 61 62 { 63 'name': 'apply_custom_patch', 64 'pattern': '.', 65 'action': ['python2', 66 '-c', 'from distutils.dir_util import copy_tree; copy_tree("src/patch/", "src/");' 67 ], 68 }, 69 70Then, copy all 'out of tree' files into \<chromium>/src/patch/, using the same 71directory structure used by Chromium. When `gclient runhooks` is run, the files 72in \<chromium>/src/patch/ will be copied to and overwrite corresponding files in 73\<chromium>/src/. For example, if changing \<skia>/include/core/SkPath.h, place 74a copy of the modified SkPath.h at 75\<chromium>/src/patch/third_party/skia/include/core/SkPath.h. 76 77An example of this being used can be seen at 78https://crrev.com/1866773002/#ps20001 . 79 80 81Try the patch 82------------- 83After committing a \<chromium>/src/DEPS or \<chromium>/src/patch/ change 84locally, `git cl upload` can be used in the usual way. Be sure to add 85`COMMIT=false` to the issue description to avoid accidentally checking it in. 86