如何将工作区路径传递给bazel规则

问题描述:

似乎有一个make env变量workspacekeeps the path value of the original bazel workspace如何将工作区路径传递给bazel规则

但我不知道如何将此变量传递给bazel规则。

exports_files([ 
    "configure.py", 
]) 

py_binary(
    name = "configure", 
    srcs = [ 
     "configure.py", 
    ], 
    data = [ 
     "//tensorflow/tools/git:gen_git_source.py", 
     "//tools", 
    ], 
    args = [ 
#  "--workspace=" + $(location workspace), # the path to the repository 
     "--tf_workspace=$(location workspace)" , # the path to the 
    ] 
) 
+0

你想通过将工作区名称传递给二进制来解决什么问题? –

不幸的是巴泽尔既不支持也不$(location workspace)$(workspace)

是什么让你觉得它呢?