peterxcli opened a new pull request, #10537:
URL: https://github.com/apache/ozone/pull/10537

   ## What changes were proposed in this pull request?
   
   `hdds-interface-client` and `hdds-interface-server` generate protobuf/gRPC 
Java sources that are expected to use Ratis-shaded dependencies:
   
   `org.apache.ratis.thirdparty.io.grpc`
   `org.apache.ratis.thirdparty.com.google.protobuf`
   `org.apache.ratis.thirdparty.com.google.common`
   The existing `maven-antrun-plugin` replacement used `<replace dir="...">`, 
which did not reliably apply to generated Java files under nested package 
directories such as:
   
   ```text
   target/generated-sources/proto-java-for-ratis/org/apache/hadoop/...
   ```
   
   As a result, clean builds could leave generated gRPC sources importing 
unshaded packages like `io.grpc`, causing interface module compilation failures 
and downstream missing-proto-class errors.
   
   This patch changes the replacement rules to use explicit recursive Ant 
`<fileset>` entries over `{}/{*}.java`.
   
   No protobuf definitions or generated sources are checked in by this change.
   
   Why:
   
   A clean build can fail in `hdds-interface-client` or `hdds-interface-server` 
because generated Ratis protobuf/gRPC sources still reference unshaded packages.
   
   This can also surface downstream as missing generated classes such as:
   
   - `ContainerProtos`
   - `HddsProtos`
   - `XceiverClientProtocolServiceGrpc`
   
   Reproduction before the fix:
   
   On a clean checkout without this patch:
   
   ```bash
   mvn -pl :hdds-interface-client clean compile \
   -DskipTests -DskipShade -DskipRecon -DskipDocs
   ```
   
   Example failure:
   
   ```text
   
target/generated-sources/proto-java-for-ratis/.../XceiverClientProtocolServiceGrpc.java:[3,22]
 package io.grpc does not exist
   
target/generated-sources/proto-java-for-ratis/.../IntraDatanodeProtocolServiceGrpc.java:[7,26]
 package io.grpc.stub.annotations does not exist
   ```
   
   A downstream build can also fail during test compilation, for example:
   
   ```bash
   mvn clean test-compile -pl hadoop-ozone/s3gateway -am
   ```
   
   with errors like:
   
   ```text
   package org.apache.hadoop.hdds.protocol.datanode.proto does not exist
   cannot find symbol: class HddsProtos
   cannot find symbol: class ContainerCommandRequestProto
   ```
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15593
   
   ## How was this patch tested?
   
   (Please explain how this patch was tested. Ex: unit tests, manual tests, 
workflow run on the fork git repo.)
   (If this patch involves UI changes, please attach a screenshot; otherwise, 
remove this.)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to