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