You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "qianye1001 (via GitHub)" <gi...@apache.org> on 2026/05/26 12:56:12 UTC

[I] [Bug] Bazel dependencies are out of sync with Maven; align Bazel BUILD files to pom.xml [rocketmq]

qianye1001 opened a new issue, #10383:
URL: https://github.com/apache/rocketmq/issues/10383

   **Describe the bug**
   
   The project maintains two parallel build systems — Maven (`pom.xml`) and Bazel (`BUILD.bazel` / `WORKSPACE` / `MODULE.bazel`). Over time the dependency graphs of the two have drifted: some artifacts present in Maven are missing, outdated, or differently versioned in Bazel, which leads to inconsistent classpaths, build failures on the Bazel path, and runtime behavior that differs between the two toolchains.
   
   **Current behavior**
   
   - `pom.xml` declares dependencies / versions / scopes that are not reflected in the corresponding `BUILD.bazel` `deps` / `runtime_deps` / `exports`.
   - A few third-party libraries have been bumped in Maven but their `maven_install` / `rules_jvm_external` pins in Bazel still point to older versions.
   - New modules added under Maven do not yet have matching `java_library` / `java_binary` targets, or the targets exist but reference a stale dep set.
   - Some `provided` / `test` scope mappings in Maven are not mirrored in Bazel (`neverlink = True`, `testonly = True`).
   
   **Expected behavior**
   
   Maven (`pom.xml`) is the source of truth. Bazel BUILD files and the external dependency lock should be regenerated/aligned so that:
   
   1. Every Maven dependency (same `group:artifact:version` and scope semantics) is reachable from the equivalent Bazel target.
   2. `maven_install_json` / lock file is regenerated and committed.
   3. Per-module `BUILD.bazel` `deps` lists exactly mirror the module's `pom.xml` `<dependencies>`, including `provided` → `neverlink`, `test` → `testonly`, `optional` → not exported.
   4. `bazel build //...` and `bazel test //...` succeed and produce the same effective classpath as `mvn -pl <module> dependency:tree`.
   
   **Proposed scope of work**
   
   - Diff every module: `mvn dependency:tree` vs `bazel query 'deps(//module:target)'`, output a reconciliation table.
   - Update `MODULE.bazel` / `WORKSPACE` artifact list and regenerate the lock.
   - Update each module's `BUILD.bazel` `deps` / `runtime_deps` / `exports` to match.
   - Add a CI check (script or Bazel test) that fails when `pom.xml` and `BUILD.bazel` drift again.
   - Document the alignment rule in the contributor guide so future PRs touching `pom.xml` must also touch the matching `BUILD.bazel`.
   
   **Acceptance criteria**
   
   - [ ] `bazel build //...` green
   - [ ] `bazel test //...` green
   - [ ] Dependency diff tool reports zero discrepancies between Maven and Bazel
   - [ ] CI guard added to prevent regression


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Bazel dependencies are out of sync with Maven; align Bazel BUILD files to pom.xml [rocketmq]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10383:
URL: https://github.com/apache/rocketmq/issues/10383#issuecomment-5328037657

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   The Bazel BUILD files being out of sync with Maven `pom.xml` is a valid build system issue. Dual build systems require manual synchronization, and drift leads to inconsistent classpaths and build failures.
   
   **Root Cause:** No automated mechanism to keep Bazel BUILD files in sync with Maven dependencies.
   **Impact:** Bazel builds may fail or produce different results than Maven builds.
   **Severity:** Low (only affects developers using Bazel)
   
   ---
   *Automated evaluation by RockteMQ-AI*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Bazel dependencies are out of sync with Maven; align Bazel BUILD files to pom.xml [rocketmq]

Posted by "qianye1001 (via GitHub)" <gi...@apache.org>.
qianye1001 commented on issue #10383:
URL: https://github.com/apache/rocketmq/issues/10383#issuecomment-4544242740

   /approve


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Bazel dependencies are out of sync with Maven; align Bazel BUILD files to pom.xml [rocketmq]

