Questions tagged [bazel-extra-action]
14 questions
11
votes
2 answers
How can you run the executables of other rules within a Bazel rule?
Say I have a custom rule, my_object. It looks like:
my_object(
name = "foo",
deps = [
//services/image-A:push,
//services/image-B:push,
]
)
Where the labels in deps are rules_docker's container_push rules.
I want to be able to bazel…

thundergolfer
- 527
- 1
- 5
- 18
3
votes
1 answer
Instantiating a Bazel macro twice with same generated output file
Suppose I have a Bazel macro that is using a generator rule to generate an output file given an input file:
def my_generator(
name,
input_file,
output_file,
**kwargs):
args = []
args.extend(["--arg1",…

roschach
- 8,390
- 14
- 74
- 124
3
votes
0 answers
Bazel genrule Check if location expression expands to no files
I am writing a genrule in Bazel. I have a file withing a folder that may or may not exist. I want to reference it if it does but ignore it if it does not. How do i do an conditional check in the cmd part of the genrule before doing $(location…

flexxxit
- 2,440
- 5
- 42
- 69
3
votes
1 answer
How do I move a bazel build target?
All of the bazel rules put the build targets in a specific place.
I can find the targets through bazel-bin/, but they are all scattered recursively with other non-target files I don't care about.
How do I write a build rule that puts all my…

Trevor Hickey
- 36,288
- 32
- 162
- 271
1
vote
0 answers
Bazel: Can the output of one extra_action be used as input of a succeeding extra_action?
I use two succeeding extra_action in the Bazel build. I wonder if there is a way to specify that the output files generated by the first extra_action shall be used as input to another extra_action (both executes during the same build)?
I use bazel…

lisaonduty
- 21
- 1
1
vote
1 answer
How to debug java_library rule in a bazel build?
I dug around option and source code but still unsure how to debug a bazel build, java specifically.
Also anyone know how I can change bazel, build it locally and use it on builds to verify. I found bazel invocation:
exec -a "$0" "${BAZEL_REAL}"…

HoaPhan
- 1,714
- 1
- 13
- 35
1
vote
1 answer
Is there any way to generate the deps list for particular rules?
I have a program that can look at my language's source file, and derive the correct value for the deps=[] value of its build rule.
I'm looking for a way to replace all my existing rules (that look like this):
build_lib(name = "foo", deps =…

Trevor Hickey
- 36,288
- 32
- 162
- 271
0
votes
1 answer
Bazel build: Add extra dependencies not in `WORKSPACE`
I'd like to write some profiling scripts on a project, and use action_listener or aspect to take action. However, it's better not modifying the project files. Is there any way to add some external dependencies without change WORKSPACE file?

3usi9
- 103
- 2
0
votes
1 answer
BAZEL: Query all targets in bazel rule
Here is code structure
| //base_folder
├── file0.txt
├── BUILD
├── folder1
| ├── BUILD
| ├── file1
├── folder2
| ├── BUILD
| ├── file2
I'd like to know all the files or target information to do a further process.
I can use bazel query…

ReneSun
- 23
- 2
- 5
0
votes
1 answer
While adding the maven dependency in bazel project,unable to running the bazel run @maven//:pin,getting maven_install.json as empty.facing below issue
bazel run @maven//:pin
Starting local Bazel server and connecting to it...
INFO: Analyzed target @maven//:pin (7 packages loaded, 26 targets configured).
INFO: Found 1 target...
Target @maven//:pin…
0
votes
1 answer
Ways to concat test results from each of the bazel tests?
I have a build file that runs some Bazel tests , like this on Azure pipeline
jobs:
- job: "results_extraction"
timeoutInMinutes: 720
steps:
- bash: |
./install_conda_environment.sh update
displayName: "Update conda…

amipro
- 378
- 3
- 14
0
votes
1 answer
bazel_0_13 + rpi3 -> build success or failed?
I'm cross-compiling bazel to use for TensorFlow.
Bazel for Raspberry pi3
Bazel-0.13
HOST: Ubuntu 16.04 LTS x86-64
TARGET: Raspbery PI3
Toolchain: Local installed rpi3 toolchain
Building bazel for HOST.
$(BAZEL_HOME_TOP) $ ./compile.sh
Build…

GBiradar
- 161
- 1
- 11
0
votes
3 answers
How can work on eclipse for Bazel project?
Is there way using eclise for bazel project, there is guide https://github.com/bazelbuild/eclipse . Eclipse plugin for Bazel, but I can not find Eclipse 4 Bazel on installation

Jamesjin
- 371
- 2
- 6
- 15
0
votes
1 answer
Information passing between extra_actions
I have an action_listener:
action_listener(
name = "foo_listen",
mnemonics = [
"Foo", # Foo might usually take several minutes
],
extra_actions = [
"foo_action_pre", # Start some processing
"foo_action_post",…

abergmeier
- 13,224
- 13
- 64
- 120