)]}'
{
  "commit": "42b7e6194d03510c472d5e22daf2e876f95a4048",
  "tree": "af3e2365365c60c4fbddfe8a23e6938bfbae8650",
  "parents": [
    "c27196f8bb13acb4c04f607ab4fa15791c25495e"
  ],
  "author": {
    "name": "Régis Desgroppes",
    "email": "rdesgroppes@gmail.com",
    "time": "Tue Feb 10 05:47:58 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Feb 09 23:47:58 2026 -0500"
  },
  "message": "fix(pkg_install): resolve files against own repository (#1016)\n\ntl;dr: this change builds on #984 which introduced the `locate()` helper\nand the `runfiles` infrastructure. That PR fixed Windows compatibility\nby enabling runfiles-less operation; this change extends it to support\ncross-repository files.\n\nWhen a `pkg_install` rule in an external repository references files\nfrom another repository, the installer would fail at runtime by\nattempting to resolve all files relative to its repository rather than\neach file\u0027s own repository.\n\nExample failure (`extrepo`: external repository installing file from\nmain repository):\n```\nbazel run @extrepo//:install -- --destdir\u003d/tmp/test\n[...]\nFileNotFoundError: [Errno 2] No such file or directory:\n  \u0027.../runfiles/+_repo_rules+extrepo/some-path/extrepo/file-in-main-repo\u0027\n```\n\nThe file should be resolved against the main repository (`_main`) but\nis incorrectly looked up from the installer\u0027s repository\n(`+_repo_rules+extrepo`).\n\nThe solution proposed here consists in extending the manifest to track\neach file\u0027s own repository and use this information during installation\nto resolve files against the correct repository.\n\nIt adds a `repository` field to manifest entries using:\n- `Label.repo_name`\n  ([canonical](https://bazel.build/rules/lib/builtins/Label#repo_name))\n  when explicitly valued for the source file,\n- otherwise `ctx.workspace_name` when no\n  [owner](https://bazel.build/rules/lib/builtins/File#owner)\n  or `Label.repo_name` is\n  [empty](https://rules-python.readthedocs.io/en/latest/api/py/runfiles/runfiles.runfiles.html#runfiles.runfiles.Runfiles.CurrentRepository),\n  denoting the main repository (`_main`, as before).\n\nTesting:\n- `//tests/install:install_test` includes new `CrossRepoInstallTest`,\n- `bazel run @extrepo//:install -- --destdir\u003d/tmp/test` case works,\n- verified the above on Ubuntu Linux and Windows as well.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d4d0cb18f3c66896a103f5cd67411233e38e18b1",
      "old_mode": 33188,
      "old_path": "pkg/private/install.py.tpl",
      "new_id": "1eef01656fe1d8812c94be7f39fede8d97d09a0c",
      "new_mode": 33188,
      "new_path": "pkg/private/install.py.tpl"
    },
    {
      "type": "modify",
      "old_id": "8e8c45e51f31006c66e5718b5d47356af24ebcd1",
      "old_mode": 33188,
      "old_path": "pkg/private/manifest.py",
      "new_id": "d3b91859d9302a1e901a5a171960f2433f92ac04",
      "new_mode": 33188,
      "new_path": "pkg/private/manifest.py"
    },
    {
      "type": "modify",
      "old_id": "d7813985bc853be36995339a0ccb33b461cec52d",
      "old_mode": 33188,
      "old_path": "pkg/private/pkg_files.bzl",
      "new_id": "1f1c902df3c4e901ce3089611263f3d13cdc79e7",
      "new_mode": 33188,
      "new_path": "pkg/private/pkg_files.bzl"
    },
    {
      "type": "modify",
      "old_id": "459b3929d118e5537847c0fd7e2008c07e9fca07",
      "old_mode": 33188,
      "old_path": "tests/install/BUILD",
      "new_id": "81019397ed541a11fdf68ebfbb353b3a324a5890",
      "new_mode": 33188,
      "new_path": "tests/install/BUILD"
    },
    {
      "type": "modify",
      "old_id": "927d48cf5108af45b6d44656c6ff3544d32a0ef9",
      "old_mode": 33188,
      "old_path": "tests/install/test.py",
      "new_id": "2169105e95af2760729fc1cbf45fc82c3095720b",
      "new_mode": 33188,
      "new_path": "tests/install/test.py"
    },
    {
      "type": "modify",
      "old_id": "6a5f1072534c9396e3fe0e0b57e28dbcece86b6c",
      "old_mode": 33188,
      "old_path": "tests/mappings/all.manifest.golden",
      "new_id": "815d86aaca807033134347cb0d480d13cb79069d",
      "new_mode": 33188,
      "new_path": "tests/mappings/all.manifest.golden"
    },
    {
      "type": "modify",
      "old_id": "4c7a5cb987873f4b682f2fc3d7382abdb8fa665b",
      "old_mode": 33188,
      "old_path": "tests/mappings/executable.manifest.golden",
      "new_id": "fa2ca546bffe933d14f7507f869556c8a26d2ad4",
      "new_mode": 33188,
      "new_path": "tests/mappings/executable.manifest.golden"
    },
    {
      "type": "modify",
      "old_id": "f76077f742c8d60849a303ceb84232118cb0764f",
      "old_mode": 33188,
      "old_path": "tests/mappings/executable.manifest.windows.golden",
      "new_id": "262062a5b02ef22fae3538208c5bee0d3e8520b0",
      "new_mode": 33188,
      "new_path": "tests/mappings/executable.manifest.windows.golden"
    },
    {
      "type": "modify",
      "old_id": "33db6a8b1d7f50594dd25ed56dc528b6bd397fb6",
      "old_mode": 33188,
      "old_path": "tests/mappings/external_repo/pkg/BUILD",
      "new_id": "6e5afef0ab79a6a8852743b9fe63df7be641f610",
      "new_mode": 33188,
      "new_path": "tests/mappings/external_repo/pkg/BUILD"
    },
    {
      "type": "modify",
      "old_id": "9ff7e2167b93c8da470715e0ff4d90a2068d9b7b",
      "old_mode": 33188,
      "old_path": "tests/mappings/glob_for_texts_manifest.golden",
      "new_id": "95fa4c136db2f2569cdad6170f34a7ceddb6e085",
      "new_mode": 33188,
      "new_path": "tests/mappings/glob_for_texts_manifest.golden"
    },
    {
      "type": "modify",
      "old_id": "b234629f72832e733d66fb260ed8efc33ab460d2",
      "old_mode": 33261,
      "old_path": "tests/mappings/node_modules_manifest.golden",
      "new_id": "81de0ed8b6c5a2e1e73566e6f42bd9504b6ee334",
      "new_mode": 33261,
      "new_path": "tests/mappings/node_modules_manifest.golden"
    },
    {
      "type": "modify",
      "old_id": "11352ca7d145cf3e89a1ea72d32587c697d249d4",
      "old_mode": 33188,
      "old_path": "tests/mappings/utf8_manifest.golden",
      "new_id": "2c91c7848cc443a104be3ac57ee7f952f7120ae9",
      "new_mode": 33188,
      "new_path": "tests/mappings/utf8_manifest.golden"
    }
  ]
}
