)]}'
{
  "commit": "a3cdab5e2670792d5c31b28606722fe11b8d4356",
  "tree": "2b27d70e8e87fda5c70384a4c884da3609ba3cf1",
  "parents": [
    "f6361e4dc33f841ecd526f0dc16797a52f451e8c"
  ],
  "author": {
    "name": "Richard Levasseur",
    "email": "rlevasseur@google.com",
    "time": "Fri Oct 11 11:25:34 2024 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Oct 11 18:25:34 2024 +0000"
  },
  "message": "fix(precompiling)!: make binary-level precompile opt-in/opt-opt work (#2243)\n\nThis makes binary-level opt-in/opt-out of precompiling work as intended.\nPreviously,\nwhen `pyc_collection\u003dinclude_pyc` was set on a binary, only transitive\nlibraries that\nhad explicitly enabled precompiling were being included (which was moot\nanyways --\nlibraries put their files in runfiles, so no matter what, their files\nwere included).\n\nThe intent was that, when a binary set `pyc_collection\u003dinclude_pyc`,\nthen precompiled\nfiles would be used for all its transitive dependencies (unless they\nhad, at the\ntarget-level, disabled precompiling). Conversely, if\n`pyc_collection\u003ddisabled` was set,\nthe precompiled files would not be used (unless a target had, at the\ntarget level,\nenabled precompiling).\n\nTo make it work as desired, the basic fix is to make it so that\nlibraries have a place to\nput the implicit pyc files (the ones automatically generated), and have\nthe binaries\ninclude those when requested. The net effect is a library has 4 sets of\nfiles it produces:\n* required py files: py source files that should always go into the\nbinary\u0027s runfiles\n* required pyc files: precompiled pyc files that should always go into\nthe binary\u0027s\n  runfiles (e.g., when a library sets `precompile\u003denabled` directly).\n* implicit pyc files: precompiled pyc files for a library that are\nalways generated, but\n  it\u0027s up to the binary if they go into the runfiles\n* implicit pyc source files: the source py file for an implicit pyc\nfile. When a binary\n*doesn\u0027t* include the implicit pyc file, it must include the source py\nfile (otherwise\n  none of the library\u0027s code ends up included).\n\nSimilarly, in order to allow a binary to decide what files are used,\nlibraries must\nstop putting the py/pyc files into runfiles themselves. While this is\npotentially\na breaking change, I found that, within Google, there was no reliance on\nthis behavior,\nso should be safe enough. That said, I added `--add_srcs_to_runfiles` to\nrestore\nthe previous behavior to aid in transitioning.\n\n**BREAKING CHANGES**\n1. `py_library` no longer puts its srcs into runfiles directly.\n2. Removed `--precompile_add_to_runfiles`\n3. Removed `--pyc_collection`\n4. `precompile\u003dif_generated_source` removed\n5. `precompile_source_retention\u003domit_if_generated_source` removed\n\nThough 2 through 5 are technically breaking changes, I don\u0027t think\nprecompiling\nwas very usable anyways, so usages of those flags/values is rare.\n\nFixes https://github.com/bazelbuild/rules_python/issues/2212",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5473dc529f66b8992bb4ee2b843eceafa927ddf9",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "abaa2bba39e621b947c4a4e2ed0b6e89b2faf45e",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "645e4e224610c3c40a9a6773304eb43d00345669",
      "old_mode": 33188,
      "old_path": "docs/api/rules_python/python/config_settings/index.md",
      "new_id": "511a218eef087a552c9d3d398ccd9f4e9ef7b572",
      "new_mode": 33188,
      "new_path": "docs/api/rules_python/python/config_settings/index.md"
    },
    {
      "type": "modify",
      "old_id": "52678e63ea7eef7d23125faf6587fc427b4ceb20",
      "old_mode": 33188,
      "old_path": "docs/precompiling.md",
      "new_id": "6eadc4042b6aa959eb96b21c39372b8b68684add",
      "new_mode": 33188,
      "new_path": "docs/precompiling.md"
    },
    {
      "type": "modify",
      "old_id": "9fb395741b8a2cc20af4aad1cc75979edad7be29",
      "old_mode": 33188,
      "old_path": "python/config_settings/BUILD.bazel",
      "new_id": "b55213b5d6816a788027bfb6ac29f1a352d35d1f",
      "new_mode": 33188,
      "new_path": "python/config_settings/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "6fb4a1ccc2e72d563d0cc0c46a2d2a448de4ea1a",
      "old_mode": 33188,
      "old_path": "python/private/BUILD.bazel",
      "new_id": "cee77c5836f0d4ab080a5c3dbea6e122b7bdeddf",
      "new_mode": 33188,
      "new_path": "python/private/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "0299e85657d6ccf4aa4e957adb3beddaeae44926",
      "old_mode": 33188,
      "old_path": "python/private/common/attributes.bzl",
      "new_id": "56e8a66e19051ccbd4804d2c01b5bb7d39657dc6",
      "new_mode": 33188,
      "new_path": "python/private/common/attributes.bzl"
    },
    {
      "type": "modify",
      "old_id": "99a632484d804c1b17b2b30d181a59d9210771b9",
      "old_mode": 33188,
      "old_path": "python/private/common/common.bzl",
      "new_id": "ec46ea8965f9e06fb611b05964c270ea5cf6df32",
      "new_mode": 33188,
      "new_path": "python/private/common/common.bzl"
    },
    {
      "type": "modify",
      "old_id": "c86abd27f08d6b37f29b860e010b1895184c2740",
      "old_mode": 33188,
      "old_path": "python/private/common/common_bazel.bzl",
      "new_id": "6148fc2daa56ec1d993699af6326ac3100800e3a",
      "new_mode": 33188,
      "new_path": "python/private/common/common_bazel.bzl"
    },
    {
      "type": "modify",
      "old_id": "cfd9961606bd080cb69b251e0fb200c435c3b537",
      "old_mode": 33188,
      "old_path": "python/private/common/py_executable.bzl",
      "new_id": "6c238a2a5d7813094a80869f4955702c45246ce8",
      "new_mode": 33188,
      "new_path": "python/private/common/py_executable.bzl"
    },
    {
      "type": "modify",
      "old_id": "078626e063447c0f26b7ebcd4c472d3aee37350c",
      "old_mode": 33188,
      "old_path": "python/private/common/py_library.bzl",
      "new_id": "bce18c3132f6b0ec6a254818bc05d64651a81459",
      "new_mode": 33188,
      "new_path": "python/private/common/py_library.bzl"
    },
    {
      "type": "modify",
      "old_id": "011d9fbda14ea4d56e51281b6cef3e3438f44e28",
      "old_mode": 33188,
      "old_path": "python/private/enum.bzl",
      "new_id": "d71442e3b5cda264231abb63a140fbdca85563a3",
      "new_mode": 33188,
      "new_path": "python/private/enum.bzl"
    },
    {
      "type": "modify",
      "old_id": "652e11722183fd088fa5c570d4f9186073363466",
      "old_mode": 33188,
      "old_path": "python/private/flags.bzl",
      "new_id": "e7643fc1ae3acfd5097fe45bffadd155bb63d61b",
      "new_mode": 33188,
      "new_path": "python/private/flags.bzl"
    },
    {
      "type": "modify",
      "old_id": "e123ff847659597e758670428ab17a7ed5a935ca",
      "old_mode": 33188,
      "old_path": "python/private/proto/py_proto_library.bzl",
      "new_id": "ecb0938bcd2426ca19a0f09358966ffb18df7143",
      "new_mode": 33188,
      "new_path": "python/private/proto/py_proto_library.bzl"
    },
    {
      "type": "modify",
      "old_id": "ce56e2330abf83b36999f8c6faa51a6cf5efe789",
      "old_mode": 33188,
      "old_path": "python/private/py_info.bzl",
      "new_id": "6c2c3c64994191faaecce6ca78f7604360adb936",
      "new_mode": 33188,
      "new_path": "python/private/py_info.bzl"
    },
    {
      "type": "modify",
      "old_id": "08f4b0b31814b46121c78fa4f0a3ac3ea8789b50",
      "old_mode": 33188,
      "old_path": "python/private/py_package.bzl",
      "new_id": "fd8bc2724cad17b32361d5e4a54f4885dc502ca2",
      "new_mode": 33188,
      "new_path": "python/private/py_package.bzl"
    },
    {
      "type": "modify",
      "old_id": "4c0f936ac554129adccee14c236ef2e9e1aa9496",
      "old_mode": 33188,
      "old_path": "tests/base_rules/precompile/precompile_tests.bzl",
      "new_id": "9d6ac5f7d4d1f767f052dd3f1816d7592c15bbcf",
      "new_mode": 33188,
      "new_path": "tests/base_rules/precompile/precompile_tests.bzl"
    },
    {
      "type": "modify",
      "old_id": "150ca7f4a41cec9018eadb558fe3aa3bea60611a",
      "old_mode": 33188,
      "old_path": "tests/support/support.bzl",
      "new_id": "7358a6b1ee6252c616b2246b96f08d0ce93d75ac",
      "new_mode": 33188,
      "new_path": "tests/support/support.bzl"
    }
  ]
}
