)]}'
{
  "commit": "1c930292e79d22107a946aafea210b09806bde43",
  "tree": "79412cc9bc1d29799c6ede2db175e0a2fb6373ec",
  "parents": [
    "97cd204c2d46d262d2ad62adb80553c69d82e476"
  ],
  "author": {
    "name": "Daniel Grunwald",
    "email": "daniel@danielgrunwald.de",
    "time": "Tue Feb 14 04:52:19 2023 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Tue Feb 14 04:53:28 2023 -0800"
  },
  "message": "Fix bugs with unicode filenames in runfiles.\n\nWe had a cc_test using a bunch of files (`data \u003d glob([\"data/**\"]),`), some which were in subdirectories where the directory name had unicode characters (e.g. `data/test_öΩ/`).\nThis resulted in an error:\n```\nERROR: C:/users/.../BUILD.bazel:233:8: Creating runfiles tree bazel-out/x64_windows-opt/test-shared.exe.runfiles failed: build-runfiles.exe failed: error executing command\n  cd /d C:\\users\\...\n  SET BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN\u003d1\n    SET PATH\u003d...\n  C:\\users\\...\\install\\eadbc20bd36081cbe58dcb5129383507\\build-runfiles.exe bazel-out/x64_windows-opt/test-shared.exe.runfiles_manifest bazel-out/x64_windows-opt/test-shared.exe.runfiles: Process exited with status 1: Process exited with status 1\nbuild-runfiles error: MakeDirectoriesW failed (\\\\?\\c:\\users\\...\\test-shared.exe.runfiles\\test\\data\\layer_middle_??): (error: 123): The filename, directory name, or volume label syntax is incorrect.\n```\n\n`build-runfiles-windows.cc` expects the `.runfiles_manifest` to be encoded in UTF-8; but Java was writing it as latin-1. This resulted in unicode characters (not representable in latin-1) being stored as `?` in the `.runfiles_manifest` file. Question marks are not valid in filenames, causing the error in `build-runfiles`.\n\nThis commit changes the encoding of `.runfiles_manifest` from latin-1 to UTF-8. Additionally, it fixes a bug in `build-runfiles-windows.cc` where the `space_pos` was calculated from the UTF-8 representation but then used for the UTF-16 wstring, which caused string containing unicode characters to be split incorrectly.\n\nCloses #15846.\n\nPiperOrigin-RevId: 509492501\nChange-Id: I82d5119160c16d4513e9e744d9f398727bac1dc4\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6feb2b91321df81df27c0ac312f84eba7b608ae9",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java",
      "new_id": "e91419e6af01ccbbc16af737f18eeaddbdcbc60b",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java"
    },
    {
      "type": "modify",
      "old_id": "0a0b0ab6f5d706ac791f4727b01b0cf9a3ecf810",
      "old_mode": 33188,
      "old_path": "src/main/tools/build-runfiles-windows.cc",
      "new_id": "da39672f61790486bf8317161817e552eacc5367",
      "new_mode": 33188,
      "new_path": "src/main/tools/build-runfiles-windows.cc"
    }
  ]
}
