)]}'
{
  "commit": "22107b9e53dd956815b2ef254ed75d2b0f252af0",
  "tree": "10f04fc97393a8c2797c07f7c9abc40299a1c4a7",
  "parents": [
    "d0797f10c9382986e1aefa7b72de8926bed5b04f"
  ],
  "author": {
    "name": "DoDo",
    "email": "DoDoENT@users.noreply.github.com",
    "time": "Mon May 18 20:42:04 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon May 18 11:42:04 2026 -0700"
  },
  "message": "[Bazel] Support for a custom prebuilt emscripten cache (#1620)\n\nThis adds support for using a prebuilt cache as an archive instead of\nbuilding it from scratch every time.\n\nThis solves multiple problems:\n\n- build speed on CI machines that have cold cache\n- instead of building the secondary cache every time, it can simply\ndownload it\n- effective support for multiple caches (#1581)\n- emscripten supports having multiple caches on its own, but it builds\n`thinlto`, `lto`, and other cache combinations on demand. This doesn\u0027t\nwork in the Bazel world, where the cache needs to be frozen.\n- the current solution allowed building a secondary cache, but only with\na single configuration\n- this allows the use of any archive that contain any emscripten cache\n- this PR does not handle how that cache is built - you can build it\nwith embuilder, zip it and serve it from your server or whatever you\nwant\n- secondary cache hermeticity problem\n- the current solution for secondary cache generated `emscripten_config`\nfile that contained full path to the cache.\n- this was not hermetic as this path could be different on different\nmachines\n- this PR calculates the cache path by using the same trick with\nenvironment variables, ensuring that `emscripten_config` file is always\nsame, regardless of the machine\n- additionally, it ensures that the cache is provided as an input to the\ntoolchain so that Bazel can correctly add it to the sandbox environment\n\nAfter applying this patch to our internal codebase, the regular builds\nof WASM code went down from 12-15 minutes to cca 30 seconds, regardless\non which machine it runs, as long as remote cache is warm.\n\n---------\n\nCo-authored-by: Copilot Autofix powered by AI \u003c175728472+Copilot@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cc4121eb0b403c458daef9264a0b87be89a6ef24",
      "old_mode": 33188,
      "old_path": "bazel/README.md",
      "new_id": "1212b05ae0be48f530e30fa7350c51f11f59148a",
      "new_mode": 33188,
      "new_path": "bazel/README.md"
    },
    {
      "type": "modify",
      "old_id": "0d7aff28ca543b3291620283416ae39f161eed74",
      "old_mode": 33188,
      "old_path": "bazel/emscripten_build_file.bzl",
      "new_id": "2cf7d951a37d221bfc1a1c69c6b04370380f1571",
      "new_mode": 33188,
      "new_path": "bazel/emscripten_build_file.bzl"
    },
    {
      "type": "modify",
      "old_id": "945c19c011902e41339d3e1de504153b3cc07393",
      "old_mode": 33188,
      "old_path": "bazel/emscripten_cache.bzl",
      "new_id": "06ebb1739becada6203affd4d2b66b3f50d661b6",
      "new_mode": 33188,
      "new_path": "bazel/emscripten_cache.bzl"
    },
    {
      "type": "modify",
      "old_id": "47308f23d5eb634c5103dec3c508c29b005facd5",
      "old_mode": 33188,
      "old_path": "bazel/remote_emscripten_repository.bzl",
      "new_id": "e79fe9574905e184c4e2a83d46a6c57b813c64bf",
      "new_mode": 33188,
      "new_path": "bazel/remote_emscripten_repository.bzl"
    },
    {
      "type": "delete",
      "old_id": "fbd75a7ea77f755203356c737f8844a39b23b7d9",
      "old_mode": 33188,
      "old_path": "bazel/test_external/.bazelrc",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "dde5aa11241aabe33aee468ed06a4656a9a58a69",
      "new_mode": 33188,
      "new_path": "bazel/test_prebuilt_cache/.gitignore"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f787346cc748b313984d1dede8fb69fe574225d3",
      "new_mode": 33188,
      "new_path": "bazel/test_prebuilt_cache/BUILD"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1d9fd7463871563724cf041d5b802d1329e1f507",
      "new_mode": 33188,
      "new_path": "bazel/test_prebuilt_cache/MODULE.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ee72c53171df0fe66056886547c7a4dfac839d5a",
      "new_mode": 33188,
      "new_path": "bazel/test_prebuilt_cache/hello-world.cc"
    },
    {
      "type": "delete",
      "old_id": "fbd75a7ea77f755203356c737f8844a39b23b7d9",
      "old_mode": 33188,
      "old_path": "bazel/test_secondary_lto_cache/.bazelrc",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "5c20a152513470e7133fba973a38a782680d46bb",
      "old_mode": 33188,
      "old_path": "test/test_bazel.ps1",
      "new_id": "143c23c6e4306aff923eb2a7f9945ba8eb11ca15",
      "new_mode": 33188,
      "new_path": "test/test_bazel.ps1"
    },
    {
      "type": "modify",
      "old_id": "7a1d7a2876352ad02f2e9484f7a221dbcf015b11",
      "old_mode": 33261,
      "old_path": "test/test_bazel.sh",
      "new_id": "b2a198eb7d677b41739ea3579d3ac9ae668408ea",
      "new_mode": 33261,
      "new_path": "test/test_bazel.sh"
    },
    {
      "type": "modify",
      "old_id": "e27c657daf2cf33f48650c4ec06911200ccdfe9e",
      "old_mode": 33261,
      "old_path": "test/test_bazel_mac.sh",
      "new_id": "8be9f9070e12b00b490f311005d8703da028daf2",
      "new_mode": 33261,
      "new_path": "test/test_bazel_mac.sh"
    }
  ]
}
