为什么 BUILD_WORKSPACE_DIRECTORY 没有设置?

Why is BUILD_WORKSPACE_DIRECTORY not getting set?

我正在使用 bazel 5.1.0 并在 BUILD 文件中包含以下内容:

sh_binary(
    name = "aoeu",
    srcs = ["aoeu.sh"]
)

aoeu.sh的内容是:

#!/bin/bash

echo "BAZEL_WORKSPACE_DIRECTORY=${BAZEL_WORKSPACE_DIRECTORY}"

当我bazel run aoeu时,输出是BAZEL_WORKSPACE_DIRECTORY=

根据https://docs.bazel.build/versions/main/user-manual.html,我的理解是应该设置BAZEL_WORKSPACE_DIRECTORY。为什么不是?

所需的环境变量名为 BUILD_WORKSPACE_DIRECTORY 而不是 BAZEL_WORKSPACE_DIRECTORY