如何解决Bazel toolchain_vanilla和java_toolchain有什么区别?
Bazel具有多个不同的 toolchains 以支持Java代码的编译。可以使用命令行参数进行配置:
--java_toolchain=@bazel_tools//tools/jdk:toolchain_vanilla
--java_toolchain=@bazel_tools//tools/jdk:java_toolchain11
基于GitHub问题中的一些提示或提交评论,我能够弄清楚“ vanilla ”工具链更为裸露,并且似乎可以与更新/最新的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 工具链有一些明显的缺点,尤其是缺少标头编译时。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。