)]}'
{
  "commit": "19db71413329da3f5d22b5fc7681471f3d971d88",
  "tree": "30378f5692e8388c86ddcfda56a8ab3d5c5a1f1d",
  "parents": [
    "d9db4754a5b3d50ac50131d637140c07696567a2"
  ],
  "author": {
    "name": "Mark Schaller",
    "email": "mschaller@google.com",
    "time": "Thu Sep 01 17:58:02 2016 +0000"
  },
  "committer": {
    "name": "Klaus Aehlig",
    "email": "aehlig@google.com",
    "time": "Fri Sep 02 08:27:01 2016 +0000"
  },
  "message": "Skylark: Replaced late bound attributes with computed default attributes\n\nMotivation:\n\nCompared to computed default attributes, late bound attributes are\nevaluated in a later phase (analysis instead of loading phase). While\nboth mechanisms provide access to other attributes of a rule, only\nlate bound attributes additionally provide access to the build\nconfiguration.\n\nHowever, late bound attributes could be used to return new labels that\nhave not been loaded before. Since this happens in the analysis phase,\nit can break one of Blaze\u0027s underlying principles, thus introducing a\nserious correctness bug.\n\nWe decided to replace late bound attributes in Skylark with computed\ndefault attributes since this moves the evaluation of values into the\nloading phase, thus fixing this bug. Moreover, none of the existing\nusers of this mechanism required access to the build configuration,\nwhich means that the user impact of this change is minimal.\n\nImplementation details:\n\nUnlike attributes of non-Skylark rules, however, Skylark computed\ndefaults need to be able to depend on more than two configurable\nattributes since all attributes of Skylark rules are configurable by\ndefault. This has two implications:\n\n1. Unlike \"normal\" Skylark attributes, Skylark computed defaults need\nto know about the existence of other attributes in order to declare a\ndependency on them. This CL takes advantage of work previously done to\nrequire parameter names to be the names of attributes used by the\ncomputed default function.\n\n2. Since Bazel computes the combinations of all possible attribute\nvalues, a Skylark rule with a computed default that depends on a lot\nof configurable attributes could crash Bazel. Consequently, this CL\nalso introduces an upper bound (64) for the number of valid\ncombinations.\n\nCaveats:\n\n1. Getting the depended-on attributes\u0027 names from function paramters is\nmildly surprising.\n\nAlternatives:\n\nThe best solution would be to keep SkylarkLateBound, but restrict it in\na way that it can only return already loaded labels. This is not\npossible right now.\n\n--\nMOS_MIGRATED_REVID\u003d131967238\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4fab639d963b22754d2c2475a68b52ee04f9811a",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java",
      "new_id": "abaccccdff2afccff8f483798ad1a65de5501003",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java"
    },
    {
      "type": "modify",
      "old_id": "996371494d57d7888d63ca36c3db20ec0d2873e0",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/packages/Attribute.java",
      "new_id": "68540c8b879e13f806a9a1e759374ff6c2e8ea78",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/packages/Attribute.java"
    },
    {
      "type": "modify",
      "old_id": "30999c283f2554b9a9c23cb99080f63a57dfef3a",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/packages/AttributeValueSource.java",
      "new_id": "7acaa58444c2fe124681b8d26aa2fbb03e468b15",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/packages/AttributeValueSource.java"
    },
    {
      "type": "modify",
      "old_id": "751e6cf7f6ec8a1962383a44fcf39366015d7cce",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/packages/RuleClass.java",
      "new_id": "cba10a705f94a5bd74266ad0c4e66fd8172b24ce",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/packages/RuleClass.java"
    },
    {
      "type": "modify",
      "old_id": "3b6cf4c904a84db6821eeb524780168bbb4146e0",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/packages/RuleFactory.java",
      "new_id": "4795c7b1ace999ba077fdaeaabeb06ae33b5defc",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/packages/RuleFactory.java"
    },
    {
      "type": "modify",
      "old_id": "3e2665dc973686c27e2db764efb51e9af3a45d7c",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java",
      "new_id": "49740a5fe4f26b74e3820e24ccdd2c8c40187294",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java"
    },
    {
      "type": "modify",
      "old_id": "04ff0ac2e7b879b67bb60f68899ab2c557d026ae",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/syntax/UserDefinedFunction.java",
      "new_id": "60b293bb1abb0e967031a5476cd1c62524a31904",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/syntax/UserDefinedFunction.java"
    },
    {
      "type": "modify",
      "old_id": "9f4514cd943aaf9290feb5333dbf2e18f69d52cd",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java",
      "new_id": "1426ea58fc359c0d9d71eac0c149e3ea62af6961",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java"
    },
    {
      "type": "modify",
      "old_id": "24965818f04ccabf020efc57ee33c40776414c35",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/devtools/build/lib/packages/RuleClassTest.java",
      "new_id": "03fbd31bda34ebc4f3d8f787d3aff263bcde9a18",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/devtools/build/lib/packages/RuleClassTest.java"
    }
  ]
}
