Bazel toolchain_vanilla 和 java_toolchain 有什么区别?
What is the difference between Bazel toolchain_vanilla and java_toolchain?
Bazel 有多个不同的 工具链 来支持编译 Java 代码。它们可以使用命令行参数进行配置:
--java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla
--java_toolchain=@bazel_tools//tools/jdk:java_toolchain11
根据 GitHub 问题或提交评论中的一些提示,我发现“vanilla”工具链更简单,似乎工作得更好newer/latest JDK 版本。似乎它错过了 ErrorProne 编译器。但是,我不清楚使用 vanilla 工具链与 regular 相比我会错过哪些 other 功能工具链。
文档显示区域稀疏。
两个工具链之间是否有很好的比较,即哪个工具链触发 Bazel 中的哪个行为?
我找到了 一些 提示 buried in Bazel source code。
# The 'vanilla' toolchain is an unsupported alternative to the default.
#
# It does not provider any of the following features:
# * Error Prone
# * Strict Java Deps
# * Header Compilation
# * Reduced Classpath Optimization
#
# It uses the version of javac from the `--host_javabase` instead of the
# embedded javac, which may not be source- or bug-compatible with the embedded
# javac.
#
# However it does allow using a wider range of `--host_javabase`s, including
# versions newer than the current embedded JDK.
我不知道这是否是完整的故事。但看起来 vanilla 工具链有一些明显的缺点,尤其是缺少头文件编译。
Bazel 有多个不同的 工具链 来支持编译 Java 代码。它们可以使用命令行参数进行配置:
--java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla
--java_toolchain=@bazel_tools//tools/jdk:java_toolchain11
根据 GitHub 问题或提交评论中的一些提示,我发现“vanilla”工具链更简单,似乎工作得更好newer/latest JDK 版本。似乎它错过了 ErrorProne 编译器。但是,我不清楚使用 vanilla 工具链与 regular 相比我会错过哪些 other 功能工具链。
文档显示区域稀疏。 两个工具链之间是否有很好的比较,即哪个工具链触发 Bazel 中的哪个行为?
我找到了 一些 提示 buried in Bazel source code。
# The 'vanilla' toolchain is an unsupported alternative to the default.
#
# It does not provider any of the following features:
# * Error Prone
# * Strict Java Deps
# * Header Compilation
# * Reduced Classpath Optimization
#
# It uses the version of javac from the `--host_javabase` instead of the
# embedded javac, which may not be source- or bug-compatible with the embedded
# javac.
#
# However it does allow using a wider range of `--host_javabase`s, including
# versions newer than the current embedded JDK.
我不知道这是否是完整的故事。但看起来 vanilla 工具链有一些明显的缺点,尤其是缺少头文件编译。