bazel

Bazel: how to get path to output binary?

白昼怎懂夜的黑 提交于 2020-03-24 10:05:33
问题 Consider somepath/BUILD file: load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") proto_library( name = "bar_proto", srcs = ["bar.proto"], ) java_proto_library( name = "bar_java_proto", deps = [":bar_proto"], ) By inspecting bazel-bin folder, I find bazel-bin/somepath/libbar_proto-speed.jar . How do I get bazel-bin/somepath/libbar_proto-speed.jar from //somepath:bar_java_proto using bazel query? 回答1: You don't. Knowing output paths requires executing Bazel's loading and

Configuring bazel to build/test using a specific JVM version

拟墨画扇 提交于 2020-03-04 05:00:29
问题 I am evaluating Bazel and trying to configure it so that it builds and tests my scala project using a different JDK than the one it has been built with. These are the relevant lines from the output of my bazel info : java-home: /nix/store/09x4mnxfzppwq1yjaakrfa6aj3rp7sw8-openjdk-11.0.4-ga/lib/openjdk java-runtime: OpenJDK Runtime Environment (build 11.0.3-internal+0-adhoc..jdk11u-jdk-11.0.3-ga) by Oracle Corporation java-vm: OpenJDK 64-Bit Server VM (build 11.0.3-internal+0-adhoc..jdk11u-jdk

Configuring bazel to build/test using a specific JVM version

和自甴很熟 提交于 2020-03-04 05:00:13
问题 I am evaluating Bazel and trying to configure it so that it builds and tests my scala project using a different JDK than the one it has been built with. These are the relevant lines from the output of my bazel info : java-home: /nix/store/09x4mnxfzppwq1yjaakrfa6aj3rp7sw8-openjdk-11.0.4-ga/lib/openjdk java-runtime: OpenJDK Runtime Environment (build 11.0.3-internal+0-adhoc..jdk11u-jdk-11.0.3-ga) by Oracle Corporation java-vm: OpenJDK 64-Bit Server VM (build 11.0.3-internal+0-adhoc..jdk11u-jdk

Configuring bazel to build/test using a specific JVM version

房东的猫 提交于 2020-03-04 04:59:43
问题 I am evaluating Bazel and trying to configure it so that it builds and tests my scala project using a different JDK than the one it has been built with. These are the relevant lines from the output of my bazel info : java-home: /nix/store/09x4mnxfzppwq1yjaakrfa6aj3rp7sw8-openjdk-11.0.4-ga/lib/openjdk java-runtime: OpenJDK Runtime Environment (build 11.0.3-internal+0-adhoc..jdk11u-jdk-11.0.3-ga) by Oracle Corporation java-vm: OpenJDK 64-Bit Server VM (build 11.0.3-internal+0-adhoc..jdk11u-jdk

bazel 安装

徘徊边缘 提交于 2020-02-28 14:06:57
1 . 安装bazel 需要的jdk-8 sudo apt - get install openjdk - 8 - jdk 在Ubuntu 14.04 LTS上,您必须使用PPA: sudo add - apt - repository ppa : webupd8team / java sudo apt - get update & & sudo apt - get install oracle - java8 - installer 第2步:添加Bazel分发URI作为包源 echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee / etc / apt / sources . list . d / bazel . list curl https : // bazel . build / bazel - release . pub . gpg | sudo apt - key add - 如果您想安装Bazel的测试版本,请stable用testing。 第3步:安装并更新Bazel sudo apt - get update & & sudo apt - get install bazel 安装完成后,可以使用以下命令升级到较新版本的Bazel: sudo

Bazel: genrule that outputs an directory

青春壹個敷衍的年華 提交于 2020-02-24 05:49:28
问题 I'm just getting started working with Bazel. So, I apologize in advance that I haven't been able to figure this out. I'm trying to run a command that outputs a bunch of files to a directory and make this directory available for subsequent targets. I have two different attempts: Use genrule Write my own rule I was naively hoping to just do this with a genrule . But, it doesn't seem you can say "I don't know exactly what this command is going to output" and put a directory in outs . Now I'm

Execute bazel-buildfarm in a production-ready way without “bazel run”

无人久伴 提交于 2020-02-06 08:19:28
问题 The readme of Bazel-buildfarm says: In general do not execute server binaries with bazel run, since bazel does not support running multiple targets. This sounds like bazel run is designed for local testing-purpose, not for productive servers where multiple jobs could run. But I couldn't find a documentation showing how to run the bazel server instead. Older Dockerfiles run bazel build and then execute the generated jar-file with java. I tried this on my test machine and got the following

Cloud Build Bazel Error: “kubectl toolchain was not properly configured so apply cannot be executed”

a 夏天 提交于 2020-02-05 05:50:07
问题 I am trying to use rules_k8s for Bazel to deploy to my Kubernetes cluster. Thus I have this cloudbuild.yaml file, which is executed by Google Cloud Build: steps: - name: gcr.io/cloud-builders/bazel args: ['run', '//:kubernetes.apply'] ( //:kubernetes is just a k8s_objects) On my local machine running bazel run //:kubernetes.apply works fine, but although the Google Cloud Build succeeds, it logs those errors. So the configuration is not applied to my Kubernetes cluster: Target //:kubernetes

C++ debugging with gdb & bazel (& emacs)

拥有回忆 提交于 2020-01-29 10:53:36
问题 I want to debug an executable generated with Bazel. The gdb debugger is lost with the links generated by Bazel and is not able to show me the C++ source code. How to fix that? The project root directory is /home/.../Cpp/ ./Cpp/ ├── bazel-bin -> /home/picaud/.cache/bazel/_bazel_picaud... ├── bazel-Cpp -> /home/picaud/.cache/bazel/_bazel_picaud... ├── bazel-genfiles -> /home/picaud/.cache/bazel/_bazel_picaud... ├── bazel-out -> /home/picaud/.cache/bazel/_bazel_picaud... ├── bin │ ├── BUILD │ └─

Linux下常用命令

末鹿安然 提交于 2020-01-28 12:09:04
针对经常使用到的Linux命令,汇总一下,以备查看: 一、安装类: 1、GIT sudo apt install git sudo apt-get install git-core 2、Bazel 方法1:(下载最新版本) sudo apt-get install curl echo "deb[arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list curl https://bazel.build/bazel-release/pub.gpg | sudo apt-key add - sudo apt-get update sudo apt-get install bazel sudo apt-get upgrade bazel 方法2:(下载指定版本) 下载地址: https://github.com/bazelbuild/bazel/releases 下载版本如: bazel-0.25.2-installer-linux-x86_64.sh chmod +x bazel-0.25.2-installer-linux-x86_64.sh ./ bazel-0.25.2-installer-linux-x86_64