When https://codereview.chromium.org/1812383003/ was submitted (reverted by other reasons), I started seeing errors trying to roll it into WebRTC, our compilation failed with errors like this:
[45/1131] ACTION processing jinja template
Traceback (most recent call last):
File "../../../../build/android/gyp/jinja_template.py", line 124, in <module>
main()
File "../../../../build/android/gyp/jinja_template.py", line 113, in main
variables)
File "../../../../build/android/gyp/jinja_template.py", line 43, in ProcessFile
template = env.get_template(input_rel_path)
File "/ssd/webrtc/src/chromium/src/third_party/jinja2/environment.py", line 791, in get_template
return self._load_template(name, self.make_globals(globals))
File "/ssd/webrtc/src/chromium/src/third_party/jinja2/environment.py", line 765, in _load_template
template = self.loader.load(self, name, globals)
File "/ssd/webrtc/src/chromium/src/third_party/jinja2/loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "../../../../build/android/gyp/jinja_template.py", line 32, in get_source
self, environment, template)
File "/ssd/webrtc/src/chromium/src/third_party/jinja2/loaders.py", line 160, in get_source
pieces = split_template_path(template)
File "/ssd/webrtc/src/chromium/src/third_party/jinja2/loaders.py", line 31, in split_template_path
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: ../../build/android/devil_chromium.jinja
[1127/1127] STAMP obj/All.actions_depends.stamp
It was caused because the CHECKOUT_SOURCE_ROOT environment that can be used to override the location of the checkout's root directory is not set during compilation (only during test execution).
It's read at https://code.google.com/p/chromium/codesearch#chromium/src/build/android/pylib/constants/host_paths.py&l=10
This is something that only hits WebRTC and libyuv since these projects re-use the Chromium build toolchain in an "unsupported" way, by checking out a whole Chromium src repo into a subdirectory of the checkout (chromium/src), then symlinking directories like "build", so build -> chromium/src/build.
That approach has several disadvantages (and I'm trying to find time to fix this properly in https://bugs.chromium.org/p/webrtc/issues/detail?id=5006, but is unlikely to be able to find time for in the near future).
Unfortunately we sometimes hit errors like this when scripts are expecting a specific directory layout and fail when it's not fulfilled.
What I'm wondering about is if https://code.google.com/p/chromium/codesearch#chromium/src/build/android/pylib/constants/host_paths.py could use another approach for finding the root of the checkout?
For our tests, we've been setting the variable in our own test_runner.py script (https://code.google.com/p/chromium/codesearch#chromium/src/third_party/webrtc/build/android/test_runner.py&l=61) but I really don't want to ask all our developers to set CHECKOUT_SOURCE_ROOT when compiling to get around the error that will be caused by the reland of https://codereview.chromium.org/1812383003/
Comment 1 by benhenry@google.com
, Apr 27 2016Labels: -Infra-Android