How to get the commands executed by Bazel

I was wondering if there is a way to get Bazel to list, output, display, etc. all commands that can be executed from the command line that are run during build after cleaning. I don't care if the output displays on the screen, in a file, etc. If necessary, I will massage it into a useful form.

I started the screen output during Bazel startup, which gives me an idea of ​​what is being done, however it does not give me a command that I can execute on the command line. The command should include all parameters of the command and not display variables.

If this is not possible, since Bazel is open source, where there is / in the code, these are the lines that represent the commands that will be executed so that I can modify Bazel to output executable commands.

I am aware of the query command in Bazel and is used to create a dependency diagram. If this can be done as a query command, it would be even better.

TL; DR;

My goal is to create TensorFlow using Bazel for Windows. Yes, I know about all the problems and reasons for NOT doing this and have successfully installed TensorFlow on Windows through a virtual machine or Docker. I made an attempt to build Bazel on Windows starting with Cygwin, but it started to get out of control, since I use the installation with packages, and Cygwin does not play well with packages, so I started trying to build Bazel manually and it turned into a quagmire. So now I'm trying to just create TensorFlow manually on Windows, duplicating what Bazel will do to create TensorFlow on Linux.

+7
command bazel
Nov 29 '15 at 14:09
source share
1 answer

You are right, you can use the -s ( --subcommands ) option:

 bazel build -s //foo 

See https://docs.bazel.build/versions/master/user-manual.html#flag--subcommands .

In your use case, you probably want to redirect the output to a file, and then globally replace any libraries / binary paths with Windows equivalents.

You might want to track https://github.com/bazelbuild/bazel/issues/276 (Windows support), although it will probably be time.

+9
Nov 30 '15 at 17:41
source share



All Articles