gpt4 book ai didi

bazel - 如何查看 Bazel 构建输出?

转载 作者:行者123 更新时间:2023-12-03 16:38:21 24 4
gpt4 key购买 nike

您如何看待 bazel 构建的标准输出?

我想查看在 bazel 构建期间写入标准输出的所有日志。

这些都不允许它在失败后显示 ls 命令

$ bazel build --show_progress --worker_verbose --verbose_failures --verbose_explanations=true -s --test_output=streamed :build
genrule(
name = "build",
cmd = "ls && sleep 60 && exit 1",
)

$ bazel build --show_progress --worker_verbose --verbose_failures --verbose_explanations=true -s --test_output=streamed :build
WARNING: --verbose_explanations has no effect when --explain=<file> is not enabled
INFO: Analyzed target //:build (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
SUBCOMMAND: # //:build [action 'Executing genrule //:build']
(cd /private/var/tmp/_bazel_kevinsimper/f9e6a72c146c5ad83b84a8ebf539f8b2/execroot/__main__ && \
exec env - \
PATH=/usr/local/sbin \
/bin/bash -c 'source external/bazel_tools/tools/genrule/genrule-setup.sh; ls && sleep 60 && exit 1')
ERROR: /Users/kevinsimper/testproject/BUILD:1:1: Executing genrule //:build failed (Exit 1)
BUILD
TESTFILE
Target //:build failed to build
INFO: Elapsed time: 60.256s, Critical Path: 60.04s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

最佳答案

除非是在使用 --test_output=streamed 时进行测试,否则无法在执行时流式传输操作 stdout/stderr旗帜。

关于bazel - 如何查看 Bazel 构建输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58023994/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com