bazel使用问题汇总

来源:互联网 发布:手机音频软件 编辑:程序博客网 时间:2024/06/05 20:51

来源于bazel官方文档https://docs.bazel.build/versions/master/output_directories.html


Bazel must be invoked from a directory containing a WORKSPACE file. It reports an error if it is not. We call this the workspace directory.
Bazel必须从woskspace目录下调用,该目录下包含WORKSPACE 文件



The outputRoot directory is ~/.cache/bazel. (Unless $TEST_TMPDIR is set, as in a test of bazel itself, in which case this directory is used instead.)
如果不设置$TEST_TMPDIR环境变量,bazel编译时的中间文件位于~/.cache/bazel

并且弹出警告信息:

WARNING: Output base '~/.cache/bazel' is on NFS. This may lead to surprising failures and undetermined behavior.

解决办法:

设置环境变量$TEST_TMPDIR,相应命令为:

export TEST_TMPDIR=/tmp/cache_bazel

设置该环境变量后,使用bazel进行编译时弹出以下信息:

INFO: $TEST_TMPDIR defined: output root default is '/tmp/cache_bazel'

原创粉丝点击