)]}'
{
  "commit": "435da51708dc920a57bc8935c347694faa837c19",
  "tree": "badbccb262be2fe5d0021737ec0f9e330dc81689",
  "parents": [
    "722f3b5e9e652b4b3d4c2fbbdd42bf4da967a489"
  ],
  "author": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Thu Oct 22 06:24:26 2015 +0200"
  },
  "committer": {
    "name": "David Ostrovsky",
    "email": "david@ostrovsky.org",
    "time": "Thu Oct 22 06:30:46 2015 +0200"
  },
  "message": "Buck: Trigger pack_war invocation when one of transitive deps changed\n\nBuck version was upgraded in If336ea8697. This version contains\nbehavioral change for genrule()\u0027s rules. Since: [1] the caching\nbehavior was switched to input-based keys. So that the command in\ngenrule() is executed only when one of the input keys has changed.\nThis massive change in behavior broke Gerrit build toolchain in\nvery subtle way: when gerrit.war was built once, it wasn\u0027t rebuilt\nany more unless caches were invalidated.  To understand why this\nis the case, some background understanding needed how gerrit.war\nis packaged in our build toolchain. Gathering of gerrit.war is done\nby genrule() that executes python script that retrieves the needed\nlibraries by issuing buck audit classpath. However, since: [1] this\npython script is not invoked any more, when some libraries in\ntransitive dependency chain have changed, because only very few\nlibraries specified as the input to this python rule and the rest of\nthe dependencies is retrieved in dynamic way in the script itself.\nSo when some source code was changed, and corresponding library, say\ngerrit-server was changed as well, the first order dependency to the\npython script, like gerrit-pgm wasn\u0027t changed, and thus its rule key\nremained stable, so that pack_war.py wasn\u0027t invoked any more, leaving\ngerrit.war stale.\n\nThe reproducer for this problem can be found here: [2]. The upstream\nissue is here: [3].\n\nThe fix is straight forward: instead of passing only the first order\ndependencies to the war packager script (that cannot reliably be done\nafter changed caching behavior of genrule() in: [1]) and issue buck\naudit classpath in python script, pass the whole classpath from Buck\nbuild file to war packager. For one this will fix the caching issue,\nas the rule key now reflects the whole classpath and thus would change\nif some deps in transitive dependency chain would change, for another\nwe wouldn\u0027t have to retrieve the classpath twice: in Buck build itself\nand in war packager script.\n\n[1] https://github.com/facebook/buck/commit/143646f4ccd8737f73a2667a244c4c38dc18cb89\n[2] https://github.com/davido/buck_genrule_changed_caching_behaviour_143646f\n[3] https://github.com/facebook/buck/issues/470\n\nTest plan:\n\n* buck build gitiles\n* change some sources in gitiles-servlet project\n* buck build gitiles\n* verify that gitiles.war was rebuilt in previous step and reflect the\n  changes made in gitiles-servlet project\n\nReported-By: Doug Kelly \u003cdougk.ff7@gmail.com\u003e\nChange-Id: I5e22e2d46c82fa5071db34762bda1655d6d353bf\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cfd79638cde0e14aaabf85fd29cea99b6dec8128",
      "old_mode": 33261,
      "old_path": "tools/pack_war.py",
      "new_id": "c4ffacc5070826b72c57b0e24e298bf0943c56ba",
      "new_mode": 33261,
      "new_path": "tools/pack_war.py"
    },
    {
      "type": "modify",
      "old_id": "0ac346ad29ef62f986b63f6e07e90f7f52c54107",
      "old_mode": 33188,
      "old_path": "war.bucklet",
      "new_id": "adc0072f4084bef1276f23a371700cdb6c26fe58",
      "new_mode": 33188,
      "new_path": "war.bucklet"
    }
  ]
}
