diff --git a/.bazelrc b/.bazelrc index fb519da2..2daefd67 100644 --- a/.bazelrc +++ b/.bazelrc @@ -8,10 +8,6 @@ common --color=yes common --incompatible_enable_proto_toolchain_resolution common --@com_google_protobuf//bazel/toolchains:prefer_prebuilt_protoc -# Enforce BzlMod usage -common --noenable_workspace -common --enable_bzlmod=true - # Fork BCR for testing (remove after upstream merge) common --registry=https://raw.githubusercontent.com/aaylward/bazel-central-registry/otel_cpp_bazel_8_9 common --registry=https://bcr.bazel.build diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index bf097a6e..5c55fdcb 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -572,57 +572,6 @@ } } }, - "@@envoy_api+//bazel:repositories.bzl%non_module_deps": { - "general": { - "bzlTransitiveDigest": "DITA13hLUg1ghuzFJXkoidwLUcSUZ8eP36QseHw3oQ4=", - "usagesDigest": "lOhJkV09ITWn6LOK9fLMuf1t3969wdr45lToQ2MVQoU=", - "recordedInputs": [ - "REPO_MAPPING:envoy_api+,bazel_tools bazel_tools", - "REPO_MAPPING:envoy_api+,envoy_api envoy_api+" - ], - "generatedRepoSpecs": { - "prometheus_metrics_model": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "urls": [ - "https://github.com/prometheus/client_model/archive/v0.6.2.tar.gz" - ], - "sha256": "47c5ea7949f68e7f7b344350c59b6bd31eeb921f0eec6c3a566e27cf1951470c", - "strip_prefix": "client_model-0.6.2", - "build_file_content": "\nload(\"@envoy_api//bazel:api_build_system.bzl\", \"api_cc_py_proto_library\")\nload(\"@io_bazel_rules_go//proto:def.bzl\", \"go_proto_library\")\n\napi_cc_py_proto_library(\n name = \"client_model\",\n srcs = [\n \"io/prometheus/client/metrics.proto\",\n ],\n visibility = [\"//visibility:public\"],\n)\n\ngo_proto_library(\n name = \"client_model_go_proto\",\n importpath = \"github.com/prometheus/client_model/go\",\n proto = \":client_model\",\n visibility = [\"//visibility:public\"],\n)\n" - } - } - } - } - }, - "@@googleapis+//:extensions.bzl%switched_rules": { - "general": { - "bzlTransitiveDigest": "dGjdAR2OztzWMSyz8eMU1fObvEYPBQh2DdtbMY2PmNc=", - "usagesDigest": "phuibqqjsm5RJqquWNJ7BXJvnPPgSCBreyRLEH/JjIA=", - "recordedInputs": [], - "generatedRepoSpecs": {} - } - }, - "@@pybind11_bazel+//:internal_configure.bzl%internal_configure_extension": { - "general": { - "bzlTransitiveDigest": "vQXYYIISsqHYpUHoDTN9dB7+8Y13YPTb7fJltJA5d6Y=", - "usagesDigest": "tVQNvLoXMWAbiK39am3yovKGpwINdftfn7RpDyN+JZc=", - "recordedInputs": [ - "REPO_MAPPING:pybind11_bazel+,bazel_tools bazel_tools" - ], - "generatedRepoSpecs": { - "pybind11": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "build_file": "@@pybind11_bazel+//:pybind11-BUILD.bazel", - "strip_prefix": "pybind11-2.13.6", - "url": "https://github.com/pybind/pybind11/archive/refs/tags/v2.13.6.tar.gz", - "integrity": "sha256-4Iy4f0dz2pf6e18DXeh2OrxlbYfVdz5i9toFh9Hw7CA=" - } - } - } - } - }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { "bzlTransitiveDigest": "m5FNZZeNCyu5NFVLxp9nxedZaJmJL7/GN/fgl03/YTM=", @@ -970,69 +919,6 @@ } } }, - "@@rules_perl+//perl:extensions.bzl%perl_repositories": { - "general": { - "bzlTransitiveDigest": "K8OybB84tBcly/FCawLeUWEaEGko6fQHirIx59UasjQ=", - "usagesDigest": "qSSNDdCNVxNhY36wMndEAFacdhR0ooLTmumfad0km9s=", - "recordedInputs": [ - "REPO_MAPPING:rules_perl+,bazel_tools bazel_tools", - "REPO_MAPPING:rules_perl+,rules_perl rules_perl+" - ], - "generatedRepoSpecs": { - "perl_darwin_arm64": { - "repoRuleId": "@@rules_perl+//perl:repo.bzl%perl_download", - "attributes": { - "strip_prefix": "perl-darwin-arm64", - "sha256": "285769f3c50c339fb59a3987b216ae3c5c573b95babe6875a1ef56fb178433da", - "urls": [ - "https://github.com/skaji/relocatable-perl/releases/download/5.36.0.1/perl-darwin-arm64.tar.xz" - ] - } - }, - "perl_darwin_amd64": { - "repoRuleId": "@@rules_perl+//perl:repo.bzl%perl_download", - "attributes": { - "strip_prefix": "perl-darwin-amd64", - "sha256": "63bc5ee36f5394d71c50cca6cafdd333ee58f9eaa40bca63c85f9bd06f2c1fd6", - "urls": [ - "https://github.com/skaji/relocatable-perl/releases/download/5.36.0.1/perl-darwin-amd64.tar.xz" - ] - } - }, - "perl_linux_amd64": { - "repoRuleId": "@@rules_perl+//perl:repo.bzl%perl_download", - "attributes": { - "strip_prefix": "perl-linux-amd64", - "sha256": "3bdffa9d7a3f97c0207314637b260ba5115b1d0829f97e3e2e301191a4d4d076", - "urls": [ - "https://github.com/skaji/relocatable-perl/releases/download/5.36.0.1/perl-linux-amd64.tar.xz" - ] - } - }, - "perl_linux_arm64": { - "repoRuleId": "@@rules_perl+//perl:repo.bzl%perl_download", - "attributes": { - "strip_prefix": "perl-linux-arm64", - "sha256": "6fa4ece99e790ecbc2861f6ecb7b52694c01c2eeb215b4370f16a3b12d952117", - "urls": [ - "https://github.com/skaji/relocatable-perl/releases/download/5.36.0.1/perl-linux-arm64.tar.xz" - ] - } - }, - "perl_windows_x86_64": { - "repoRuleId": "@@rules_perl+//perl:repo.bzl%perl_download", - "attributes": { - "strip_prefix": "", - "sha256": "aeb973da474f14210d3e1a1f942dcf779e2ae7e71e4c535e6c53ebabe632cc98", - "urls": [ - "https://mirror.bazel.build/strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.zip", - "https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit.zip" - ] - } - } - } - } - }, "@@rules_python+//python/extensions:config.bzl%config": { "general": { "bzlTransitiveDigest": "tpiXvHXWP8z23XkccFfNPavHB4Sq2c8kxPlZAR2mN5A=", @@ -5715,105 +5601,6 @@ } } } - }, - "@@rules_rust+//crate_universe/private:internal_extensions.bzl%cu_nr": { - "general": { - "bzlTransitiveDigest": "DGMBY1dpvP/xuzm7me7Ny9YWY2PbbS18SWkGV04oHQA=", - "usagesDigest": "v4We18mWSPeKV4GPp9Gne78W+jZOgP2pC1i4UN9br1g=", - "recordedInputs": [ - "REPO_MAPPING:bazel_features+,bazel_features_globals bazel_features++version_extension+bazel_features_globals", - "REPO_MAPPING:bazel_features+,bazel_features_version bazel_features++version_extension+bazel_features_version", - "REPO_MAPPING:rules_cc+,bazel_skylib bazel_skylib+", - "REPO_MAPPING:rules_cc+,bazel_tools bazel_tools", - "REPO_MAPPING:rules_cc+,cc_compatibility_proxy rules_cc++compatibility_proxy+cc_compatibility_proxy", - "REPO_MAPPING:rules_cc+,platforms platforms", - "REPO_MAPPING:rules_cc+,rules_cc rules_cc+", - "REPO_MAPPING:rules_cc++compatibility_proxy+cc_compatibility_proxy,rules_cc rules_cc+", - "REPO_MAPPING:rules_rust+,bazel_features bazel_features+", - "REPO_MAPPING:rules_rust+,bazel_skylib bazel_skylib+", - "REPO_MAPPING:rules_rust+,bazel_tools bazel_tools", - "REPO_MAPPING:rules_rust+,cui rules_rust++cu+cui", - "REPO_MAPPING:rules_rust+,rrc rules_rust++i2+rrc", - "REPO_MAPPING:rules_rust+,rules_cc rules_cc+", - "REPO_MAPPING:rules_rust+,rules_rust rules_rust+" - ], - "generatedRepoSpecs": { - "cargo_bazel_bootstrap": { - "repoRuleId": "@@rules_rust+//cargo/private:cargo_bootstrap.bzl%cargo_bootstrap_repository", - "attributes": { - "srcs": [ - "@@rules_rust+//crate_universe:src/api.rs", - "@@rules_rust+//crate_universe:src/api/lockfile.rs", - "@@rules_rust+//crate_universe:src/cli.rs", - "@@rules_rust+//crate_universe:src/cli/generate.rs", - "@@rules_rust+//crate_universe:src/cli/query.rs", - "@@rules_rust+//crate_universe:src/cli/render.rs", - "@@rules_rust+//crate_universe:src/cli/splice.rs", - "@@rules_rust+//crate_universe:src/cli/vendor.rs", - "@@rules_rust+//crate_universe:src/config.rs", - "@@rules_rust+//crate_universe:src/context.rs", - "@@rules_rust+//crate_universe:src/context/crate_context.rs", - "@@rules_rust+//crate_universe:src/context/platforms.rs", - "@@rules_rust+//crate_universe:src/lib.rs", - "@@rules_rust+//crate_universe:src/lockfile.rs", - "@@rules_rust+//crate_universe:src/main.rs", - "@@rules_rust+//crate_universe:src/metadata.rs", - "@@rules_rust+//crate_universe:src/metadata/cargo_bin.rs", - "@@rules_rust+//crate_universe:src/metadata/cargo_tree_resolver.rs", - "@@rules_rust+//crate_universe:src/metadata/cargo_tree_rustc_wrapper.bat", - "@@rules_rust+//crate_universe:src/metadata/cargo_tree_rustc_wrapper.sh", - "@@rules_rust+//crate_universe:src/metadata/dependency.rs", - "@@rules_rust+//crate_universe:src/metadata/metadata_annotation.rs", - "@@rules_rust+//crate_universe:src/rendering.rs", - "@@rules_rust+//crate_universe:src/rendering/template_engine.rs", - "@@rules_rust+//crate_universe:src/rendering/templates/module_bzl.j2", - "@@rules_rust+//crate_universe:src/rendering/templates/partials/header.j2", - "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/aliases_map.j2", - "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/deps_map.j2", - "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/repo_git.j2", - "@@rules_rust+//crate_universe:src/rendering/templates/partials/module/repo_http.j2", - "@@rules_rust+//crate_universe:src/rendering/templates/vendor_module.j2", - "@@rules_rust+//crate_universe:src/rendering/verbatim/alias_rules.bzl", - "@@rules_rust+//crate_universe:src/select.rs", - "@@rules_rust+//crate_universe:src/splicing.rs", - "@@rules_rust+//crate_universe:src/splicing/cargo_config.rs", - "@@rules_rust+//crate_universe:src/splicing/crate_index_lookup.rs", - "@@rules_rust+//crate_universe:src/splicing/splicer.rs", - "@@rules_rust+//crate_universe:src/test.rs", - "@@rules_rust+//crate_universe:src/utils.rs", - "@@rules_rust+//crate_universe:src/utils/starlark.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/glob.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/label.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/select.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/select_dict.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/select_list.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/select_scalar.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/select_set.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/serialize.rs", - "@@rules_rust+//crate_universe:src/utils/starlark/target_compatible_with.rs", - "@@rules_rust+//crate_universe:src/utils/symlink.rs", - "@@rules_rust+//crate_universe:src/utils/target_triple.rs" - ], - "binary": "cargo-bazel", - "cargo_lockfile": "@@rules_rust+//crate_universe:Cargo.lock", - "cargo_toml": "@@rules_rust+//crate_universe:Cargo.toml", - "version": "1.86.0", - "timeout": 900, - "rust_toolchain_cargo_template": "@rust_host_tools//:bin/{tool}", - "rust_toolchain_rustc_template": "@rust_host_tools//:bin/{tool}", - "compressed_windows_toolchain_names": false - } - } - }, - "moduleExtensionMetadata": { - "explicitRootModuleDirectDeps": [ - "cargo_bazel_bootstrap" - ], - "explicitRootModuleDirectDevDeps": [], - "useAllRepos": "NO", - "reproducible": false - } - } } }, "facts": { diff --git a/scripts/diff-build b/scripts/diff-build index 7ca3e520..349c16ee 100755 --- a/scripts/diff-build +++ b/scripts/diff-build @@ -12,7 +12,7 @@ BAZEL_DIFF_BIN="/tmp/bazel_diff" # Download pre-built bazel-diff binary if not already cached if [ ! -f "$BAZEL_DIFF_BIN" ]; then echo "Downloading bazel-diff binary..." - BAZEL_DIFF_VERSION="10.1.0" + BAZEL_DIFF_VERSION="12.1.1" BAZEL_DIFF_URL="https://github.com/Tinder/bazel-diff/releases/download/${BAZEL_DIFF_VERSION}/bazel-diff_deploy.jar" curl -sL "$BAZEL_DIFF_URL" -o "$BAZEL_DIFF_BIN.jar" # Create wrapper script to run the jar @@ -42,18 +42,17 @@ echo "" # Get current commit for restoration CURRENT_COMMIT=$(git rev-parse HEAD) -# Check if Bazel version is changing between base and current +# Check if Bazel configuration files are changing between base and current # If so, bazel-diff won't work reliably, so we need a full build -CURRENT_BAZEL_VERSION=$(cat .bazelversion 2>/dev/null || echo "") -BASE_BAZEL_VERSION=$(git show "$BASE_REVISION:.bazelversion" 2>/dev/null || echo "") - -if [ "$CURRENT_BAZEL_VERSION" != "$BASE_BAZEL_VERSION" ]; then - echo "==================== BAZEL VERSION CHANGE DETECTED ====================" - echo "Base version: ${BASE_BAZEL_VERSION:-'(none)'}" - echo "Current version: ${CURRENT_BAZEL_VERSION:-'(none)'}" - echo "========================================================================" +BAZEL_CONFIG_CHANGES=$(git diff --name-only "$BASE_REVISION" HEAD -- .bazelversion .bazelrc MODULE.bazel 'bazel/*' 2>/dev/null || echo "") + +if [ -n "$BAZEL_CONFIG_CHANGES" ]; then + echo "==================== BAZEL CONFIG CHANGE DETECTED ====================" + echo "Changed files:" + echo "$BAZEL_CONFIG_CHANGES" | sed 's/^/ /' + echo "======================================================================" echo "" - echo "bazel-diff is not reliable across Bazel version changes." + echo "bazel-diff is not reliable when Bazel configuration changes." echo "Falling back to full build and test..." echo "" @@ -86,7 +85,7 @@ git -C "$WORKSPACE_ROOT" checkout "$BASE_REVISION" --quiet --force "$BAZEL_DIFF_BIN" generate-hashes -w "$WORKSPACE_ROOT" -b "$BAZEL_PATH" $EXTERNAL_REPOS "$starting_hashes_json" # Generate hashes for current revision -echo "Generating hashes for current revision..." +echo "Generating hashes for current revision..." git -C "$WORKSPACE_ROOT" checkout "$CURRENT_COMMIT" --quiet --force "$BAZEL_DIFF_BIN" generate-hashes -w "$WORKSPACE_ROOT" -b "$BAZEL_PATH" $EXTERNAL_REPOS "$final_hashes_json" @@ -170,4 +169,4 @@ else fi echo "" -echo "bazel-diff build completed successfully!" \ No newline at end of file +echo "bazel-diff build completed successfully!"