2021-11-09 23:13:30 +00:00
|
|
|
"Public API"
|
|
|
|
|
|
|
|
load("//lib/private:paths.bzl", "paths")
|
|
|
|
|
|
|
|
relative_file = paths.relative_file
|
2021-11-10 14:30:07 +00:00
|
|
|
to_manifest_path = paths.to_manifest_path
|
2021-11-17 05:30:32 +00:00
|
|
|
to_workspace_path = paths.to_workspace_path
|
2021-11-10 14:30:07 +00:00
|
|
|
|
|
|
|
# Bash helper function for looking up runfiles.
|
|
|
|
# See windows_utils.bzl for the cmd.exe equivalent.
|
2021-11-17 05:30:32 +00:00
|
|
|
# Vendored from
|
2021-11-10 14:30:07 +00:00
|
|
|
# https://github.com/bazelbuild/bazel/blob/master/tools/bash/runfiles/runfiles.bash
|
|
|
|
BASH_RLOCATION_FUNCTION = r"""
|
|
|
|
# --- begin runfiles.bash initialization v2 ---
|
|
|
|
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash
|
|
|
|
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
|
|
|
|
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
|
|
|
|
source "$0.runfiles/$f" 2>/dev/null || \
|
|
|
|
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
|
|
|
|
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
|
|
|
|
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
|
|
|
|
# --- end runfiles.bash initialization v2 ---
|
|
|
|
"""
|