Skip to content

Commit ef7a732

Browse files
author
Jaden Peterson
committed
Set the default temporary directory for ZincRunner
1 parent 269f41e commit ef7a732

File tree

1 file changed

+7
-0
lines changed
  • src/main/scala/higherkindness/rules_scala/workers/zinc/compile

1 file changed

+7
-0
lines changed

src/main/scala/higherkindness/rules_scala/workers/zinc/compile/BUILD

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ load("//rules:scalafmt.bzl", "scala_format_test")
44
scala_binary(
55
name = "compile",
66
srcs = glob(["**/*.scala"]),
7+
# Per the worker protocol, workers must not write outside of the sandbox:
8+
# https://bazel.build/remote/multiplex#multiplex_sandboxing
9+
#
10+
# Since Zinc writes temporary files to the default temporary directory, we override it to be `.` instead of `/tmp`.
11+
# Normally, we'd use the sandbox directory provided in the work request, but that won't work because the default
12+
# temporary directory is set globally, whereas work requests can be processed in parallel.
13+
jvm_flags = ["-Djava.io.tmpdir=."],
714
main_class = "higherkindness.rules_scala.workers.zinc.compile.ZincRunner",
815
scala_toolchain_name = "annex_bootstrap_2_13",
916
visibility = ["//visibility:public"],

0 commit comments

Comments
 (0)