Removed obsolete references to runfiles scripts.

pull/13171/head
Joshua Haberman 6 years ago
parent 81e813d389
commit 7913bc678a
  1. 9
      BUILD
  2. 31
      build_defs.bzl

@ -360,11 +360,13 @@ cc_test(
upb_proto_library( upb_proto_library(
name = "conformance_proto_upb", name = "conformance_proto_upb",
deps = ["@com_google_protobuf//:conformance_proto"], deps = ["@com_google_protobuf//:conformance_proto"],
testonly = 1,
) )
upb_proto_library( upb_proto_library(
name = "test_messages_proto3_proto_upb", name = "test_messages_proto3_proto_upb",
deps = ["@com_google_protobuf//:test_messages_proto3_proto"], deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
testonly = 1,
) )
cc_binary( cc_binary(
@ -378,6 +380,7 @@ cc_binary(
":test_messages_proto3_proto_upb", ":test_messages_proto3_proto_upb",
":upb", ":upb",
], ],
testonly = 1,
) )
make_shell_script( make_shell_script(
@ -392,7 +395,6 @@ sh_test(
data = [ data = [
"tests/conformance_upb_failures.txt", "tests/conformance_upb_failures.txt",
":conformance_upb", ":conformance_upb",
"@bazel_tools//tools/bash/runfiles",
"@com_google_protobuf//:conformance_test_runner", "@com_google_protobuf//:conformance_test_runner",
], ],
) )
@ -515,10 +517,7 @@ make_shell_script(
sh_test( sh_test(
name = "cmake_build", name = "cmake_build",
srcs = ["run_cmake_build.sh"], srcs = ["run_cmake_build.sh"],
data = [ data = [":cmake_files"],
":cmake_files",
"@bazel_tools//tools/bash/runfiles",
],
) )
# Generated files ############################################################## # Generated files ##############################################################

@ -7,31 +7,6 @@ load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("@bazel_version//:bazel_version.bzl", "bazel_version") load("@bazel_version//:bazel_version.bzl", "bazel_version")
# copybara:strip_end # copybara:strip_end
_shell_find_runfiles = """
# --- begin runfiles.bash initialization ---
# Copy-pasted from Bazel's Bash runfiles library (tools/bash/runfiles/runfiles.bash).
set -euo pipefail
if [[ ! -d "${RUNFILES_DIR:-/dev/null}" && ! -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
if [[ -f "$0.runfiles_manifest" ]]; then
export RUNFILES_MANIFEST_FILE="$0.runfiles_manifest"
elif [[ -f "$0.runfiles/MANIFEST" ]]; then
export RUNFILES_MANIFEST_FILE="$0.runfiles/MANIFEST"
elif [[ -f "$0.runfiles/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
export RUNFILES_DIR="$0.runfiles"
fi
fi
if [[ -f "${RUNFILES_DIR:-/dev/null}/bazel_tools/tools/bash/runfiles/runfiles.bash" ]]; then
source "${RUNFILES_DIR}/bazel_tools/tools/bash/runfiles/runfiles.bash"
elif [[ -f "${RUNFILES_MANIFEST_FILE:-/dev/null}" ]]; then
source "$(grep -m1 "^bazel_tools/tools/bash/runfiles/runfiles.bash " \
"$RUNFILES_MANIFEST_FILE" | cut -d ' ' -f 2-)"
else
echo >&2 "ERROR: cannot find @bazel_tools//tools/bash/runfiles:runfiles.bash"
exit 1
fi
# --- end runfiles.bash initialization ---
"""
def _librule(name): def _librule(name):
return name + "_lib" return name + "_lib"
@ -96,11 +71,11 @@ def lua_library(name, srcs, strip_prefix, luadeps = []):
) )
def make_shell_script(name, contents, out): def make_shell_script(name, contents, out):
script_contents = (_shell_find_runfiles + contents).replace("$", "$$") contents = contents.replace("$", "$$")
native.genrule( native.genrule(
name = "gen_" + name, name = "gen_" + name,
outs = [out], outs = [out],
cmd = "(cat <<'HEREDOC'\n%s\nHEREDOC\n) > $@" % script_contents, cmd = "(cat <<'HEREDOC'\n%s\nHEREDOC\n) > $@" % contents,
) )
def _lua_binary_or_test(name, luamain, luadeps, rule): def _lua_binary_or_test(name, luamain, luadeps, rule):
@ -120,7 +95,7 @@ $(rlocation lua/lua) $(rlocation upb/tools/upbc.lua) "$@"
rule( rule(
name = name, name = name,
srcs = [script], srcs = [script],
data = ["@lua//:lua", "@bazel_tools//tools/bash/runfiles", luamain] + luadeps, data = ["@lua//:lua", luamain] + luadeps,
) )
def lua_binary(name, luamain, luadeps = []): def lua_binary(name, luamain, luadeps = []):

Loading…
Cancel
Save