Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies: build #12604

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bazel/envoy_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def tcmalloc_external_deps(repository):

# Envoy C++ library targets that need no transformations or additional dependencies before being
# passed to cc_library should be specified with this function. Note: this exists to ensure that
# all envoy targets pass through an envoy-declared starlark function where they can be modified
# all envoy targets pass through an envoy-declared Starlark function where they can be modified
# before being passed to a native bazel function.
def envoy_basic_cc_library(name, deps = [], external_deps = [], **kargs):
cc_library(
Expand Down
2 changes: 1 addition & 1 deletion bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ envoy_cmake_external(
"CMAKE_CXX_COMPILER_FORCED": "on",
"YAML_MSVC_SHARED_RT": "off",
},
lib_source = "@com_github_jbeder_yaml_cpp//:all",
lib_source = "@com_github_greenhouse_org_yaml_cpp//:all",
static_libraries = select({
"//bazel:windows_x86_64": ["yaml-cpp.lib"],
"//conditions:default": ["libyaml-cpp.a"],
Expand Down
8 changes: 4 additions & 4 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def envoy_dependencies(skip_targets = []):
_com_github_google_libprotobuf_mutator()
_com_github_gperftools_gperftools()
_com_github_grpc_grpc()
_com_github_jbeder_yaml_cpp()
_com_github_greenhouse_org_yaml_cpp()
_com_github_libevent_libevent()
_com_github_luajit_luajit()
_com_github_moonjit_moonjit()
Expand Down Expand Up @@ -338,10 +338,10 @@ def _com_github_google_libprotobuf_mutator():
build_file = "@envoy//bazel/external:libprotobuf_mutator.BUILD",
)

def _com_github_jbeder_yaml_cpp():
location = _get_location("com_github_jbeder_yaml_cpp")
def _com_github_greenhouse_org_yaml_cpp():
location = _get_location("com_github_greenhouse_org_yaml_cpp")
http_archive(
name = "com_github_jbeder_yaml_cpp",
name = "com_github_greenhouse_org_yaml_cpp",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't rename this, this has to match what in https://github.com/greenhouse-org/yaml-cpp/blob/master/WORKSPACE#L1.

build_file_content = BUILD_ALL_CONTENT,
**location
)
Expand Down
50 changes: 25 additions & 25 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ DEPENDENCY_ANNOTATIONS = [
# NOTE: If a dependency use case is either dataplane or controlplane, the other uses are not needed
# to be declared.
USE_CATEGORIES = [
# This dependency is used in build process.
"build",
# This dependency is used for unit tests.
"test",
# This dependency is used in API protos.
"api",
# This dependency is used in processing downstream or upstream requests.
"dataplane",
# This dependency is used in build process.
"build",
# This dependency is used to process xDS requests.
"controlplane",
# This dependency is used in processing downstream or upstream requests.
"dataplane",
# This dependecy is used for logging, metrics or tracing. It may process unstrusted input.
"observability",
# This dependency does not handle untrusted data and is used for various utility purposes.
"other",
# This dependency is used for unit tests.
"test",
]

# Components with these use categories are not required to specify the 'cpe' annotation.
USE_CATEGORIES_WITH_CPE_OPTIONAL = ["build", "test", "other"]
USE_CATEGORIES_WITH_CPE_OPTIONAL = ["build", "other", "test"]

DEPENDENCY_REPOSITORIES = dict(
bazel_compdb = dict(
Expand All @@ -48,16 +48,16 @@ DEPENDENCY_REPOSITORIES = dict(
use_category = ["build"],
),
bazel_gazelle = dict(
sha256 = "86c6d481b3f7aedc1d60c1c211c6f76da282ae197c3b3160f54bd3a8f847896f",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.1/bazel-gazelle-v0.19.1.tar.gz"],
sha256 = "cdb02a887a7187ea4d5a27452311a75ed8637379a1287d8eeb952138ea485f7d",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.1/bazel-gazelle-v0.21.1.tar.gz"],
use_category = ["build"],
),
bazel_toolchains = dict(
sha256 = "882fecfc88d3dc528f5c5681d95d730e213e39099abff2e637688a91a9619395",
strip_prefix = "bazel-toolchains-3.4.0",
sha256 = "7ebb200ed3ca3d1f7505659c7dfed01c4b5cb04c3a6f34140726fe22f5d35e86",
strip_prefix = "bazel-toolchains-3.4.1",
urls = [
"https://github.com/bazelbuild/bazel-toolchains/releases/download/3.4.0/bazel-toolchains-3.4.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/3.4.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/releases/download/3.4.1/bazel-toolchains-3.4.1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/3.4.1.tar.gz",
],
use_category = ["build"],
),
Expand All @@ -67,10 +67,10 @@ DEPENDENCY_REPOSITORIES = dict(
use_category = ["build"],
),
envoy_build_tools = dict(
sha256 = "88e58fdb42021e64a0b35ae3554a82e92f5c37f630a4dab08a132fc77f8db4b7",
strip_prefix = "envoy-build-tools-1d6573e60207efaae6436b25ecc594360294f63a",
# 2020-07-18
urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/1d6573e60207efaae6436b25ecc594360294f63a.tar.gz"],
sha256 = "11c79534c41ddf29b1f24bfba5901317140e1d0e741527cfe55c1a9c6485eabb",
strip_prefix = "envoy-build-tools-c3bc4b105a621051b48b38d2e8a03768d9dc5d7e",
# 2020-07-28
urls = ["https://github.com/envoyproxy/envoy-build-tools/archive/c3bc4b105a621051b48b38d2e8a03768d9dc5d7e.tar.gz"],
use_category = ["build"],
),
boringssl = dict(
Expand Down Expand Up @@ -261,7 +261,7 @@ DEPENDENCY_REPOSITORIES = dict(
use_category = ["dataplane"],
cpe = "cpe:2.3:a:gnu:zlib:*",
),
com_github_jbeder_yaml_cpp = dict(
com_github_greenhouse_org_yaml_cpp = dict(
sha256 = "79ab7069ef1c7c3632e7ffe095f7185d4c77b64d8035db3c085c239d4fe96d5f",
strip_prefix = "yaml-cpp-98acc5a8874faab28b82c28936f4b400b389f5d6",
# 2020-07-28
Expand Down Expand Up @@ -298,9 +298,9 @@ DEPENDENCY_REPOSITORIES = dict(
use_category = ["build"],
),
com_github_pallets_markupsafe = dict(
sha256 = "222a10e3237d92a9cd45ed5ea882626bc72bc5e0264d3ed0f2c9129fa69fc167",
strip_prefix = "markupsafe-1.1.1/src",
urls = ["https://github.com/pallets/markupsafe/archive/1.1.1.tar.gz"],
sha256 = "2b0c5c2a067d9268813d55523bc513a12181cffb23b2f3d5618eb5d93776bad8",
strip_prefix = "markupsafe-2.0.0a1/src",
urls = ["https://github.com/pallets/markupsafe/archive/2.0.0a1.tar.gz"],
use_category = ["build"],
),
com_github_tencent_rapidjson = dict(
Expand Down Expand Up @@ -367,10 +367,10 @@ DEPENDENCY_REPOSITORIES = dict(
use_category = ["build"],
),
rules_foreign_cc = dict(
sha256 = "7ca49ac5b0bc8f5a2c9a7e87b7f86aca604bda197259c9b96f8b7f0a4f38b57b",
strip_prefix = "rules_foreign_cc-f54b7ae56dcf1b81bcafed3a08d58fc08ac095a7",
# 2020-06-09
urls = ["https://github.com/bazelbuild/rules_foreign_cc/archive/f54b7ae56dcf1b81bcafed3a08d58fc08ac095a7.tar.gz"],
sha256 = "b6baa480dd7c0a73c861f16e4482f727f6b53ba08f433d5ea8649f5654b79e24",
strip_prefix = "rules_foreign_cc-9eb30f8c5a214799b73707666ca49e7b7a35978f",
# 2020-07-13
urls = ["https://github.com/bazelbuild/rules_foreign_cc/archive/9eb30f8c5a214799b73707666ca49e7b7a35978f.tar.gz"],
use_category = ["build"],
),
rules_python = dict(
Expand Down
16 changes: 8 additions & 8 deletions tools/code_format/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def isExternalBuildFile(file_path):
file_path.startswith("./tools/clang_tools"))


def isSkylarkFile(file_path):
def isStarlarkFile(file_path):
return file_path.endswith(".bzl")


Expand Down Expand Up @@ -764,19 +764,19 @@ def checkSourceLine(line, file_path, reportError):


def checkBuildLine(line, file_path, reportError):
if "@bazel_tools" in line and not (isSkylarkFile(file_path) or file_path.startswith("./bazel/") or
if "@bazel_tools" in line and not (isStarlarkFile(file_path) or file_path.startswith("./bazel/") or
"python/runfiles" in line):
reportError("unexpected @bazel_tools reference, please indirect via a definition in //bazel")
if not allowlistedForProtobufDeps(file_path) and '"protobuf"' in line:
reportError("unexpected direct external dependency on protobuf, use "
"//source/common/protobuf instead.")
if (envoy_build_rule_check and not isSkylarkFile(file_path) and not isWorkspaceFile(file_path) and
if (envoy_build_rule_check and not isStarlarkFile(file_path) and not isWorkspaceFile(file_path) and
not isExternalBuildFile(file_path) and "@envoy//" in line):
reportError("Superfluous '@envoy//' prefix")


def fixBuildLine(file_path, line, line_number):
if (envoy_build_rule_check and not isSkylarkFile(file_path) and not isWorkspaceFile(file_path) and
if (envoy_build_rule_check and not isStarlarkFile(file_path) and not isWorkspaceFile(file_path) and
not isExternalBuildFile(file_path)):
line = line.replace("@envoy//", "//")
return line
Expand All @@ -788,7 +788,7 @@ def fixBuildPath(file_path):
error_messages = []

# TODO(htuch): Add API specific BUILD fixer script.
if not isBuildFixerExcludedFile(file_path) and not isApiFile(file_path) and not isSkylarkFile(
if not isBuildFixerExcludedFile(file_path) and not isApiFile(file_path) and not isStarlarkFile(
file_path) and not isWorkspaceFile(file_path):
if os.system("%s %s %s" % (ENVOY_BUILD_FIXER_PATH, file_path, file_path)) != 0:
error_messages += ["envoy_build_fixer rewrite failed for file: %s" % file_path]
Expand All @@ -801,7 +801,7 @@ def fixBuildPath(file_path):
def checkBuildPath(file_path):
error_messages = []

if not isBuildFixerExcludedFile(file_path) and not isApiFile(file_path) and not isSkylarkFile(
if not isBuildFixerExcludedFile(file_path) and not isApiFile(file_path) and not isStarlarkFile(
file_path) and not isWorkspaceFile(file_path):
command = "%s %s | diff %s -" % (ENVOY_BUILD_FIXER_PATH, file_path, file_path)
error_messages += executeCommand(command, "envoy_build_fixer check failed", file_path)
Expand Down Expand Up @@ -907,7 +907,7 @@ def checkFormat(file_path):
# Apply fixes first, if asked, and then run checks. If we wind up attempting to fix
# an issue, but there's still an error, that's a problem.
try_to_fix = operation_type == "fix"
if isBuildFile(file_path) or isSkylarkFile(file_path) or isWorkspaceFile(file_path):
if isBuildFile(file_path) or isStarlarkFile(file_path) or isWorkspaceFile(file_path):
if try_to_fix:
error_messages += fixBuildPath(file_path)
error_messages += checkBuildPath(file_path)
Expand Down Expand Up @@ -989,7 +989,7 @@ def checkFormatVisitor(arg, dir_name, names):
checkOwners(dir_name[len(source_prefix):], owned_directories, error_messages)

for file_name in names:
if dir_name.startswith("./api") and isSkylarkFile(file_name):
if dir_name.startswith("./api") and isStarlarkFile(file_name):
result = pool.apply_async(checkApiShadowStarlarkFiles,
args=(api_shadow_root, dir_name + "/" + file_name, error_messages))
result_list.append(result)
Expand Down