Skip to content

Commit

Permalink
Automated rollback of commit a392d0e.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

This is not fixed for --strategy=remote

Fixes #6389

PiperOrigin-RevId: 217417789
  • Loading branch information
cushon authored and Copybara-Service committed Oct 17, 2018
1 parent dc16d09 commit 73972b3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tools/jdk/default_java_toolchain.bzl
Expand Up @@ -110,7 +110,17 @@ def java_runtime_files(name, srcs):
def _bootclasspath(ctx):
host_javabase = ctx.attr.host_javabase[java_common.JavaRuntimeInfo]

class_dir = ctx.actions.declare_directory("%s_classes" % ctx.label.name)
# explicitly list output files instead of using TreeArtifact to work around
# https://github.com/bazelbuild/bazel/issues/6203
classes = [
"DumpPlatformClassPath.class",
"DumpPlatformClassPath$1.class",
]

class_outputs = [
ctx.actions.declare_file("%s_classes/%s" % (ctx.label.name, clazz))
for clazz in classes
]

args = ctx.actions.args()
args.add("-source")
Expand All @@ -121,26 +131,26 @@ def _bootclasspath(ctx):
args.add("-cp")
args.add("%s/lib/tools.jar" % host_javabase.java_home)
args.add("-d")
args.add(class_dir.path)
args.add(class_outputs[0].dirname)
args.add(ctx.file.src)

ctx.actions.run(
executable = "%s/bin/javac" % host_javabase.java_home,
inputs = [ctx.file.src] + ctx.files.host_javabase,
outputs = [class_dir],
outputs = class_outputs,
arguments = [args],
)

bootclasspath = ctx.outputs.jar

inputs = [class_dir] + ctx.files.host_javabase
inputs = class_outputs + ctx.files.host_javabase

args = ctx.actions.args()
args.add("-XX:+IgnoreUnrecognizedVMOptions")
args.add("--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED")
args.add_joined(
"-cp",
[class_dir.path, "%s/lib/tools.jar" % host_javabase.java_home],
[class_outputs[0].dirname, "%s/lib/tools.jar" % host_javabase.java_home],
join_with = ctx.configuration.host_path_separator,
)
args.add("DumpPlatformClassPath")
Expand Down

0 comments on commit 73972b3

Please sign in to comment.