Tweak modularize script

1.) Ignore .json files. On mac, every depfile starts with
    SDKSettings.json, leading to this error:

    mac-x64 raised an exception:
    concurrent.futures.process._RemoteTraceback:
    """
    Traceback (most recent call last):
      File "/usr/lib/python3.13/concurrent/futures/process.py", line 254, in _process_worker
        r = call_item.fn(*call_item.args, **call_item.kwargs)
      File "/usr/local/google/home/thakis/src/chrome/src/build/modules/modularize/modularize.py", line 148, in _modularize
        graph = compiler.compile_all()
      File "/usr/local/google/home/thakis/src/chrome/src/build/modules/modularize/compiler.py", line 51, in new_fn
        result = fn(self, *args)
      File "/usr/local/google/home/thakis/src/chrome/src/build/modules/modularize/compiler.py", line 294, in compile_all
        kind, _ = self.split_path(abs_path)
                  ~~~~~~~~~~~~~~~^^^^^^^^^^
      File "/usr/local/google/home/thakis/src/chrome/src/build/modules/modularize/compiler.py", line 119, in split_path
        raise NotImplementedError(f'Unsupported path {path}')
    NotImplementedError: Unsupported path /usr/local/google/home/thakis/src/chrome/src/build/mac_files/xcode_binaries/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/SDKSettings.json
    """

2.) Use "python3" in run line

3.) Update documentation to be up-to-date after
    https://chromium-review.googlesource.com/c/chromium/src/+/6883372

Change-Id: Id2e36a1d621947408d6ac0e972d99e38f633a8ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7786175
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Matt Stark <msta@google.com>
Cr-Commit-Position: refs/heads/main@{#1619284}
NOKEYCHECK=True
GitOrigin-RevId: 8c5aef6e66e82ea1d9a4ab7e872b5bcde0ab233a
3 files changed
tree: 322fd49eeadcad7de5c54cf07ff545b4686d1875
  1. 3pp_common/
  2. android/
  3. apple/
  4. args/
  5. autoroll/
  6. bench/
  7. chromeos/
  8. cipd/
  9. config/
  10. docs/
  11. fuchsia/
  12. gn_ast/
  13. internal/
  14. ios/
  15. linux/
  16. mac/
  17. mcp_servers/
  18. modules/
  19. private_code_test/
  20. rust/
  21. sanitizers/
  22. skia_gold_common/
  23. toolchain/
  24. util/
  25. win/
  26. .clang-tidy
  27. .clangd
  28. .git-blame-ignore-revs
  29. .gitignore
  30. .style.yapf
  31. action_helpers.py
  32. action_helpers_unittest.py
  33. add_rts_filters.py
  34. build-ctags.sh
  35. BUILD.gn
  36. build_config.h
  37. buildflag.h
  38. buildflag_header.gni
  39. check_gn_headers.py
  40. check_gn_headers_allowlist.txt
  41. check_gn_headers_unittest.py
  42. check_return_value.py
  43. ciopfs.sha1
  44. clobber.py
  45. clobber_unittest.py
  46. compiled_action.gni
  47. compute_build_timestamp.py
  48. copy_test_data_ios.py
  49. cp.py
  50. DEPS
  51. detect_host_arch.py
  52. DIR_METADATA
  53. dotfile_settings.gni
  54. env_dump.py
  55. extract_from_cab.py
  56. extract_partition.py
  57. find_depot_tools.py
  58. fix_gn_headers.py
  59. gdb-add-index
  60. get_landmines.py
  61. get_symlink_targets.py
  62. gn_editor
  63. gn_helpers.py
  64. gn_helpers_unittest.py
  65. gn_logs.gni
  66. gn_run_binary.py
  67. include_sysroot_allowlist.txt
  68. install-build-deps.py
  69. install-build-deps.sh
  70. install-chroot.sh
  71. landmine_utils.py
  72. landmines.py
  73. locale_tool.py
  74. mac_toolchain.py
  75. metadata.json.in
  76. nocompile.gni
  77. noop.py
  78. OWNERS
  79. OWNERS.setnoparent
  80. OWNERS.status
  81. partitioned_shared_library.gni
  82. precompile.cc
  83. precompile.h
  84. PRESUBMIT.py
  85. PRESUBMIT_test.py
  86. print_python_deps.py
  87. protoc_java.py
  88. protoc_java.pydeps
  89. README.md
  90. redirect_stdout.py
  91. rm.py
  92. sample_arg_file.gn
  93. sanitize-mac-build-log.sed
  94. sanitize-mac-build-log.sh
  95. sanitize-win-build-log.sed
  96. sanitize-win-build-log.sh
  97. shim_headers.gni
  98. symlink.gni
  99. symlink.py
  100. timestamp.gni
  101. tree_truth.sh
  102. update-linux-sandbox.sh
  103. vs_toolchain.py
  104. whitespace_file.txt
  105. write_buildflag_header.py
  106. xcode_binaries.yaml
  107. zip_helpers.py
  108. zip_helpers_unittest.py
README.md

About

//build contains:

  • Core GN templates and configuration
  • Core Python build scripts

Since this directory is DEPS'ed in by some other repositories (webrtc, pdfium, v8, etc), it should be kept as self-contained as possible by not referring to files outside of it. Some exceptions exist (//testing, select //third_party subdirectories), but new dependencies tend to break these other projects, and so should be avoided.

Changes to //build should be landed in the Chromium repo. They will then be replicated to the stand-alone build repo by the gsubtreed tool. Note: You can find all directories already available through gsubtreed in the list of all chromium repos.

Contents

  • //build/config - Common templates via .gni files.
  • //build/toolchain - GN toolchain definitions.
  • Other .py files - Some are used by GN/Ninja. Some by gclient hooks, some are just random utilities.

Files referenced by //.gn:

  • //build/BUILDCONFIG.gn - Included by all BUILD.gn files.
  • //build/secondary - An overlay for BUILD.gn files. Enables adding BUILD.gn to directories that live in sub-repositories.
  • //build_overrides - Refer to //build_overrides/README.md.

Docs