bazel

Bazel BUILD files conflicts with a build/ folder

北城余情 提交于 2020-01-02 04:10:09
问题 I am migrating my Cmake project to Bazel. At the root of my project is a build folder that I use to run Cmake. To migrate to Bazel, I need to create a BUILD file at the root of my project. However, on macOS, I cannot create it due to the presence of my build folder. Can I use a different name for Bazel's BUILD files? Or should I get rid of my build folder? 回答1: Bazel also supports using BUILD.bazel as the filename, which should resolve this issue (BUILD.bazel is preferred if both BUILD.bazel

Bazel: Java app with JNI dependency

余生颓废 提交于 2019-12-31 03:10:31
问题 I've managed to build my JNI library (the jar, the jni shared cc_library, the wrapped cc_library) but I don't see how to build a Java app that uses it. My BUILD is simple: java_binary( name = "OCFTestServer", srcs = glob(["src/main/java/**/*.java"]), deps = ["//:OpenOCF-JNI"]) Here OpenOCF-JNI looks like this: java_library( name = "OpenOCF-JNI", srcs = glob(["src/main/**/*.java"]), deps = ["libopenocf"], visibility = ["//visibility:public"]) And libopenocf is: cc_library( name = "libopenocf",

Tensorflow building error

こ雲淡風輕ζ 提交于 2019-12-31 02:53:10
问题 I got this error while building Tensorflow 1.1.0 Starting local Bazel server and connecting to it... ERROR: /home/bishal/.cache/bazel/_bazel_bishal/798d6395d959361055d9b5ddcd7dcd45/external/io_bazel_rules_closure/closure/testing/phantomjs_test.bzl:31:10: name 'set' is not defined ERROR: /home/bishal/.cache/bazel/_bazel_bishal/798d6395d959361055d9b5ddcd7dcd45/external/io_bazel_rules_closure/closure/private/defs.bzl:27:16: name 'set' is not defined ERROR: /home/bishal/.cache/bazel/_bazel_bishal

Building Makefile using bazel

泪湿孤枕 提交于 2019-12-30 07:01:10
问题 I am trying to build Makefile of a submodule in a bazel project. I see that bazel does provide genrule to execute bash command. I am facing two issues currently - 1. How to cd into a directory before executing command, something like - genrule( name = "hello-make", srcs = ["hello"] + glob(["hello/**"]), outs = ["hello/main"], cmd = "(cd $(location :hello) && make)", ) 2. How do I update update submodule before executing genrule? Adding cmd = "(git submodule init && git submodule update)"

How do I get the commands executed by Bazel

风流意气都作罢 提交于 2019-12-29 06:41:05
问题 I was wondering if there is a way to get Bazel to list, output, display, etc., all of the commands that can be executed from a command line that are run during a build after a clean. I do not care if the output is to the screen, in a file, etc. I will massage it into a usable form if necessary. I have captured the screen output during a run of Bazel which gives me an idea of what is being done, however it does not give me a command I can execute on the command line. The command would have to

Can Bazel be instructed to use a single command for updating N targets?

余生颓废 提交于 2019-12-25 18:31:34
问题 The Google Bazel build tool makes it easy enough to explain that each CoffeeScript file in a particular directory tree needs to be compiled to a corresponding output JavaScript file: [genrule( name = 'compile-' + f, srcs = [f], outs = [f.replace('src/', 'static/').replace('.coffee', '.js')], cmd = 'coffee --compile --map --output $$(dirname $@) $<', ) for f in glob(['src/**/*.coffee'])] But given, say, 100 CoffeeScript files, this will invoke the coffee tool 100 separate times, adding many

Building bazel from source on IBM power8

别说谁变了你拦得住时间么 提交于 2019-12-25 05:12:23
问题 I have access to a large IBM Power8 machine (running Ubuntu), and would like to build Bazel on it. However, when I try to do it as their installation instructions suggest, I get: me@machine:~/bazel-0.1.5$ ./compile.sh INFO: You can skip this first step by providing a path to the bazel binary as second argument: INFO: ./compile.sh compile /path/to/bazel 🍃 Building Bazel from scratch. Compiling Java stubs for protocol buffers... third_party/protobuf/protoc-linux-x86_32.exe -Isrc/main/protobuf/

How to implement Fabric Crashlytics in Android with Bazel?

梦想与她 提交于 2019-12-25 02:18:38
问题 I am able to get crashes using Gradle but when I build the apk using bazel and run it, it crashes as soon as activity is started and in exception I am getting something like this, java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.app/com.xxx.app.ServerConfig}: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up, install an Android build tool and ask a team member to

How to deploy to appengine flexible using bazel and google cloud deploy using non containerized artifact?

对着背影说爱祢 提交于 2019-12-25 01:56:05
问题 I have a project structure like: . ├── app │ ├── BUILD │ ├── entry.py │ ├── forms.py │ ├── __init__.py │ ├── jinja_custom_filter.py │ ├── models.py │ ├── __pycache__ │ ├── static │ ├── templates │ ├── utils.py │ └── views.py ├── app.db ├── app.yaml ├── BUILD ├── cloudbuild.yaml ├── config.py ├── __init__.py ├── LICENSE ├── manage.py ├── requirements.txt ├── run.py └── WORKSPACE 4 directories, 20 files Project uses flask, sqlalchemy (see further below) How does one deploy using google cloud

How to include standard path in bazel

邮差的信 提交于 2019-12-25 01:44:01
问题 In my project, I want to use some commands which are installed via homebrew on Mac. Unfortunately, bazel doesn't include my modified classpath when I run commands via it. How can I enable such PATH with minimum amount of command line parameters and configurations? 回答1: There's an --action_env flag which allows to specify environment variables. See more here: https://bazel.build/designs/2016/06/21/environment.html 来源: https://stackoverflow.com/questions/48200987/how-to-include-standard-path-in