Skip to content

Commit 43c7b97

Browse files
cushoncopybara-github
authored andcommitted
Update toolchain config to allow reflective access to com.sun.tools.javac.parser
Reported here: google/error-prone#2271 (comment) PiperOrigin-RevId: 423272568
1 parent ce1a5d0 commit 43c7b97

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/main/starlark/builtins_bzl/common/cc/semantics.bzl

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def _get_loose_mode_in_hdrs_check_allowed_attr():
4747

4848
def _get_def_parser():
4949
return attr.label(
50-
default = "@bazel_tools//tools/def_parser:def_parser",
51-
allow_single_file = True,
52-
cfg = "exec",
50+
default = "@bazel_tools//tools/def_parser:def_parser",
51+
allow_single_file = True,
52+
cfg = "exec",
5353
)
5454

5555
semantics = struct(

src/main/starlark/builtins_bzl/common/java/java_semantics.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def _get_coverage_runner(ctx):
4646
if not runner:
4747
fail("jacocorunner not set in java_toolchain")
4848
runner_jar = runner.executable
49+
4950
# wrap the jar in JavaInfo so we can add it to deps for java_common.compile()
5051
return JavaInfo(output_jar = runner_jar, compile_jar = runner_jar)
5152

src/main/starlark/builtins_bzl/common/proto/proto_semantics.bzl

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Proto Semantics
1717
"""
1818

1919
def _preprocess(ctx):
20-
pass
20+
pass
2121

2222
semantics = struct(
23-
PROTO_COMPILER_LABEL = "@com_google_protobuf//:protoc",
24-
EXTRA_ATTRIBUTES = {
25-
"import_prefix": attr.string(),
26-
},
27-
EXTRA_FRAGMENTS = [],
28-
preprocess = _preprocess,
23+
PROTO_COMPILER_LABEL = "@com_google_protobuf//:protoc",
24+
EXTRA_ATTRIBUTES = {
25+
"import_prefix": attr.string(),
26+
},
27+
EXTRA_FRAGMENTS = [],
28+
preprocess = _preprocess,
2929
# This constant is used in ProtoCompileActionBuilder to generate an error message that's
3030
# displayed when a strict proto deps violation occurs.
3131
#
@@ -36,4 +36,4 @@ semantics = struct(
3636
"--direct_dependencies_violation_msg=" +
3737
"%%s is imported, but %s doesn't directly depend on a proto_library that 'srcs' it."
3838
),
39-
)
39+
)

tools/jdk/default_java_toolchain.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ BASE_JDK9_JVM_OPTS = [
2424
"--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
2525
"--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
2626
"--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
27-
"--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
2827
"--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
2928
"--add-exports=jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED",
3029
"--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
3130
"--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
3231
"--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
3332
"--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
3433
"--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
34+
"--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
3535

3636
# quiet warnings from com.google.protobuf.UnsafeUtil,
3737
# see: https://github.com/google/protobuf/issues/3781

0 commit comments

Comments
 (0)