)]}'
{
  "commit": "b8f16458c1d785a24921e569cc6174e8e3f6b45e",
  "tree": "16bde246b8e6e39a11619c4ad6bc6355f45506f4",
  "parents": [
    "4082693e23ec9615f3e9b2ed9fae542e2b3bed12"
  ],
  "author": {
    "name": "Richard Levasseur",
    "email": "rlevasseur@google.com",
    "time": "Sat Jul 08 09:58:12 2023 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sat Jul 08 16:58:12 2023 +0000"
  },
  "message": "feat: Expose Python C headers through the toolchain. (#1287)\n\nThis allows getting a build\u0027s `cc_library` of Python headers through\ntoolchain resolution instead of having to use the underlying toolchain\u0027s\nrepository `:python_headers` target directly.\n\nWithout this feature, it\u0027s not possible to reliably and correctly get\nthe C information about the runtime a build is going to use. Existing\nsolutions require carefully setting up repo names, external state,\nand/or using specific build rules. In comparison, with this feature,\nconsumers are able to simply ask for the current headers via a helper\ntarget or manually lookup the toolchain and pull the relevant\ninformation; toolchain resolution handles finding the correct headers.\n\nThe basic way this works is by registering a second toolchain to carry\nC/C++ related information; as such, it is named `py_cc_toolchain`. The\npy cc toolchain has the same constraint settings as the regular py\ntoolchain; an expected invariant is that there is a 1:1 correspondence\nbetween the two. This base functionality allows a consuming rule\nimplementation to use toolchain resolution to find the Python C\ntoolchain information.\n\nUsually what downstream consumers need are the headers to feed into\nanother `cc_library` (or equivalent) target, so, rather than have every\nproject re-implement the same \"lookup and forward cc_library info\"\nlogic,\nthis is provided by the `//python/cc:current_py_cc_headers` target.\nTargets that need the headers can then depend on that target as if it\nwas a `cc_library` target.\n\nWork towards https://github.com/bazelbuild/rules_python/issues/824",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ac24113d03083738ba46344bcbdd0e422c6979a3",
      "old_mode": 33188,
      "old_path": ".bazelci/presubmit.yml",
      "new_id": "1da4d9fb6ba786c8fe46a1e0f1238a980bc9dfbb",
      "new_mode": 33188,
      "new_path": ".bazelci/presubmit.yml"
    },
    {
      "type": "modify",
      "old_id": "d5b0566f05cca108e02b019020b1e1af6f536eea",
      "old_mode": 33188,
      "old_path": ".bazelrc",
      "new_id": "3611999dacf5c7f89e62bc3e0c24c282c1196ea0",
      "new_mode": 33188,
      "new_path": ".bazelrc"
    },
    {
      "type": "modify",
      "old_id": "938ba85dd5e3db5a6de6f5c4a4a50e65d8a8afd8",
      "old_mode": 33188,
      "old_path": "docs/BUILD.bazel",
      "new_id": "1fb4f81484525a846717d67591337d0a3f801f39",
      "new_mode": 33188,
      "new_path": "docs/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3a59ea90c8f9e98a43e6e29a43bf7a98e8b43f26",
      "new_mode": 33188,
      "new_path": "docs/py_cc_toolchain.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4e59a784151590459310eb79dfc4051e977dbe86",
      "new_mode": 33188,
      "new_path": "docs/py_cc_toolchain_info.md"
    },
    {
      "type": "modify",
      "old_id": "d75889d1889543d121f116b302d8b22cab44ddaa",
      "old_mode": 33188,
      "old_path": "python/BUILD.bazel",
      "new_id": "c5f25803c78cae974114e8df177b82804b31b5b7",
      "new_mode": 33188,
      "new_path": "python/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d4a6bb8f6dc018d593099766aff82990cf031543",
      "new_mode": 33188,
      "new_path": "python/cc/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2e782ef9f0c53c1ac84ea172a2fa51363b77baf4",
      "new_mode": 33188,
      "new_path": "python/cc/py_cc_toolchain.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9ea394ad9fbc73c251b6940b8b1317b1d4d8d571",
      "new_mode": 33188,
      "new_path": "python/cc/py_cc_toolchain_info.bzl"
    },
    {
      "type": "modify",
      "old_id": "f454f42cf3b02e552dbf532c989b955bab34af87",
      "old_mode": 33188,
      "old_path": "python/private/BUILD.bazel",
      "new_id": "10af17e6305cb6cec474ebd4310990c5e45af7e7",
      "new_mode": 33188,
      "new_path": "python/private/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "be7f8f8d46eb387c62e7cb099d34e135eb655b71",
      "new_mode": 33188,
      "new_path": "python/private/current_py_cc_headers.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e7afc10599d0edec31e1fb25b59c339a58a4749b",
      "new_mode": 33188,
      "new_path": "python/private/py_cc_toolchain_info.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "35276f74010cea70487360155d1aedae8128338d",
      "new_mode": 33188,
      "new_path": "python/private/py_cc_toolchain_macro.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c80f845065f9e323f7613db872c6bc84849e7b24",
      "new_mode": 33188,
      "new_path": "python/private/py_cc_toolchain_rule.bzl"
    },
    {
      "type": "modify",
      "old_id": "f47ea8f06422253f2e59589b38c3f95658cdd0c7",
      "old_mode": 33188,
      "old_path": "python/private/toolchains_repo.bzl",
      "new_id": "592378739e47b79131d535e7a10c9b1ea4e877cc",
      "new_mode": 33188,
      "new_path": "python/private/toolchains_repo.bzl"
    },
    {
      "type": "modify",
      "old_id": "f0d43737a032ca5fcab8a635a50f933c3218ce3e",
      "old_mode": 33188,
      "old_path": "python/private/util.bzl",
      "new_id": "4c4b8fcf69395ac9219f06e96ca023398d62b6aa",
      "new_mode": 33188,
      "new_path": "python/private/util.bzl"
    },
    {
      "type": "modify",
      "old_id": "04de6570a058ec21768b2a998889511a2ffbe719",
      "old_mode": 33188,
      "old_path": "python/repositories.bzl",
      "new_id": "38a580e3a876b37b9358ab4119fd65e3a0e3911f",
      "new_mode": 33188,
      "new_path": "python/repositories.bzl"
    },
    {
      "type": "modify",
      "old_id": "abbe62ddff58e258dcac8716bbcdc116f0a14a23",
      "old_mode": 33188,
      "old_path": "tests/BUILD.bazel",
      "new_id": "2dd22821460a412e1bcde6a0477a461c72f439f0",
      "new_mode": 33188,
      "new_path": "tests/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "13395579fd15f9a5d49c82f4c08d58bfb0d49619",
      "new_mode": 33188,
      "new_path": "tests/cc/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e2d6a1b521beabdbe72b4cade3aee8eae5eb8a15",
      "new_mode": 33188,
      "new_path": "tests/cc/current_py_cc_headers/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "2b8b2ee13a0150e63b88642ae613f3d8ebcf0440",
      "new_mode": 33188,
      "new_path": "tests/cc/current_py_cc_headers/current_py_cc_headers_tests.bzl"
    },
    {
      "type": "rename",
      "old_id": "b3214a61ba2bccbdcb5889d9d426cdbcedbd5c7a",
      "old_mode": 33188,
      "old_path": "tools/build_defs/python/tests/fake_cc_toolchain_config.bzl",
      "new_id": "b3214a61ba2bccbdcb5889d9d426cdbcedbd5c7a",
      "new_mode": 33188,
      "new_path": "tests/cc/fake_cc_toolchain_config.bzl",
      "score": 100
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "57d030c75004792ff0cd3089f1bb172a73b4adea",
      "new_mode": 33188,
      "new_path": "tests/cc/py_cc_toolchain/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "09bd64608c209ce33e37c3f2d679bb18447b3095",
      "new_mode": 33188,
      "new_path": "tests/cc/py_cc_toolchain/py_cc_toolchain_tests.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "31ac03a035889ec49f46bd616d0c5c0add940ed2",
      "new_mode": 33188,
      "new_path": "tests/cc_info_subject.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "205dc1e7d9e5ec532726d410ba3a2beb491a7a6d",
      "new_mode": 33188,
      "new_path": "tests/default_info_subject.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "20585e9052c540ed858a96f1caa8fd15dc4d0a1b",
      "new_mode": 33188,
      "new_path": "tests/py_cc_toolchain_info_subject.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9d18980a2fd1352c990883b247d3e8022a5d658f",
      "new_mode": 33188,
      "new_path": "tests/struct_subject.bzl"
    },
    {
      "type": "modify",
      "old_id": "b5694e2f0e8c4b76a4715ead73d6bb7bfef6e1e7",
      "old_mode": 33188,
      "old_path": "tools/build_defs/python/tests/BUILD.bazel",
      "new_id": "e2718508343856429774c35e02d903cecdc024d4",
      "new_mode": 33188,
      "new_path": "tools/build_defs/python/tests/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "59835814938d33a1f010a3980b7f8c57da1e6480",
      "old_mode": 33188,
      "old_path": "tools/build_defs/python/tests/py_test/py_test_tests.bzl",
      "new_id": "1ecb2524bfc3b719cbb2165499f682046214342e",
      "new_mode": 33188,
      "new_path": "tools/build_defs/python/tests/py_test/py_test_tests.bzl"
    }
  ]
}
