Reputation: 19788
I'm using bazel
5.1.0
and have the following in a BUILD
file:
sh_binary(
name = "aoeu",
srcs = ["aoeu.sh"]
)
The contents of aoeu.sh
is:
#!/bin/bash
echo "BAZEL_WORKSPACE_DIRECTORY=${BAZEL_WORKSPACE_DIRECTORY}"
When I bazel run aoeu
, the output is BAZEL_WORKSPACE_DIRECTORY=
.
Based on https://docs.bazel.build/versions/main/user-manual.html, my understanding is that BAZEL_WORKSPACE_DIRECTORY
should be set. Why isn't it?
Upvotes: 1
Views: 1570
Reputation: 20530
The desired environmental variable is called BUILD_WORKSPACE_DIRECTORY
not BAZEL_WORKSPACE_DIRECTORY
.
Upvotes: 3