Skip to content

Commit

Permalink
make the x test more like the top
Browse files Browse the repository at this point in the history
  • Loading branch information
malkia committed Oct 3, 2024
1 parent c1b96de commit 26347ca
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 4,665 deletions.
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ otel_sdk.zip
WORKSPACE
.bazelrc
otel_sdk_build.cmd
.git
x
48 changes: 19 additions & 29 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@
build --features=parse_headers
build --features=layering_check

common --incompatible_use_plus_in_repo_names

# Don't try to build .so and .dylib shared libs (instead of static) libs on Linux/OSX
# For some reason, with clang-cl, it also tried to do on Windows, where dynamic linking just does not support it.
build --dynamic_mode=off

build --experimental_cc_shared_library

common --incompatible_disable_native_repo_rules

common --noenable_workspace
common --remote_download_minimal

# Avoid using c:\windows\system32\bash.exe
common:windows --shell_executable="c:\\program files\\git\\usr\\bin\\bash.exe"

#common --noexperimental_merged_skyframe_analysis_execution

common --nolegacy_external_runfiles
build --nolegacy_important_outputs

common --skip_incompatible_explicit_targets

# Enable automatic configs based on platform
Expand All @@ -33,12 +27,10 @@ build --build_tag_filters=-jaeger,-opentracing,-opentracing_shim
test --test_tag_filters=-jaeger,-opentracing,-opentracing_shim

build --experimental_convenience_symlinks=clean
build --experimental_cc_implementation_deps

build:windows --copt="/Brepro" --copt="/guard:cf" --copt="/guard:ehcont" --copt="/Z7" --copt="/JMC-" --copt="/sdl"
build:windows --host_copt="/Brepro" --host_copt="/guard:cf" --host_copt="/guard:ehcont" --host_copt="/Z7" --host_copt="/JMC-" --host_copt="/sdl"
build:windows --linkopt="/Brepro" --linkopt="/guard:cf" --linkopt="/guard:ehcont" --linkopt="/DEBUG:FULL" --linkopt="/CETCOMPAT" --linkopt="/SWAPRUN:NET,CD" --linkopt="/OPT:REF,ICF" --linkopt="/RELEASE" --linkopt="/DEBUGTYPE:CV,PDATA,FIXUP"
build:windows --host_linkopt="/Brepro" --host_linkopt="/guard:cf" --host_linkopt="/guard:ehcont" --host_linkopt="shell32.lib"
build:windows --host_linkopt="shell32.lib"
# Requires Visual Studio 2019 Build Tools installed in default location with the latest compiler (14.29.30133) for x64
build:windows --action_env=BAZEL_VC_FULL_VERSION=14.29.30133 --action_env=BAZEL_WINSDK_FULL_VERSION=10.0.22621.0
build:windows --host_action_env=BAZEL_VC_FULL_VERSION=14.29.30133 --host_action_env=BAZEL_WINSDK_FULL_VERSION=10.0.22621.0
Expand Down Expand Up @@ -79,12 +71,6 @@ common:tsan --cc_output_directory_tag=tsan
# https://github.com/google/sanitizers/issues/953
common:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0

## This is what my ../top.bazelrc contains (not in the repo as local to my machine)
# build --disk_cache=f:/b/d
# common --repository_cache=f:/b/r
# startup --output_user_root=f:/b/u
try-import %workspace%/../top.bazelrc

test --test_size_filters=small,medium,large,enormous
test --test_timeout_filters=short,moderate,long,eternal
test --test_verbose_timeout_warnings
Expand All @@ -101,17 +87,18 @@ startup --windows_enable_symlinks

# Ideally all of these should get uncommented for further bazel migrations
# This list was taken from here https://github.com/bazelbuild/bazel/releases/tag/7.0.0
# common --incompatible_disable_starlark_host_transitions
# common --incompatible_stop_exporting_language_modules
common --incompatible_auto_exec_groups
common --incompatible_config_setting_private_default_visibility
common --incompatible_disable_native_repo_rules
common --incompatible_disable_non_executable_java_binary
common --incompatible_disallow_struct_provider_syntax
common --incompatible_disable_target_provider_fields
common --incompatible_struct_has_no_methods
common --incompatible_config_setting_private_default_visibility
# common --incompatible_stop_exporting_language_modules
common --incompatible_disallow_empty_glob
# common --incompatible_disable_starlark_host_transitions

