bazel: default java.io.tmp location is too long

I have an issue with files created at temp directory having too long pathname. Please kindly see this SO question.

I managed to solve that by explicitly adding to my test target

"jvm_flags" = ["-Djava.io.tmpdir=/tmp"],

But that hurts the hermetical principle of testing. I suggest we offer much shorter yet unique tmp location for tests (somehting like /tmp/bazel-<unique-7-chars>)

WDYT?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 33 (23 by maintainers)

Commits related to this issue

Most upvoted comments

FYI, I decided to roll back the --local_tmp_root flag, see: https://github.com/bazelbuild/bazel/issues/4621#issuecomment-366217321

For the record, there’s already a --test_tmpdir flag, which allows going down to a 42-character-long temp root, see https://github.com/bazelbuild/bazel/issues/4621#issuecomment-366217799

I’ll discuss with the team how to go forward.