Posted by "qianye1001 (via GitHub)" <gi...@apache.org>.
qianye1001 commented on issue #10383:
URL: https://github.com/apache/rocketmq/issues/10383#issuecomment-4553623621

   ## PR Created
   
   I've created a pull request to fix this issue: https://github.com/apache/rocketmq/pull/10391
   
   **Title:** [ISSUE #10383] Align Bazel WORKSPACE dependencies with Maven pom.xml
   
   **Changes:**
   - 20 dependency version bumps in WORKSPACE maven_install
   - 2 new artifacts added (grpc-netty, opentelemetry-context)
   - 1 artifact renamed (bcpkix-jdk15on -> bcpkix-jdk18on)
   - 1 duplicate entry removed (fastjson2)
   
   **Base:** develop (commit 41a3a35)
   **Head:** qianye1001:fix/issue-10383
   
   Please review the changes. The PR will be updated if any revisions are requested.
   
   ---
   *This PR was automatically generated based on the fix proposal.*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Bazel dependencies are out of sync with Maven; align Bazel BUILD files to pom.xml [rocketmq]

Posted by "qianye1001 (via GitHub)" <gi...@apache.org>.
qianye1001 commented on issue #10383:
URL: https://github.com/apache/rocketmq/issues/10383#issuecomment-4544221349

   ## Issue Analysis: Bazel Dependencies Out of Sync with Maven
   
   ### Verification Status: ✅ **Confirmed Bug**
   
   Analyzed against develop branch (commit 41a3a35). The issue is **valid** — Bazel dependency declarations have significantly drifted from Maven pom.xml.
   
   ### Key Findings
   
   **18 version mismatches** in WORKSPACE:
   
   | Artifact | Maven | Bazel | Status |
   |----------|-------|-------|--------|
   | netty-all | 4.1.130.Final | 4.1.65.Final | ⚠️ 65 patches behind |
   | fastjson | 1.2.83 | 1.2.76 | ⚠️ 7 versions behind |
   | guava | 32.0.1-jre | 31.0.1-jre | ⚠️ 1 major behind |
   | commons-lang3 | 3.20.0 | 3.12.0 | ⚠️ 8 minors behind |
   | commons-io | 2.14.0 | 2.7 | ⚠️ 7 minors behind |
   | bcpkix | jdk18on:1.83 | jdk15on:1.69 | ⚠️ artifact renamed + version |
   | grpc-* | 1.53.0 | 1.47.0 | ⚠️ 6 minors behind |
   | ... and 11 more | | | |
   
   **Missing from WORKSPACE:** grpc-netty, disruptor, sofa-jraft, jackson-databind, rocketmq-client-java, s3mock-junit4
   
   **Module drift (common/ example):** pom.xml has grpc-stub, grpc-netty-shaded, okio-jvm, annotations-api → missing from BUILD.bazel
   
   **3 modules without BUILD.bazel:** distribution, example, openmessaging
   
   **No CI guard** to prevent future drift.
   
   ### Recommended Fix (2 PRs)
   
   **PR1 — Quick win:**
   - Update all 18 version pins in WORKSPACE to match pom.xml
   - Add 6 missing artifacts to WORKSPACE
   - Regenerate lock file (`REPIN=1 bazel run @unpinned_maven//:pin`)
   
   **PR2 — Full alignment:**
   - Reconcile per-module BUILD.bazel deps against pom.xml
   - Add BUILD.bazel for example/ and openmessaging/
   - Add CI drift-check script to `bazel.yml`
   - Document alignment rules in contributor guide
   
   ### Labels
   
   Suggested: `bug`, `module/container` (build system)
   
   ---
   
   Full spec available as `spec_v1.md` in the issue workspace. Awaiting community feedback: `/approve`, `/revise`, or `/reject`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org