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

[WIP] bazel: Bump -> 7.4.1 #37578

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# Startup options cannot be selected via config.
startup --host_jvm_args=-Xmx3g

common --noenable_bzlmod

fetch --color=yes
run --color=yes

Expand Down Expand Up @@ -85,6 +87,7 @@ build:clang --action_env=BAZEL_COMPILER=clang
build:clang --linkopt=-fuse-ld=lld
build:clang --action_env=CC=clang --host_action_env=CC=clang
build:clang --action_env=CXX=clang++ --host_action_env=CXX=clang++
build:clang --incompatible_enable_cc_toolchain_resolution=false

# Flags for Clang + PCH
build:clang-pch --spawn_strategy=local
Expand All @@ -110,6 +113,7 @@ build:gcc --cxxopt=-Wno-missing-requires
# not in GCC 11 and GCC 11 is what is used in docker-gcc
# configuration currently
build:gcc --cxxopt=-Wno-unknown-warning
build:gcc --incompatible_enable_cc_toolchain_resolution=false

# Clang-tidy
# TODO(phlax): enable this, its throwing some errors as well as finding more issues
Expand Down Expand Up @@ -216,6 +220,7 @@ build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a
build:libc++ --action_env=BAZEL_LINKOPTS=-lm:-pthread
build:libc++ --define force_libcpp=enabled
build:clang-libc++ --config=libc++
build:clang-libc++ --action_env=ARFLAGS=r

build:libc++20 --config=libc++
# gRPC has a lot of deprecated-enum-enum-conversion warning. Remove once it is addressed
Expand Down Expand Up @@ -267,6 +272,7 @@ build:cache-local --remote_cache=grpc://localhost:9092

# Remote execution: https://docs.bazel.build/versions/master/remote-execution.html
build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:rbe-toolchain --incompatible_enable_cc_toolchain_resolution=false

build:rbe-toolchain-clang --config=rbe-toolchain
build:rbe-toolchain-clang --platforms=@envoy//bazel/rbe/toolchains:rbe_linux_clang_platform
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.4.1
5 changes: 5 additions & 0 deletions bazel/coverage/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
licenses(["notice"]) # Apache 2

filegroup(
name = "coverage_support",
srcs = ["collect_cc_coverage.sh"],
)

exports_files(["fuzz_coverage_wrapper.sh"])
2 changes: 2 additions & 0 deletions bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchai
load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies")
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains")
load("@rules_rust//crate_universe:defs.bzl", "crates_repository")
Expand Down Expand Up @@ -64,6 +65,7 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y
emscripten_deps(emscripten_version = "3.1.7")
register_jq_toolchains(version = jq_version)
register_yq_toolchains(version = yq_version)
rules_java_toolchains()
parser_deps()

# These dependencies, like most of the Go in this repository, exist only for the API.
Expand Down
2 changes: 2 additions & 0 deletions bazel/repositories_extra.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
load("@bazel_features//:deps.bzl", "bazel_features_deps")
load("@emsdk//:deps.bzl", emsdk_deps = "deps")
load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:crates.bzl", "crate_repositories")
load("@rules_java//java:repositories.bzl", "rules_java_dependencies")
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates")

Expand Down Expand Up @@ -30,3 +31,4 @@ def envoy_dependencies_extra(
)

aspect_bazel_lib_dependencies()
rules_java_dependencies()
2 changes: 1 addition & 1 deletion bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
release_date = "2024-12-06",
strip_prefix = "rules_python-{version}",
urls = ["https://github.com/bazelbuild/rules_python/archive/{version}.tar.gz"],
use_category = ["build"],
use_category = ["build", "controlplane", "dataplane_core"],
license = "Apache-2.0",
license_url = "https://github.com/bazelbuild/rules_python/blob/{version}/LICENSE",
),
Expand Down
14 changes: 11 additions & 3 deletions mobile/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ build:mobile-remote-release-clang --config=ci
build:mobile-remote-release-clang --config=remote

build:mobile-remote-release-clang-android --config=mobile-remote-release-clang
build:mobile-remote-release-clang-android --fat_apk_cpu=x86_64
build:mobile-remote-release-clang-android --android_platforms=//:android_x86_64
build:mobile-remote-release-clang-android --linkopt=-fuse-ld=lld
build:mobile-remote-release-clang-android --incompatible_enable_cc_toolchain_resolution=false

build:mobile-remote-release-clang-android-publish --config=mobile-remote-release-clang
build:mobile-remote-release-clang-android-publish --config=mobile-release-android
build:mobile-remote-release-clang-android-publish --fat_apk_cpu=x86,x86_64,armeabi-v7a,arm64-v8a
build:mobile-remote-release-clang-android-publish --android_platforms=//:android_x86_32,//:android_x86_64,//:android_armv7,//:android_arm64
build:mobile-remote-release-clang-android-publish --linkopt=-fuse-ld=lld

