Skip to content
Merged
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
4 changes: 0 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
213 changes: 0 additions & 213 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions scripts/diff-build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ""

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -170,4 +169,4 @@ else
fi

echo ""
echo "bazel-diff build completed successfully!"
echo "bazel-diff build completed successfully!"
Loading