Clone of https://chromium.googlesource.com/chromium/src/build with Mozilla's local modifications
f24ca38e53
NOTE: This is a reland of the following CL which was reverted: https://chromium-review.googlesource.com/c/chromium/src/+/1131190 The revert was due to a problem with an internal clank/DEPS runhooks step that calls jinja_template.py (see BUG entry below for details). The new CL was checking inputs by defaults, which would raise an error during gclient sync. To ease review, the first CL on gerrit is the original one, unmodified, and the second fixes the issue. ---- end of NOTE ------ ProTip: start by looking at the action_with_pydefps() definition in internal_rules.gni to review changes in this CL. This CL tries to make "gn analyze" smarter by ensuring that it knows about Python module dependencies, for any python script under //build. At the moment, these dependencies are computed by build_utils.WriteDepFile() automatically (unless the add_pydeps=False argument is passed). This adds all imported module paths to the generated .d file written by the script. Unfortunately, because this .d file is generated by the actions, the corresponding Python sources are not part of the target's inputs, known by GN at parse time, and thus do not appear in "gn analyze" properly. This CL tries to solve the problem by adding a new template named "action_with_pydeps", which acts as "action", but also expects a foo.pydeps file for every foo.py invoked through the 'script' scope variable. This '.pydeps' file is read directly at GN parse time and added to the action's target inputs. These .pydeps contain the path of each imported module, one per line, and are generated with build/print_python_deps.py Benchmarking shows no significant difference in the time taken to perform a "gn gen out/Release" on a full Chrome for Android checkout. This also needs a PRESUBMIT.py step that ensures that all .pydeps files are up-to-date with regards to their corresponding .py source files (this can be done with 'gen_pydeps.py --check .../foo.py') + Remove some --depfile options on a few Python scripts that don't need it anymore (e.g. when their inputs and outputs are now fully known by GN at parse time). + Remove uses of compute_inputs_for_analyze in rules.gni and internal_rules.gni (as well as exec_script() calls to print_python_deps.py). Note that the variable itself is still needed for grit inputs, see tools/grit/grit_rule.gni for details). BUG=870845,843562 R=agrieve@chromium.org, estevenson@chromium.org Change-Id: Id1f606a0c9df9e4e8971fd885ac0394103ca7b03 Reviewed-on: https://chromium-review.googlesource.com/1163512 Reviewed-by: agrieve <agrieve@chromium.org> Reviewed-by: Eric Stevenson <estevenson@chromium.org> Commit-Queue: David Turner <digit@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#581158} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 0006f4737647ad0790431737586fd700085f8b0e |
||
---|---|---|
android | ||
args | ||
chromeos | ||
cipd | ||
config | ||
docs | ||
experimental | ||
fuchsia | ||
git-hooks | ||
internal | ||
ios | ||
linux | ||
mac | ||
sanitizers | ||
secondary | ||
toolchain | ||
util | ||
win | ||
.gitignore | ||
BUILD.gn | ||
OWNERS | ||
OWNERS.status | ||
PRESUBMIT.py | ||
apply_locales.py | ||
branding_value.sh | ||
build-ctags.sh | ||
build_config.h | ||
buildflag.h | ||
buildflag_header.gni | ||
check_gn_headers.py | ||
check_gn_headers_unittest.py | ||
check_gn_headers_whitelist.txt | ||
check_return_value.py | ||
ciopfs.sha1 | ||
clobber.py | ||
common.croc | ||
common.gypi | ||
compiled_action.gni | ||
compute_build_timestamp.py | ||
copy_test_data_ios.py | ||
cp.py | ||
detect_host_arch.py | ||
dir_exists.py | ||
dotfile_settings.gni | ||
download_nacl_toolchains.py | ||
download_translation_unit_tool.py | ||
env_dump.py | ||
extract_from_cab.py | ||
find_depot_tools.py | ||
find_isolated_tests.py | ||
fix_gn_headers.py | ||
gdb-add-index | ||
get_landmines.py | ||
gn_helpers.py | ||
gn_helpers_unittest.py | ||
gn_run_binary.py | ||
gyp_chromium | ||
gyp_chromium.py | ||
gyp_environment.py | ||
gyp_helper.py | ||
gypi_to_gn.py | ||
install-build-deps-android.sh | ||
install-build-deps.sh | ||
install-chroot.sh | ||
landmine_utils.py | ||
landmines.py | ||
mac_toolchain.py | ||
nocompile.gni | ||
package_mac_toolchain.py | ||
precompile.cc | ||
precompile.h | ||
print_python_deps.py | ||
protoc_java.py | ||
protoc_java.pydeps | ||
redirect_stdout.py | ||
rm.py | ||
run_swarming_xcode_install.py | ||
sample_arg_file.gn | ||
sanitize-mac-build-log.sed | ||
sanitize-mac-build-log.sh | ||
sanitize-win-build-log.sed | ||
sanitize-win-build-log.sh | ||
shim_headers.gni | ||
split_static_library.gni | ||
swarming_xcode_install.py | ||
symlink.gni | ||
symlink.py | ||
timestamp.gni | ||
tree_truth.sh | ||
update-linux-sandbox.sh | ||
vs_toolchain.py | ||
whitespace_file.txt | ||
win_is_xtree_patched.py | ||
write_build_date_header.py | ||
write_buildflag_header.py |