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