)]}'
{
  "commit": "fd9f2036f26d83f9fcfe93042fb952e5a7fe2167",
  "tree": "1a86a73b7de0d530a96d665ada0b2ab606ec0896",
  "parents": [
    "c114b7e0b3a327e854cae6b560902230436f1ac7"
  ],
  "author": {
    "name": "David \u0027Digit\u0027 Turner",
    "email": "digit@google.com",
    "time": "Thu Mar 17 16:48:41 2022 +0100"
  },
  "committer": {
    "name": "Commit Bot",
    "email": "commit-bot@chromium.org",
    "time": "Thu Apr 14 15:09:48 2022 +0000"
  },
  "message": "Fix output directories for generated source files.\n\nNOTE: This is a re-land of [2] since another way to fix the issue\n      could not be found.\n\nThis CL fixes an annoying issue where the local build directory path\nleaks into the generated Ninja files when {{source_out_dir}} or\neven {{source_gen_dir}} are expanded.\n\nIn the case of a generated source file, its path will be source-absolute\nbut located in the build directory, for example:\n\n  //out/Debug/gen/header.h\n  //out/Debug/toolchain/gen/src/source.cc\n\nBefore this CL, the computed output directory would leak the \u0027out/Debug\u0027\nprefix, i.e. compute an output path, relative to `out/Debug` as:\n\n  obj/out/Debug/gen/\n  obj/out/Debug/toolchain/gen/src/\n\nAfter this CL, the build directory prefix is replaced with the\n\"BUILD_DIR\" string literal, and the result becomes:\n\n  obj/BUILD_DIR/gen/\n  obj/BUILD_DIR/toolchain/gen/src\n\nThis makes the commands more hermetic, especially with regards to remote\nbuilds which implement content-based caching, using the command hash as\na key. It is also similar to what GN does for absolute paths, where it\nuses the ABS_PATH literal to create target-specific directories for\nsources that have an absolute path.\n\nI tested that I could still build Fuchsia, Chromium and Pigweed with\nthis patch (as long as Pigwedd\u0027s build system is fixed with [1] to\nsupport upstream GN).\n\nNote that this CL is required to unblock the GN auto-roller for the\nFuchsia project: without it, the output directory leak checks will fail\nthe builds since the latest Rust-related changes adds a ton of\n`-Lnative\u003d\u003cpath-with-build-directory\u003e` to a very large number of\nRust link commands.\n\n[1] https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/90080\n[2] https://gn-review.googlesource.com/c/gn/+/13240\n\nChange-Id: I85b7798b25f282085864a6cb58a7eecb85648881\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/13580\nReviewed-by: Brett Wilson \u003cbrettw@chromium.org\u003e\nCommit-Queue: David Turner \u003cdigit@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6de3fbdf6c33fd4f03f71723c7f1a23f9033f151",
      "old_mode": 33188,
      "old_path": "src/gn/filesystem_utils.cc",
      "new_id": "7a7078edd800ef8a7c31bdad45a08bafd280044c",
      "new_mode": 33188,
      "new_path": "src/gn/filesystem_utils.cc"
    },
    {
      "type": "modify",
      "old_id": "6056c36885e5be6160a10687d58dd429ea585fe5",
      "old_mode": 33188,
      "old_path": "src/gn/ninja_c_binary_target_writer_unittest.cc",
      "new_id": "94761931607b456242be07f7ab643c7ed693a09c",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_c_binary_target_writer_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "fc3c44692a746d6d452c6ef36ab3f76864281489",
      "old_mode": 33188,
      "old_path": "src/gn/substitution_writer_unittest.cc",
      "new_id": "eaa521ab9c335cfbf50d79a6c5e08415109803b5",
      "new_mode": 33188,
      "new_path": "src/gn/substitution_writer_unittest.cc"
    }
  ]
}
