.bazelrc中的用户名 [英] User name in .bazelrc

查看:98
本文介绍了.bazelrc中的用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将此添加到我的.bazelrc中,但是$(whoami)不会像在外壳中那样扩展.

I would like to add this to my .bazelrc, but the $(whoami) doesn't expand like if it was in a shell.

startup --output_user_root=/tmp/bazel/out/$(whoami)                                                                                                                             

它产生文字结果:

/tmp/bazel/out/$(whoami)/faedb999bdce730c9c495251de1ca1a4/execroot/__main__/bazel-out/

有什么方法可以做:在.bashrc文件中的选项中添加名称/哈希吗?

Is there any way to do what I want: adding a name/hash to the option in the .bashrc file?

我真正想要的是在不使用环境变量的情况下将outputRoot设置为/tmp/bazel/out,并让bazel在其中创建用户目录和工作区哈希目录.

推荐答案

您可以从包装器脚本运行Bazel.实际上,这正是bazel二进制文件的含义(至少在Linux上是如此):这是一个调用bazel-real的包装器脚本.您可以根据需要编辑此包装器脚本,也可以将其重命名为bazel.sh并编写自己的包装器.

You can run Bazel from a wrapper script. In fact, that's exactly what the bazel binary is (at least on Linux): it's a wrapper script that calls bazel-real. You can edit this wrapper script if you like, or rename it to bazel.sh and write your own wrapper.

这篇关于.bazelrc中的用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