Git Product home page Git Product logo

tools_remote's People

Contributors

agoulti avatar brentleyjones avatar cdlee2 avatar dslomov avatar glukasiknuro avatar jasharpe avatar krisstakos avatar samschlegel avatar sgbalogh avatar tjgq avatar werkt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tools_remote's Issues

bazel build //:remote_client fails on Ubuntu with OpenJDK 21

Due to /usr/bin/java outputting a non base-10 version number.

$ java -version
openjdk version "21-ea" 2023-09-19
OpenJDK Runtime Environment (build 21-ea+14-Ubuntu-0ubuntu1)
OpenJDK 64-Bit Server VM (build 21-ea+14-Ubuntu-0ubuntu1, mixed mode, sharing)

ERROR: An error occurred during the fetch of repository 'maven':
   Traceback (most recent call last):
	File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 810, column 38, in _coursier_fetch_impl
		dep_tree = make_coursier_dep_tree(
	File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 714, column 30, in make_coursier_dep_tree
		if parse_java_version(exec_result.stdout + exec_result.stderr) > 8:
	File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/private/java_utilities.bzl", line 21, column 19, in parse_java_version
		return int(java_version)
Error in int: invalid base-10 literal: "21-ea"
ERROR: /home/nick/src/tools_remote/WORKSPACE:77:14: fetching coursier_fetch rule //external:maven: Traceback (most recent call last):
	File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 810, column 38, in _coursier_fetch_impl
		dep_tree = make_coursier_dep_tree(
	File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/coursier.bzl", line 714, column 30, in make_coursier_dep_tree
		if parse_java_version(exec_result.stdout + exec_result.stderr) > 8:
	File "/home/nick/.cache/bazel/_bazel_nick/a672d92c9de22a00fd1e118acf0c00e7/external/rules_jvm_external/private/java_utilities.bzl", line 21, column 19, in parse_java_version
		return int(java_version)
Error in int: invalid base-10 literal: "21-ea"
ERROR: Error computing the main repository mapping: no such package '@maven//': invalid base-10 literal: "21-ea"

Not sure if this is Ubuntu's java package outputting a daft version string or that the rules need to handle non-numeric version strings.

Make it work on Windows

With a couple of minor tweaks, this tool works on Windows:

  1. setExecutable doesn't work on Windows (nor is it needed), so this line should be skipped when running on Windows.

  2. The -u flag isn't supported for docker run on Windows, so should be removed from the supplied docker run command.

Can't build //:remote_client on Mac M1

Repro:
bazel build //:remote_client --sandbox_debug

Result:

ERROR: /private/var/tmp/_bazel_oliviern/7944c0580962963de2d459aad1248a5f/external/googleapis/BUILD.bazel:188:14: Generating proto_library @googleapis//:google_api_http_proto failed: (Aborted): sandbox-exec failed: error executing command
  (cd /private/var/tmp/_bazel_oliviern/7944c0580962963de2d459aad1248a5f/sandbox/darwin-sandbox/470/execroot/remote_client && \
  exec env - \
    PATH='/Users/oliviern/Library/Caches/bazelisk/downloads/bazelbuild/bazel-6.2.0-darwin-arm64/bin:/Users/oliviern/.aw/pex_resources/scripts/binaries:/opt/uber/bin:/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin:/Users/oliviern/android-sdk/emulator:/Users/oliviern/android-sdk/cmdline-tools/tools:/Users/oliviern/android-sdk/tools:/Users/oliviern/android-sdk/platform-tools:/Users/oliviern/android-sdk/cmdline-tools/tools/bin:/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/oliviern/Library/Application Support/JetBrains/Toolbox/scripts:/Applications/Visual Studio Code.app/Contents/Resources/app/bin' \
    TMPDIR=/var/folders/qx/3gsz_bpd35j5hqvhpdff53740000gn/T/ \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_oliviern/7944c0580962963de2d459aad1248a5f/sandbox/darwin-sandbox/470/sandbox.sb /var/tmp/_bazel_oliviern/install/7d4a2659eff664c24e2f7d717eef5139/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_oliviern/7944c0580962963de2d459aad1248a5f/sandbox/darwin-sandbox/470/stats.out' bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc '--java_out=bazel-out/darwin_arm64-fastbuild/bin/external/googleapis/google_api_http_proto-speed-src.jar' '--proto_path=external/googleapis' '-Igoogle/api/http.proto=external/googleapis/google/api/http.proto' external/googleapis/google/api/http.proto)
dyld[94554]: missing symbol called

NoSuchMethodError: boolean io.netty.internal.tcnative.SSLContext.setCipherSuite

The remote client crashes when I try to use the show_action command.

$ bazel run :remote_client -- --tls_enabled --remote_cache=remotebuildexecution.googleapis.com --remote_instance=<instance> show_action --digest=<digest>
Exception in thread "main" java.lang.NoSuchMethodError: 'boolean io.netty.internal.tcnative.SSLContext.setCipherSuite(long, java.lang.String, boolean)'
	at io.netty.handler.ssl.OpenSsl.<clinit>(OpenSsl.java:201)
	at io.grpc.netty.GrpcSslContexts.defaultSslProvider(GrpcSslContexts.java:228)
	at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:155)
	at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:104)
	at com.google.devtools.build.remote.client.GoogleAuthUtils.createSSlContext(GoogleAuthUtils.java:80)
	at com.google.devtools.build.remote.client.GoogleAuthUtils.newChannel(GoogleAuthUtils.java:55)
	at com.google.devtools.build.remote.client.GrpcRemoteCache.<init>(GrpcRemoteCache.java:51)
	at com.google.devtools.build.remote.client.RemoteClient.makeClientWithOptions(RemoteClient.java:407)
	at com.google.devtools.build.remote.client.RemoteClient.selectAndPerformCommand(RemoteClient.java:623)
	at com.google.devtools.build.remote.client.RemoteClient.main(RemoteClient.java:541)

Build fails if protobuf is on system

I have protobuf tools installed (via Homebrew OS X) and build fails because it cannot disambiguate the system headers vs the ones included in external...

Use --sandbox_debug to see verbose messages from the sandbox
external/com_google_protobuf/src/google/protobuf/stubs/structurally_valid.cc:591:11: error: call to 'UTF8SpnStructurallyValid' is ambiguous
  int n = UTF8SpnStructurallyValid(src_str);
          ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/google/protobuf/stubs/common.h:138:21: note: candidate function
PROTOBUF_EXPORT int UTF8SpnStructurallyValid(StringPiece str);
                    ^
external/com_google_protobuf/src/google/protobuf/stubs/structurally_valid.cc:565:5: note: candidate function
int UTF8SpnStructurallyValid(const StringPiece& str) {
    ^

I worked around by uninstalling system protobuf. Is there a bazel native way to avoid this error?

Failure building tools remote with Bazel 0.25

Attempting to build the remote client fails with bazel 0.25:

Java Version: openjdk version "11.0.3" 2019-04-16

Bazel Version:

Build label: 0.25.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri May 10 20:47:48 2019 (1557521268)
Build timestamp: 1557521268
Build timestamp as int: 1557521268

Build Log:

$ bazel build :remote_client
Starting local Bazel server and connecting to it...
DEBUG: /home/CORP.INSTRUCTURE.COM/ecoan/personal/envoy-rbe-debugging/tools_remote/third_party/grpc_java/java_grpc_library.bzl:101:5: Multiple values in 'deps' is deprecated in remote_execution_java_grpc
DEBUG: /home/CORP.INSTRUCTURE.COM/ecoan/personal/envoy-rbe-debugging/tools_remote/third_party/grpc_java/java_grpc_library.bzl:101:5: Multiple values in 'deps' is deprecated in google_devtools_remoteexecution_v1test_remote_execution_java_grpc
DEBUG: /home/CORP.INSTRUCTURE.COM/ecoan/personal/envoy-rbe-debugging/tools_remote/third_party/grpc_java/java_grpc_library.bzl:15:7: in srcs attribute of @remoteapis//:remote_execution_java_grpc__do_not_reference__srcjar: Proto source with label @remoteapis//build/bazel/remote/execution/v2:remote_execution_proto should be in same package as consuming rule
INFO: Analyzed target //:remote_client (87 packages loaded, 1141 targets configured).
INFO: Found 1 target...
INFO: From Generating Java (Immutable) proto_library @com_google_protobuf//:wrappers_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @com_google_protobuf//:descriptor_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @googleapis//:google_bytestream_bytestream_proto:
external/com_google_protobuf: warning: directory does not exist.
google/bytestream/bytestream.proto: warning: Import google/protobuf/wrappers.proto but not used.
INFO: From Generating Java (Immutable) proto_library @com_google_protobuf//:timestamp_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @googleapis//:google_watch_v1_proto:
external/com_google_protobuf: warning: directory does not exist.
google/watcher/v1/watch.proto: warning: Import google/protobuf/empty.proto but not used.
INFO: From Generating Java (Immutable) proto_library @com_google_protobuf//:duration_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @com_google_protobuf//:any_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @com_google_protobuf//:empty_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library //src/main/proto:remote_execution_log_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @googleapis//:google_devtools_remoteexecution_v1test_remote_execution_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @googleapis//:google_rpc_status_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @googleapis//:google_longrunning_operations_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @googleapis//:google_api_annotations_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From Generating Java (Immutable) proto_library @remoteapis//build/bazel/remote/execution/v2:remote_execution_proto:
external/com_google_protobuf: warning: directory does not exist.
INFO: From SkylarkAction external/googleapis/google_bytestream_bytestream_java_grpc__do_not_reference__srcjar_src.jar:
google/bytestream/bytestream.proto: warning: Import google/protobuf/wrappers.proto but not used.
ERROR: /home/CORP.INSTRUCTURE.COM/ecoan/.cache/bazel/_bazel_ecoan/bb6e210c490c8db3d5dca15dd69502e4/external/googleapis/BUILD.bazel:59:1: Building external/googleapis/libgoogle_bytestream_bytestream_java_grpc.jar (1 source jar) failed (Exit 1)
/com/google/bytestream/ByteStreamGrpc.java:37: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
Target //:remote_client failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 110.248s, Critical Path: 48.16s
INFO: 237 processes: 220 linux-sandbox, 17 worker.
FAILED: Build did NOT complete successfully

Build fails with Bazel v0.29 due to deprecation errors

Use of ctx.new_file():

Traceback (most recent call last):
	File "/private/var/tmp/_bazel_jmillikin/73371e8e1f17f8d91cb277488386d273/external/remoteapis/BUILD.bazel", line 9
		_gensource(name = 'remote_execution_java_grpc__do_not_reference__srcjar')
	File "/Users/jmillikin/src/third_party/github.com/bazelbuild/tools_remote/third_party/grpc_java/java_grpc_library.bzl", line 18, in _gensource_impl
		ctx.new_file((ctx.label.name + "_src.jar"))
Use ctx.actions.declare_file instead of ctx.new_file. 
Use --incompatible_new_actions_api=false to temporarily disable this check.

Iteration over a depset:

Traceback (most recent call last):
	File "/private/var/tmp/_bazel_jmillikin/73371e8e1f17f8d91cb277488386d273/external/googleapis/BUILD.bazel", line 59
		_gensource(name = 'google_bytestream_bytestream_java_grpc__do_not_reference__srcjar')
	File "/Users/jmillikin/src/third_party/github.com/bazelbuild/tools_remote/third_party/grpc_java/java_grpc_library.bzl", line 21, in _gensource_impl
		[f for dep in ctx.attr.srcs for f in dep.proto.transitive_imports]
type 'depset' is not iterable. Use the `to_list()` method to get a list. Use --incompatible_depset_is_not_iterable=false to temporarily disable this check.

Tool passed as non-tool action input:

Traceback (most recent call last):
	File "/private/var/tmp/_bazel_jmillikin/73371e8e1f17f8d91cb277488386d273/external/googleapis/BUILD.bazel", line 59
		_gensource(name = 'google_bytestream_bytestream_java_grpc__do_not_reference__srcjar')
	File "/Users/jmillikin/src/third_party/github.com/bazelbuild/tools_remote/third_party/grpc_java/java_grpc_library.bzl", line 26, in _gensource_impl
		ctx.action(inputs = (([ctx.executable._java...), <3 more arguments>)
Found tool(s) 'bazel-out/host/bin/external/grpc_java/compiler/grpc_java_plugin' in inputs. A tool is an input with executable=True set. All tools should be passed using the 'tools' argument instead of 'inputs' in order to make their runfiles available to the action. This safety check will not be performed once the action is modified to take a 'tools' argument. To temporarily disable this check, set --incompatible_no_support_tools_in_action_inputs=false.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.