From 451f26754eeb2c4002984873774414caab1cfd57 Mon Sep 17 00:00:00 2001 From: Christopher Sauer Date: Sun, 3 Apr 2022 10:11:23 -0700 Subject: [PATCH] Remove legacy proto code for Bazel < 0.21 (#3099) --- proto/compiler.bzl | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/proto/compiler.bzl b/proto/compiler.bzl index 86c8674be8..a84e54dbcf 100644 --- a/proto/compiler.bzl +++ b/proto/compiler.bzl @@ -143,21 +143,6 @@ def proto_path(src, proto): Returns: An import path string. """ - if not hasattr(proto, "proto_source_root"): - # Legacy path. Remove when Bazel minimum version >= 0.21.0. - path = src.path - root = src.root.path - ws = src.owner.workspace_root - if path.startswith(root): - path = path[len(root):] - if path.startswith("/"): - path = path[1:] - if path.startswith(ws): - path = path[len(ws):] - if path.startswith("/"): - path = path[1:] - return path - if proto.proto_source_root == ".": # true if proto sources were generated prefix = src.root.path + "/"