Name Description Size
.gitignore 570
.style.yapf 146
add_rts_filters.py Creates a dummy RTS filter file if a real one doesn't exist yes. Real filter files are generated by the RTS binary for suites with any skippable tests. The rest of the suites need to have dummy files because gn will expect the file to be present. Implementation uses try / except because the filter files are written relatively close to when this code creates the dummy files. The following type of implementation would have a race condition: if not os.path.isfile(filter_file): open(filter_file, 'w') as fp: fp.write('*') 1325
android
apple
args
build-ctags.sh 1320
BUILD.gn 1485
build_config.h 8138
buildflag.h 1785
buildflag_header.gni 4603
check_gn_headers.py Find header files missing in GN. This script gets all the header files from ninja_deps, which is from the true dependency generated by the compiler, and report if they don't exist in GN. 9184
check_gn_headers_unittest.py obj/a.o: #deps 1, deps mtime 123 (VALID) ../../a.cc ../../dir/path/b.h ../../c.hh obj/b.o: #deps 1, deps mtime 123 (STALE) ../../b.cc ../../dir2/path/b.h ../../c2.hh obj/c.o: #deps 1, deps mtime 123 (VALID) ../../c.cc ../../build/a.h gen/b.h ../../out/Release/gen/no.h ../../dir3/path/b.h ../../c3.hh 2232
check_gn_headers_whitelist.txt 11576
check_return_value.py This program wraps an arbitrary command and prints "1" if the command ran successfully. 490
chromeos
ciopfs.sha1 40
cipd
clobber.py ninja_required_version = 1.7.2 rule gn command = gn -q gen //out/%s/ description = Regenerating ninja files build build.ninja: gn generator = 1 depfile = build.ninja.d 4133
compiled_action.gni 6019
compute_build_timestamp.py Returns a timestamp that approximates the build date. build_type impacts the timestamp generated, both relative to the date of the last recent commit: - default: the build date is set to the most recent first Sunday of a month at 5:00am. The reason is that it is a time where invalidating the build cache shouldn't have major repercussions (due to lower load). - official: the build date is set to the time of the most recent commit. Either way, it is guaranteed to be in the past and always in UTC. 4880
config
copy_test_data_ios.py Copies test data files or directories into a given output directory. 3279
cp.py Copy a file. This module works much like the cp posix command - it takes 2 arguments: (src, dst) and copies the file with path |src| to |dst|. 592
detect_host_arch.py Outputs host CPU architecture in format recognized by gyp. 1617
dir_exists.py Writes True if the argument is a directory. 569
DIR_METADATA 68
docs
dotfile_settings.gni 1863
download_nacl_toolchains.py Shim to run nacl toolchain download script only if there is a nacl dir. 2081
env_dump.py 1721
extract_from_cab.py Extracts a single file from a CAB archive. 2100
extract_partition.py Extracts an LLD partition from an ELF file. 5552
find_depot_tools.py Small utility function to find depot_tools and add it to the python path. Will throw an ImportError exception if depot_tools can't be found since it imports breakpad. This can also be used as a standalone script to print out the depot_tools directory location. 2248
fix_gn_headers.py Fix header files missing in GN. This script takes the missing header files from check_gn_headers.py, and try to fix them by adding them to the GN files. Manual cleaning up is likely required afterwards. 6691
fuchsia
gdb-add-index 5169
get_landmines.py This file emits the list of reasons why a particular build needs to be clobbered (or a list of 'landmines'). 3629
get_symlink_targets.py Prints the target paths of the given symlinks. Prints out each target in the order that the links were passed in. 716
gn_helpers.py Helper functions useful when writing scripts that integrate with GN. The main functions are ToGNString() and FromGNString(), to convert between serialized GN veriables and Python variables. To use in an arbitrary Python file in the build: import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'build')) import gn_helpers Where the sequence of parameters to join is the relative path from your source file to the build directory. 16641
gn_helpers_unittest.py [ 1, "two", [ "\\"thr,.\\$\\\\", true, false, [], "($0xE2$0x9C$0x93)" ] ] 10468
gn_logs.gni 366
gn_run_binary.py Helper script for GN to run an arbitrary binary. See compiled_action.gni. Run with: python gn_run_binary.py <binary_name> [args ...] 1141
install-build-deps-android.sh 1131
install-build-deps.sh 22148
install-chroot.sh 31315
internal
ios
lacros
landmine_utils.py Returns a string representing the host_os of the current system. Possible values: 'win', 'mac', 'linux', 'unknown'. 664
landmines.py This script runs every gclient runhooks as the first hook (See DEPS). If it detects that the build should be clobbered, it will delete the contents of the build directory. A landmine is tripped when a builder checks out a different revision, and the diff between the new landmines and the old ones is non-null. At this point, the build is clobbered. Before adding or changing a landmine consider the consequences of doing so. Doing so will wipe out every output directory on every Chrome developer's machine. This can be particularly problematic on Windows where the directory deletion may well fail (locked files, command prompt in the directory, etc.), and generated .sln and .vcxproj files will be deleted. This output directory deletion will be repeated when going back and forth across the change that added the landmine, adding to the cost. There are usually less troublesome alternatives. 5180
linux
locale_tool.py Helper script used to manage locale-related files in Chromium. This script is used to check, and potentially fix, many locale-related files in your Chromium workspace, such as: - GRIT input files (.grd) and the corresponding translations (.xtb). - BUILD.gn files listing Android localized resource string resource .xml generated by GRIT for all supported Chrome locales. These correspond to <output> elements that use the type="android" attribute. The --scan-dir <dir> option can be used to check for all files under a specific directory, and the --fix-inplace option can be used to try fixing any file that doesn't pass the check. This can be very handy to avoid tedious and repetitive work when adding new translations / locales to the Chrome code base, since this script can update said input files for you. Important note: checks and fix may fail on some input files. For example remoting/resources/remoting_strings.grd contains an in-line comment element inside its <outputs> section that breaks the script. The check will fail, and trying to fix it too, but at least the file will not be modified. 50545
mac
mac_toolchain.py If should_use_hermetic_xcode.py emits "1", and the current toolchain is out of date: * Downloads the hermetic mac toolchain * Requires CIPD authentication. Run `cipd auth-login`, use Google account. * Accepts the license. * If xcode-select and xcodebuild are not passwordless in sudoers, requires user interaction. * Downloads standalone binaries from [a possibly different version of Xcode]. The toolchain version can be overridden by setting MAC_TOOLCHAIN_REVISION with the full revision, e.g. 9A235. 7151
nocompile.gni 4730
noop.py Script that does nothing successfully. 207
OWNERS 734
OWNERS.setnoparent 2792
OWNERS.status 380
partitioned_shared_library.gni 5805
precompile.cc 360
precompile.h 1153
print_python_deps.py Prints all non-system dependencies for the given module. The primary use-case for this script is to generate the list of python modules required for .isolate files. This script should be compatible with Python 2 and Python 3. 8507
protoc_java.py Generate java source files from protobuf files. This is the action script for the proto_java_library template. It performs the following steps: 1. Deletes all old sources (ensures deleted classes are not part of new jars). 2. Creates source directory. 3. Generates Java files using protoc (output into either --java-out-dir or --srcjar). 4. Creates a new stamp file. 3339
protoc_java.pydeps 213
README.md # About 1651
redirect_stdout.py 657
rm.py Delete a file. This module works much like the rm posix command. 937
rust
sample_arg_file.gn 216
sanitize-mac-build-log.sed 1186
sanitize-mac-build-log.sh 227
sanitize-win-build-log.sed 491
sanitize-win-build-log.sh 227
sanitizers
shim_headers.gni 1056
skia_gold_common
symlink.gni 2607
symlink.py Make a symlink and optionally touch a file (to handle dependencies). 3028
timestamp.gni 1325
toolchain
tree_truth.sh 2865
update-linux-sandbox.sh 2727
util
vs_toolchain.py Returns True if running on a Windows host (including under cygwin). 23266
whitespace_file.txt 7051
win
write_build_date_header.py Takes a timestamp and writes it in as readable text to a .h file. 1146
write_buildflag_header.py 3586
xcode_binaries.yaml 3721