Comments (8)
I can work with a large reproducer.
Reverting would cause other problems. There's a usecase where JDK gets packaged for deployment, so it needs to be matched by the target.
Is this only problem for android?
You can get extra debug by adding flag:
--toolchain_resolution_debug='@bazel_tools//tools/jdk:runtime_toolchain_type'
from rules_java.
Is this only problem for android?
Yes, but only in the sense that we don't compile Java for any other platform, we compile C/C++/Python/ObjC/Swift for other platforms that aren't affected by this, but maybe that's obvious.
Actually it looks like this envoyproxy/envoy#22356 fixes the issue, but now bazel can't find the C++ toolchain:
ERROR: /private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/bazel_tools/tools/cpp/BUILD:60:19: While resolving toolchains for target @bazel_tools//tools/cpp:current_cc_toolchain: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
Maybe rules_java needs to use use_cpp_toolchain()
somewhere?
Update:
Full error
$ ./bazelw build android_dist --config=android --override_repository=rules_java=/Users/jsimard/src/rules_java
INFO: Build option --toolchain_resolution_debug has changed, discarding analysis cache.
INFO: Repository remotejdk11_macos_aarch64 instantiated at:
/Users/jsimard/src/envoy-mobile/WORKSPACE:58:26: in <toplevel>
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/envoy_mobile/bazel/envoy_mobile_dependencies.bzl:52:24: in envoy_mobile_dependencies
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/envoy_mobile/bazel/envoy_mobile_dependencies.bzl:61:28: in kotlin_dependencies
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/rules_java/java/repositories.bzl:517:23: in rules_java_dependencies
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/rules_java/java/repositories.bzl:251:10: in remote_jdk11_repos
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/rules_java/toolchains/remote_java_repository.bzl:48:17: in remote_java_repository
Repository rule http_archive defined at:
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in <toplevel>
INFO: Repository maven instantiated at:
/Users/jsimard/src/envoy-mobile/WORKSPACE:58:26: in <toplevel>
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/envoy_mobile/bazel/envoy_mobile_dependencies.bzl:52:24: in envoy_mobile_dependencies
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/envoy_mobile/bazel/envoy_mobile_dependencies.bzl:62:18: in kotlin_dependencies
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/rules_jvm_external/defs.bzl:121:19: in maven_install
Repository rule coursier_fetch defined at:
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/rules_jvm_external/coursier.bzl:1173:33: in <toplevel>
INFO: Repository android_tools instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:413:13: in <toplevel>
Repository rule http_archive defined at:
/private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in <toplevel>
ERROR: /private/var/tmp/_bazel_jsimard/7140f038a5c13b01a171c93151a000da/external/bazel_tools/tools/cpp/BUILD:60:19: While resolving toolchains for target @bazel_tools//tools/cpp:current_cc_toolchain: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
ERROR: Analysis of target '//:android_dist' failed; build aborted:
INFO: Elapsed time: 0.221s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 1336 targets configured)
from rules_java.
cc @katre Do you know anything on top of your head about this?
from rules_java.
Here's a smaller repro case keith/bazel-rust-mobile-demo#3, passing --java_runtime_version=remotejdk_11
is what triggers things. Versus it defaulting to the local_jdk (maybe arm64 darwin specific?)
from rules_java.
Verified it repros on x86_64 macOS as well
from rules_java.
@comius @katre with the repro cases we've shared, do you have enough to go on to debug this? Envoy Mobile is temporarily unblocked by pointing to the branch from #65 but that's not something we want to keep long term.
from rules_java.
I have a bunch of issues caused by the same problem, described at bazelbuild/bazel#17085. There's a reproducer there for several variants (wrong binaries used on exec platform, toolchain resolution failures that entirely break builds that use globs). @comius
from rules_java.
This is still causing problem for the Envoy project and is blocking our move to bazel 6.2.0. Is there any more information we can provide to expedite this?
from rules_java.
Related Issues (20)
- How to use `remote_java_repository` with a JDK release where Java home is nested? HOT 6
- Upgrade from 5.4.0 to 5.5 errors HOT 3
- Dependency on `rules_license` HOT 1
- Problem in version 6.5.0: no such target '@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type' HOT 7
- Flip `incompatible_disallow_empty_glob`
- Add jmods to jdk targets HOT 1
- Add support for JDK 21 HOT 1
- Push a new release containing JDK 21 HOT 14
- Java toolchain is not respected HOT 2
- Incompatible with latest bazel rolling release HOT 1
- Push a new release containing latest JDK versions HOT 3
- Using default_java_toolchain, etc from //toolchains as opposed to @bazel_tools doesn't work HOT 4
- unnecessary stubbings errors are swallowed when tests run with Mockito HOT 1
- When remote execution is enabled, is there anyway to avoid downloading every coverage-runtime_merged_instr.jar?
- README.md lacks basic usage and clarity about built-in java support vs. what's provided by rules_java HOT 1
- rules_java.5.3.5.toolchains.local_jdk/BUILD.bazel:180:10: @rules_java.5.3.5.toolchains.local_jdk//:jdk-lib: invalid label 'lib/perl5/5.32/perl/man/man3/App::Cpan.3.gz' in element 6026 of attribute 'srcs' in 'filegroup' rule: invalid target name 'lib/perl5/5.32/perl/man/man3/App::Cpan.3.gz': target names may not contain ':' HOT 1
- [FreeBSD] No matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type HOT 1
- java_proto_library build broken by No matching toolchains found for types @bazel_tools//tools/python:toolchain_type. HOT 2
- remotejdk17 toolchain selected despite explicit build flags HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_java.