)]}'
{
  "commit": "04a2891d554d2325f04631bac356c29ffcdebf2a",
  "tree": "1712f2213433b06900486b1774190850206bf3a7",
  "parents": [
    "ab9104586734cb45aa77c70ca5042edbcc9f6aa5"
  ],
  "author": {
    "name": "David Turner",
    "email": "digit@google.com",
    "time": "Wed Apr 06 13:41:25 2022 +0000"
  },
  "committer": {
    "name": "Commit Bot",
    "email": "commit-bot@chromium.org",
    "time": "Wed Apr 06 13:44:56 2022 +0000"
  },
  "message": "Revert \"Fix output directories for generated source files.\"\n\nThis reverts commit ab9104586734cb45aa77c70ca5042edbcc9f6aa5.\n\nReason for revert: There may be other ways to solve the original issue.\n\nOriginal change\u0027s description:\n\u003e Fix output directories for generated source files.\n\u003e\n\u003e This CL fixes an annoying issue where the local build directory path\n\u003e leaks into the generated Ninja files when {{source_out_dir}} or\n\u003e even {{source_gen_dir}} are expanded.\n\u003e\n\u003e In the case of a generated source file, its path will be source-absolute\n\u003e but located in the build directory, for example:\n\u003e\n\u003e   //out/Debug/gen/header.h\n\u003e   //out/Debug/toolchain/gen/src/source.cc\n\u003e\n\u003e Before this CL, the computed output directory would leak the \u0027out/Debug\u0027\n\u003e prefix, i.e. compute an output path, relative to `out/Debug` as:\n\u003e\n\u003e   obj/out/Debug/gen/\n\u003e   obj/out/Debug/toolchain/gen/src/\n\u003e\n\u003e After this CL, the build directory prefix is replaced with the\n\u003e \"BUILD_DIR\" string literal, and the result becomes:\n\u003e\n\u003e   obj/BUILD_DIR/gen/\n\u003e   obj/BUILD_DIR/toolchain/gen/src\n\u003e\n\u003e This makes the commands more hermetic, especially with regards to remote\n\u003e builds which implement content-based caching, using the command hash as\n\u003e a key.\n\u003e\n\u003e I tested that I could still build Fuchsia, Chromium and Pigweed with\n\u003e this patch (as long as Pigwedd\u0027s build system is fixed with [1] to\n\u003e support upstream GN).\n\u003e\n\u003e Note that this CL is required to unblock the GN auto-roller for the\n\u003e Fuchsia project: without it, the output directory leak checks will fail\n\u003e the builds since the latest Rust-related changes adds a ton of\n\u003e `-Lnative\u003d\u003cpath-with-build-directory\u003e` to a very large number of\n\u003e Rust link commands.\n\u003e\n\u003e [1] https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/90080\n\u003e\n\u003e Change-Id: I2dc811c295aa47dc412175bd74acc1333f8145e8\n\u003e Reviewed-on: https://gn-review.googlesource.com/c/gn/+/13240\n\u003e Reviewed-by: Sylvain Defresne \u003csdefresne@chromium.org\u003e\n\u003e Commit-Queue: David Turner \u003cdigit@google.com\u003e\n\nTBR\u003dbrettw@chromium.org,digit@google.com,sdefresne@chromium.org\n\nChange-Id: I290e2e8375c1e6aebfa76c2c00910bd364a54562\nNo-Presubmit: true\nNo-Tree-Checks: true\nNo-Try: true\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/13540\nReviewed-by: David Turner \u003cdigit@google.com\u003e\nReviewed-by: Sylvain Defresne \u003csdefresne@chromium.org\u003e\nCommit-Queue: Sylvain Defresne \u003csdefresne@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7a7078edd800ef8a7c31bdad45a08bafd280044c",
      "old_mode": 33188,
      "old_path": "src/gn/filesystem_utils.cc",
      "new_id": "6de3fbdf6c33fd4f03f71723c7f1a23f9033f151",
      "new_mode": 33188,
      "new_path": "src/gn/filesystem_utils.cc"
    },
    {
      "type": "modify",
      "old_id": "b32d8c76a56fb72bb28dbe5f208c79925f83c42f",
      "old_mode": 33188,
      "old_path": "src/gn/ninja_c_binary_target_writer_unittest.cc",
      "new_id": "e4ec8006bd45f57bb246c0c6d790ee5b8911a978",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_c_binary_target_writer_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "eaa521ab9c335cfbf50d79a6c5e08415109803b5",
      "old_mode": 33188,
      "old_path": "src/gn/substitution_writer_unittest.cc",
      "new_id": "fc3c44692a746d6d452c6ef36ab3f76864281489",
      "new_mode": 33188,
      "new_path": "src/gn/substitution_writer_unittest.cc"
    }
  ]
}
