)]}'
{
  "commit": "4c122caddf1bdb454a2e2c06d850ba58fd508b90",
  "tree": "124541b5f4d9bf4e1520b3fc74ab88399554cb43",
  "parents": [
    "b98227b7c386f0c0434758588ae577a7dbdf838a"
  ],
  "author": {
    "name": "Takuto Ikuta",
    "email": "tikuta@google.com",
    "time": "Tue Sep 15 11:48:55 2026 +0900"
  },
  "committer": {
    "name": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "gn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Sep 14 20:30:02 2026 -0700"
  },
  "message": "[gn] Use DCHECK in Target::info()\n\nFollow-up to https://gn-review.googlesource.com/c/gn/+/26480.\n\nAs pointed out by Matt Stark (msta@), having a lazy\n\u0027info_.emplace(this)\u0027 fallback inside Target::info() could theoretically\nallow concurrent mutation if info() were ever called on an unresolved\ntarget in a multi-threaded context.\n\nIn production, Target::OnResolvedWithoutChecks() is always called before\nany multi-threaded queries occur. Across the entire unit test suite (845\ntests), only a single test (NinjaCBinaryTargetWriterTest.\nDupeObjFileError) invoked NinjaCBinaryTargetWriter without calling\nOnResolved() first.\n\nBy adding \u0027ASSERT_TRUE(target.OnResolved(\u0026err))\u0027 to DupeObjFileError, we\ncan replace the lazy initialization in Target::info() with\n\u0027DCHECK(info_.has_value())\u0027, making info() strictly read-only and\nbranchless in release builds.\n\nNote: \u0027info_\u0027 itself remains \u0027mutable\u0027 because ResolvedTargetData\nqueries receive \u0027const Target*\u0027 and lazily compute/populate the cache\nfields inside TargetInfo (e.g., lib_dirs, inherited_libs). Keeping\n\u0027mutable\u0027 on \u0027info_\u0027 as a whole avoids scattering \u0027mutable\u0027 across ~20\nindividual fields inside TargetInfo and modifying all helper signatures.\n\nTAG\u003dagy\nCONV\u003d4cb5d931-60a8-4f44-8632-3e8d9fb10a8d\nChange-Id: I6a697e0172473d38b80ca04ea0985c6dab8e3d44\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/26500\nCommit-Queue: Takuto Ikuta \u003ctikuta@google.com\u003e\nReviewed-by: Matt Stark \u003cmsta@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "34a473fa7ae7c58f7c831a77fa8bc6253b2c2e70",
      "old_mode": 33188,
      "old_path": "src/gn/ninja_c_binary_target_writer_unittest.cc",
      "new_id": "2f4977d53d62bd08a84373d25871099068c612c1",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_c_binary_target_writer_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "17995f7fe931a77f6107cad030bf698da2bb3eb7",
      "old_mode": 33188,
      "old_path": "src/gn/target.h",
      "new_id": "17e96d48dbc27696f427031620cbf796fa5a02cd",
      "new_mode": 33188,
      "new_path": "src/gn/target.h"
    }
  ]
}
