• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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                   'cherry-pick', 'FETCH_HEAD',
34        ],
35      },
36
37Modify the 'refs/changes/XX/YYYY/ZZ' to the appropriate values (where YYYY is
38the numeric change number, ZZ is the patch set number and XX is the last two
39digits of the numeric change number). This can be seen in the 'Download' link on
40Gerrit.
41
42If this is for a project other than Skia, update the checkout directory and
43fetch source. Note that this can be used multiple times to apply multiple
44issues.
45
46An example of this being used can be seen at
47https://crrev.com/2786433004/#ps1 .
48
49To test locally, run `gclient runhooks` to update the Skia source code.
50Note that if your local skia patch in `third_party/skia` isn't clean (e.g., you
51already applied some patch to it), then `gclient runhooks` won't successfully
52run. In that case, run `git reset --hard` inside `third_party/skia` before
53`gclient runhooks`.
54
55Arbitrary changes
56-----------------
57If the patch is to files where the above is not possible, then it is still
58possible to patch the files manually by adding the following to
59\<chromium>/src/DEPS in the 'hooks' array just before the 'gyp' hook.
60
61      {
62        'name': 'apply_custom_patch',
63        'pattern': '.',
64        'action': ['python',
65                   '-c', 'from distutils.dir_util import copy_tree; copy_tree("src/patch/", "src/");'
66        ],
67      },
68
69Then, copy all 'out of tree' files into \<chromium>/src/patch/, using the same
70directory structure used by Chromium. When 'gclient runhooks' is run, the files
71in \<chromium>/src/patch/ will be copied to and overwrite corresponding files in
72\<chromium>/src/. For example, if changing \<skia>/include/core/SkPath.h, place
73a copy of the modified SkPath.h at
74\<chromium>/src/patch/third_party/skia/include/core/SkPath.h.
75
76An example of this being used can be seen at
77https://crrev.com/1866773002/#ps20001 .
78
79
80Try the patch
81-------------
82After committing a \<chromium>/src/DEPS or \<chromium>/src/patch/ change
83locally, 'git cl upload' can be used in the usual way. Be sure to add
84'COMMIT=false' to the issue description to avoid accidentally checking it in.
85