)]}'
{
  "commit": "8b9c055ed5a0dc77a191fb19d6812ea137c2b0fa",
  "tree": "d10f003ebe7fe9f75b4d22451a889dc91faebe88",
  "parents": [
    "7670e67e72d6d4aaac174b91f4465a67479e1026"
  ],
  "author": {
    "name": "Leopold Schabel",
    "email": "leo@nexantic.com",
    "time": "Fri Nov 15 14:07:45 2019 +0100"
  },
  "committer": {
    "name": "Leopold Schabel",
    "email": "leo@nexantic.com",
    "time": "Fri Nov 15 14:07:45 2019 +0100"
  },
  "message": "Bazel IntelliJ plugin support\n\nThis eliminates the need for manually synchronizing generated files.\n\nThe plugin authors advise against checking in the .iwjb directory,\nwhich we resolutely ignore. The recommended method is to provide a\ntemplate .bazelproject file that everyone needs to manually import and\nupdate. However, checking in the directory is supported and no different\nthan checking in .idea. This allows us to version things like watchers\nand run configurations, at the expense of requiring everyone to use\nthe same IntelliJ and Bazel plugin versions.\n\nHow it works:\n\n- Source code and execroot paths are identical inside and outside the\n  container. This requires a bind mount. To avoid conflicts with a\n  local Bazel instance, a separate directory is used.\n\n  The wrapper script injects a --output_user_root startup parameter.\n  We cannot set this in .bazelrc since we cannot substitute the\n  user home. This means that running bazel inside the container,\n  without the wrapper, will no longer work/blow up the overlayfs.\n\n  Did anyone do this?\n\n- The tmpfs and other caches are eliminated.\n  Forcing it hasn\u0027t been ideal anyway due to\n  the excessive memory usage, and it can still be accomplished\n  by mounting a tmpfs to `~/.cache/bazel-nxt` or symlinking it to\n  `/dev/shm` or similar (set proper permissions!).\n\n- The plugin configures a custom local repository that has helper\n  scripts. Since we need to be on the same IntelliJ version, we can\n  simply hardcode the path and bind mount it (read only).\n\n  The alternative would be to copy the files into the container and\n  override the command line option using sync_flags\n  (https://github.com/bazelbuild/intellij/issues/397), but bind\n  mounting seems muche easier at no disadvantage.\n\n- IntelliJ needs a somewhat obscure custom startup option (see README)\n  for BEP temp files (https://github.com/bazelbuild/intellij/issues/407).\n\nTest Plan:\n- Running tests works:\n\n  {F16996}\n\n- Full and partial sync works:\n\n  {F17000}\n\n- Updating a protobuf file triggered the watcher, which rebuilt the\n  generated files. After triggering an source sync, the changes\n  are visible in the IDE (I suspect that IntelliJ does not inotify-\n  watch the generated files since they are outside the project directory.\n\nX-Origin-Diff: phab/D263\nGitOrigin-RevId: 39c50665575c2a0131c492385b0981b7ee2588d8\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6aadcd72c2c68bbd7c5b19805d73efd475022827",
      "old_mode": 33188,
      "old_path": "README.md",
      "new_id": "9321fd6d4db3e6f15375f97fe1d813d6c94721ef",
      "new_mode": 33188,
      "new_path": "README.md"
    },
    {
      "type": "modify",
      "old_id": "c0bd7e4787c0cecfc8253e9e79d23fe39f462623",
      "old_mode": 33261,
      "old_path": "scripts/bin/bazel",
      "new_id": "07736699bf5f20abf5406705f354b390e2344d16",
      "new_mode": 33261,
      "new_path": "scripts/bin/bazel"
    },
    {
      "type": "modify",
      "old_id": "449bdb1000d137747d3eb709dab3689a88175d2a",
      "old_mode": 33261,
      "old_path": "scripts/create_container.sh",
      "new_id": "a2a5d61612cd4aee505a9a6c0419424cc6635dca",
      "new_mode": 33261,
      "new_path": "scripts/create_container.sh"
    },
    {
      "type": "delete",
      "old_id": "8edcf65421fc6bfcb767ca44091a857792f7f667",
      "old_mode": 33261,
      "old_path": "scripts/rebuild_generated.sh",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    }
  ]
}