build --nolegacy_important_outputs
common --incompatible_disallow_struct_provider_syntax
common --incompatible_strict_action_env
common --incompatible_struct_has_no_methods
common --incompatible_use_plus_in_repo_names

build --@curl//:use_mbedtls=true
# build --@curl//:http_only=true
Expand All @@ -129,18 +116,21 @@ build:clang-cl --host_per_file_copt="protobuf\\+/.*@-Wno-invalid-offsetof"
build:clang-cl --per_file_copt="c-ares\\+/.*@-Wno-macro-redefined"
build:clang-cl --host_per_file_copt="c-ares\\+/.*@-Wno-macro-redefined"

# LLVM 1.19.1
# LLVM 19.1.0
# opentelemetry/logs/logger.h(76,89):
# error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw]
# detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
# ^
build:clang-cl --copt=-Wno-missing-template-arg-list-after-template-kw

build --incompatible_strict_action_env


# still does not work yet
#common --incompatible_enable_proto_toolchain_resolution

# allow newer protobuf to compile
common --experimental_google_legacy_api
common --experimental_google_legacy_api

## This is what my ../top.bazelrc contains (not in the repo as local to my machine)
# build --disk_cache=f:/b/d
# common --repository_cache=f:/b/r
# startup --output_user_root=f:/b/u
try-import %workspace%/../top.bazelrc
6 changes: 3 additions & 3 deletions bazel/opentelemetry-proto.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index 0000000..07d6a90
+# Copyright The OpenTelemetry Authors
+# SPDX-License-Identifier: Apache-2.0
+
+load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
+load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+
+package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -167,5 +167,5 @@ index 0000000..a5a5e54
+ compatibility_level = 0,
+)
+
+bazel_dep(name = "grpc", version = "1.56.3.bcr.1", repo_name = "com_github_grpc_grpc")
+bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
+bazel_dep(name = "grpc", version = "1.66.0.bcr.2")
+bazel_dep(name = "rules_proto", version = "6.0.2")
20 changes: 10 additions & 10 deletions multitool.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@
"binaries": [
{
"kind": "file",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.3/sentry-cli-Linux-aarch64",
"sha256": "fbafab83e3f1b5dc9ef733524957a4c9fb3d5c607f2be0b11e9f031e36909cce",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.6/sentry-cli-Linux-aarch64",
"sha256": "01915e5930649b9867775e1ea0807742542bb8b98268cd4921a0eb1ad6146d97",
"os": "linux",
"cpu": "arm64"
},
{
"kind": "file",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.3/sentry-cli-Linux-x86_64",
"sha256": "f1cb3f3936230c20ae4ab20802614fa208063d6239f7d29e06abb0917a934118",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.6/sentry-cli-Linux-x86_64",
"sha256": "2ee44f63b820fc3f543ea362d83047738552457db7ffb49b4757d907f40daa96",
"os": "linux",
"cpu": "x86_64"
},
{
"kind": "file",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.3/sentry-cli-Darwin-arm64",
"sha256": "82a1478f623e7f5c54300d2f13c560841048a020591279bdf7469ee3647545af",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.6/sentry-cli-Darwin-arm64",
"sha256": "13befc6e6fcd3248605bf4f721f638a2f5a028a6427f17396d4c8ba3eb87116c",
"os": "macos",
"cpu": "arm64"
},
{
"kind": "file",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.3/sentry-cli-Darwin-x86_64",
"sha256": "48a999bd17d4888a6b41cf5062c9381907c6a8226d0f6c4b0b3dcd79247e1094",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.6/sentry-cli-Darwin-x86_64",
"sha256": "d7797b3f1aa3d6053b232cb31915b74089237df0def288ef6fdee2351a17839d",
"os": "macos",
"cpu": "x86_64"
},
{
"kind": "file",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.3/sentry-cli-Windows-x86_64.exe",
"sha256": "49bd3c20b693a4871e3340ec526cb826e716ee003aa2edea2fc11dc7aa4f58f2",
"url": "https://github.com/getsentry/sentry-cli/releases/download/2.36.6/sentry-cli-Windows-x86_64.exe",
"sha256": "2d0a50334df8681b26c1fd5bf5715a9adcf48ef58b2ce3b90bfc9431c5857ae0",
"os": "windows",
"cpu": "x86_64"
}
Expand Down
4 changes: 2 additions & 2 deletions opentracing-shim/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

load("//:dll_deps.bzl", "dll_deps")
load("//bazel:otel_cc.bzl", "otel_cc_binary", "otel_cc_import", "otel_cc_library", "otel_cc_shared_library", "otel_cc_test")
load("//bazel:otel_cc.bzl", "otel_cc_library", "otel_cc_test")

package(default_visibility = ["//visibility:public"])

Expand All @@ -25,7 +25,7 @@ otel_cc_library(
tags = ["opentracing"],
deps = [
"//api",
"@com_github_opentracing//:opentracing",
"@opentracing-cpp//:opentracing",
],
)

Expand Down
58 changes: 22 additions & 36 deletions x/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@ module(
version = "0.1",
)

bazel_dep(name = "otel_sdk", version = "")
bazel_dep(name = "otel_sdk")
local_path_override(
module_name = "otel_sdk",
path = "..",
)

## Almost copied verbatim from ../MODULE.bazel

bazel_dep(name = "abseil-cpp", version = "20240722.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "boringssl", version = "0.20240913.0")
# Below is needed as we have "build --@curl//:use_mbedtls=true" from ..\.bazelrc
bazel_dep(name = "curl", version = "8.8.0.bcr.1")
bazel_dep(name = "google_benchmark", version = "1.8.5")
bazel_dep(name = "googletest", version = "1.15.2")

# bazel_dep(name = "google_benchmark", version = "1.8.5")
# bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "grpc", version = "1.66.0.bcr.2")
single_version_override(
module_name = "grpc",
Expand All @@ -26,23 +23,23 @@ single_version_override(
patches = ["bazel/grpc_bzlmod.diff"],
)

bazel_dep(name = "nlohmann_json", version = "3.11.3")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "zlib", version = "1.3.1.bcr.3")
bazel_dep(name = "rules_multitool", version = "0.12.0")
bazel_dep(name = "opentelemetry-proto", version = "1.3.2")
archive_override(
module_name = "opentelemetry-proto",
integrity = "sha256-wGnA2WE3zwBdNEEfpn3TtvH4xkrx5/sv4AiaQcQlrNc=",
patch_strip = 1,
# Copied from https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/opentelemetry-proto/1.3.1/patches
patches = ["bazel/opentelemetry-proto.patch"],
strip_prefix = "opentelemetry-proto-1.3.2",
urls = "https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v1.3.2.tar.gz",
)
# bazel_dep(name = "nlohmann_json", version = "3.11.3")
# bazel_dep(name = "platforms", version = "0.0.10")
# bazel_dep(name = "rules_cc", version = "0.0.10")
# bazel_dep(name = "rules_pkg", version = "1.0.1")
# bazel_dep(name = "rules_proto", version = "6.0.2")
# bazel_dep(name = "zlib", version = "1.3.1.bcr.3")
# bazel_dep(name = "rules_multitool", version = "0.12.0")
# bazel_dep(name = "opentelemetry-proto", version = "1.3.2")
# archive_override(
# module_name = "opentelemetry-proto",
# integrity = "sha256-wGnA2WE3zwBdNEEfpn3TtvH4xkrx5/sv4AiaQcQlrNc=",
# patch_strip = 1,
# # Copied from https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/opentelemetry-proto/1.3.1/patches
# patches = ["bazel/opentelemetry-proto.patch"],
# strip_prefix = "opentelemetry-proto-1.3.2",
# urls = "https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v1.3.2.tar.gz",
# )

bazel_dep(name = "prometheus-cpp", version = "1.2.4")
archive_override(
Expand All @@ -56,14 +53,3 @@ use_repo(
use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension"),
"local_config_cc",
)

# This is needed only for most of the `bazel mod xxx` functions to work.
#
# Otherwise it complaints with
#
# ERROR: in tag at https://bcr.bazel.build/modules/grpc-java/1.62.2/MODULE.bazel:89:15: no repository visible as
# '@com_google_protobuf_javalite' to the repository '@@grpc-java+', but referenced by label
# '@com_google_protobuf_javalite//:protobuf_javalite' in attribute 'target' of tag 'override'.
# Is the module 'grpc-java' missing a bazel_dep or use_repo(..., "com_google_protobuf_javalite")?.
#
bazel_dep(name = "grpc-java", version = "1.66.0")
Loading

0 comments on commit 26347ca

Please sign in to comment.