Commit 587a3c48 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

build_utils.WriteDepfile: Add an assert for passing a string as |inputs|

I've made this mistake a couple of times :(
Without a check, it writes single-letter files to the depfile.

Change-Id: I0cf315573d2ed92b6b23fcf095e7396980d8d03d
Reviewed-on: https://chromium-review.googlesource.com/c/1355324Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612262}
parent e1c5dfda
...@@ -527,6 +527,7 @@ def AddDepfileOption(parser): ...@@ -527,6 +527,7 @@ def AddDepfileOption(parser):
def WriteDepfile(depfile_path, first_gn_output, inputs=None, add_pydeps=True): def WriteDepfile(depfile_path, first_gn_output, inputs=None, add_pydeps=True):
assert depfile_path != first_gn_output # http://crbug.com/646165 assert depfile_path != first_gn_output # http://crbug.com/646165
assert not isinstance(inputs, basestring) # Easy mistake to make
inputs = inputs or [] inputs = inputs or []
if add_pydeps: if add_pydeps:
inputs = _ComputePythonDependencies() + inputs inputs = _ComputePythonDependencies() + inputs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment