How do I get the commands executed by Bazel

后端 未结 2 2036
耶瑟儿~
耶瑟儿~ 2020-12-16 12:31

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 afte

相关标签:
2条回答
  • 2020-12-16 12:52

    I'd use aquery:

    bazel aquery //foo
    

    It's very fast, because it prints the actions without executing the build. And you don't have to do a bazel clean before.

    0 讨论(0)
  • 2020-12-16 12:56

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

    bazel build -s //foo
    

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

    For your use case, you'd probably want to redirect the output to a file and then global replace any library/binary paths to the Windows equivalents.

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

    0 讨论(0)
提交回复
热议问题