Commit 97ec3202 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

jumbo + gn analyze workaround: Add sources to |input|

Jumbo, as implemented as a gn template, will naturally hide
the original files behind new files target_jumbo_1.cc,
target_jumbo_2.cc, .... This breaks the gn analyze step which is
used by cq to figure out if it needs to test compile or not.

To give gn analyze a chance to see what is going on, put the original
sources in the merge action's |input| list. The action won't use
the files and it will serialize actions that don't need serializing
but it might be a small price to pay.

There might be unexpected and unwanted side effects from this.
The cleanest solution would be to give gn native jumbo support
which would also allow other changes like better IDE support
and better error messages, but this is what we got.

Bug: 893071
Change-Id: I36aa498795871a63cfcd4e2d27c29e2f59d5ccbb
Reviewed-on: https://chromium-review.googlesource.com/c/1455943
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629971}
parent dafbc4a1
...@@ -177,6 +177,28 @@ template("internal_jumbo_target") { ...@@ -177,6 +177,28 @@ template("internal_jumbo_target") {
outputs = jumbo_files outputs = jumbo_files
args = [ "--outputs" ] + rebase_path(outputs, root_build_dir) + args = [ "--outputs" ] + rebase_path(outputs, root_build_dir) +
[ "--file-list={{response_file_name}}" ] [ "--file-list={{response_file_name}}" ]
# For the "gn analyze" step to work, gn needs to know about the
# original source files. They can't be in |sources| because then
# they will be compiled, so they have to be somewhere else where
# gn analyze looks. One alternative is the |data| list but that
# will affect test packaging with known bad effects on
# distributed testing. Putting them in this action's input list
# is the least bad place.
inputs = []
foreach(f, invoker_sources - excluded_sources) {
# Avoid generated files and non non-source files.
in_source_tree = string_replace(rebase_path(f),
rebase_path(root_out_dir),
"dummy") == rebase_path(f)
is_source_file = get_path_info(f, "extension") == "cc" ||
get_path_info(f, "extension") == "cpp" ||
get_path_info(f, "extension") == "c" ||
get_path_info(f, "extension") == "mm"
if (in_source_tree && is_source_file) {
inputs += [ f ]
}
}
} }
} else { } else {
# If the list subtraction triggers a gn error, # If the list subtraction triggers a gn error,
......
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