# Compile releases optimizing for size (eg -Os, etc).
Expand All @@ -137,6 +138,10 @@ build:mobile-release-android --compilation_mode=opt

# Instrument Envoy Mobile's C++ code for coverage
coverage --instrumentation_filter="//library/common[/:]"
# coverage --instrumentation_filter="//[/:]"
coverage --action_env=VERBOSE_COVERAGE=1 --host_action_env=VERBOSE_COVERAGE=1 --test_env=VERBOSE_COVERAGE=1
# coverage --test_env=CC_CODE_COVERAGE_SCRIPT=external/envoy/bazel/coverage/collect_cc_coverage.sh
# coverage --coverage_support=@envoy//bazel/coverage:coverage_support

#############################################################################
# Experimental EngFlow Remote Execution Configs
Expand Down Expand Up @@ -199,10 +204,13 @@ test:mobile-remote-ci-linux-tsan --test_env=ENVOY_IP_TEST_VERSIONS=v4only
# Coverage environment variables (keep in sync with //third_party/rbe_configs)
build:mobile-ci-linux-coverage --action_env=GCOV=/opt/llvm/bin/llvm-profdata
build:mobile-ci-linux-coverage --test_env=GCOV=/opt/llvm/bin/llvm-profdata
build:mobile-ci-linux-coverage --repo_env=GCOV=/opt/llvm/bin/llvm-profdata
build:mobile-ci-linux-coverage --action_env=BAZEL_LLVM_COV=/opt/llvm/bin/llvm-cov
build:mobile-ci-linux-coverage --test_env=BAZEL_LLVM_COV=/opt/llm/bin/llvm-cov
build:mobile-ci-linux-coverage --test_env=BAZEL_LLVM_COV=/opt/llvm/bin/llvm-cov
build:mobile-ci-linux-coverage --repo_env=BAZEL_LLVM_COV=/opt/llvm/bin/llvm-cov
build:mobile-ci-linux-coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
build:mobile-ci-linux-coverage --test_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
build:mobile-ci-linux-coverage --repo_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
build:mobile-ci-linux-coverage --build_tests_only

#############################################################################
Expand Down
32 changes: 32 additions & 0 deletions mobile/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,35 @@ xcodeproj(
"//test/swift:test",
],
)

platform(
name = "android_armv7",
constraint_values = [
"@platforms//cpu:armv7",
"@platforms//os:android",
],
)

platform(
name = "android_arm64",
constraint_values = [
"@platforms//cpu:arm64",
"@platforms//os:android",
],
)

platform(
name = "android_x86_32",
constraint_values = [
"@platforms//cpu:x86_32",
"@platforms//os:android",
],
)

platform(
name = "android_x86_64",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:android",
],
)
2 changes: 1 addition & 1 deletion mobile/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ alias(

alias(
name = "jni",
actual = "@bazel_tools//tools/jdk:jni",
actual = "@rules_java//toolchains:jni",
visibility = ["//library/jni:__pkg__"],
)

Expand Down
3 changes: 2 additions & 1 deletion mobile/bazel/framework_imports_extractor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ didn't have to enumerate the files in the framework zip, but that isn't
supported by 'apple_static_framework_import'.
"""

load("@build_bazel_rules_apple//apple/internal:transition_support.bzl", "transition_support")
load("//bazel:config.bzl", "MINIMUM_IOS_VERSION")

def _framework_imports_extractor(ctx):
Expand Down Expand Up @@ -47,7 +48,7 @@ framework_imports_extractor = rule(
attrs = dict(
framework = attr.label(
mandatory = True,
cfg = apple_common.multi_arch_split,
cfg = transition_support.apple_platform_split_transition,
),
platform_type = attr.string(default = "ios"),
minimum_os_version = attr.string(default = MINIMUM_IOS_VERSION),
Expand Down
2 changes: 1 addition & 1 deletion tools/proto_format/format_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def format_api(mode, outfile, xformed, printed, build_file):
dst_src_paths = defaultdict(list)

for label in data["proto_targets"]:
_label = label[len('@envoy_api//'):].replace(':', '/')
_label = label[len('@@envoy_api//'):].replace(':', '/')
for suffix in ["active_or_frozen", "next_major_version_candidate"]:
xpath = xformed_dir.joinpath(f"pkg/{_label}.{suffix}.proto")
path = printed_dir.joinpath(f"{_label}.proto")
Expand Down