Update make variables documentation: - Remove outdated warning about C++ variables and "bazel --show_make_env" - Clarify what "execroot" means for source vs. output files - Make the genrule example more readable PiperOrigin-RevId: 231459264
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm index 816d17b..96d604a 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
@@ -97,13 +97,6 @@ and look at the top output lines with capital letters. </p> -<p> - <b>Nov 7, 2018</b>: C++ variables appear in the predefined list unless - <code><a - href="https://github.com/bazelbuild/bazel/issues/6381">--incompatible_disable_cc_configuration_make_variables</a></code> - is set. They will no longer appear after this flag is removed. -</p> - <p><strong>Toolchain option variables</strong></p> <ul><!-- keep alphabetically sorted --> @@ -206,12 +199,14 @@ <p> The predefined variables <code>execpath</code>, <code>execpaths</code>, <code>rootpath</code>, <code>rootpaths</code>, <code>location</code>, and - <code>locations</code> take a label parameter (e.g. <code>$(execpath + <code>locations</code> take label parameters (e.g. <code>$(execpath //foo:bar)</code>) and substitute the file paths denoted by that label. </p> <p> - For source files, this is the path of the file. For other rules, this is the - output path(s) of the file(s) generated by that rule. + + For source files, this is the path relative to your workspace root. + For files that are outputs of rules, this is the file's <i>output path</i> + (see the explanation of <i>output files</i> below). </p> <p>Example:</p> @@ -228,15 +223,17 @@ name = "show_app_output", srcs = ["empty.source"], outs = ["app_output"], - cmd = "echo :app output paths > $@;" - + "echo ' ' execpath: $(execpath :app) >> $@;" - + "echo ' ' runfiles: $(rootpath :app) >> $@;" - + "echo ' ' location: $(location :app) >> $@;" - + "echo >> $@;" - + "echo source file paths >> $@;" - + "echo ' ' execpath: $(execpath empty.source) >> $@;" - + "echo ' ' runfiles: $(rootpath empty.source) >> $@", - + "echo ' ' location: $(location empty.source) >> $@;" + cmd = """cat <<EOF > $@ +:app output paths + execpath: $(execpath :app) + runfiles: $(rootpath :app) + location: $(location :app) + +source file paths + execpath: $(execpath empty.source) + runfiles: $(rootpath empty.source) + location: $(location empty.source) +EOF""", tools = [":app"]) $ bazel build //testapp:show_app_output && cat bazel-genfiles/testapp/app_output @@ -258,9 +255,10 @@ <ul> <li> <p> - <code>execpath</code>: Denotes the path beneath the <a - href="../output_directories.html">execroot</a> where Bazel runs build - actions. + <code>execpath</code>: Denotes the path beneath the + + <a href="../output_directories.html">execroot</a> + where Bazel runs build actions. </p> <p> In the above example, Bazel runs all build actions in the directory linked