xuxiaowei-com-cn opened a new issue, #8176:
URL: https://github.com/apache/incubator-seata/issues/8176

   ### Check Ahead
   
   - [x] I have searched the [issues](https://github.com/seata/seata/issues) of 
this repository and believe that this is not a duplicate.
   
   - [x] I am willing to try to fix this bug myself.
   
   
   ### Ⅰ. Issue Description
   
   When building Seata on the LoongArch architecture, the 
`protobuf-maven-plugin` is unable to resolve the `protoc-gen-grpc-java` 
executable.
   
   
   ### Ⅱ. Describe what happened
   
   
   ```shell
   [ERROR] Failed to execute goal 
org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:test-compile-custom 
(default) on project seata-grpc: Unable to resolve artifact: Missing:
   [ERROR] ----------
   [ERROR] 1) io.grpc:protoc-gen-grpc-java:exe:linux-loongarch_64:1.55.1
   [ERROR] 
   [ERROR]   Try downloading the file manually from the project website.
   [ERROR] 
   [ERROR]   Then, install it using the command: 
   [ERROR]       mvn install:install-file -DgroupId=io.grpc 
-DartifactId=protoc-gen-grpc-java -Dversion=1.55.1 
-Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/path/to/file
   [ERROR] 
   [ERROR]   Alternatively, if you host your own repository you can deploy the 
file there: 
   [ERROR]       mvn deploy:deploy-file -DgroupId=io.grpc 
-DartifactId=protoc-gen-grpc-java -Dversion=1.55.1 
-Dclassifier=linux-loongarch_64 -Dpackaging=exe -Dfile=/path/to/file 
-Durl=[url] -DrepositoryId=[id]
   [ERROR] 
   [ERROR]   Path to dependency: 
   [ERROR]         1) org.apache.seata:seata-grpc:jar:2.8.0-SNAPSHOT
   [ERROR]         2) io.grpc:protoc-gen-grpc-java:exe:linux-loongarch_64:1.55.1
   [ERROR] 
   [ERROR] ----------
   [ERROR] 1 required artifact is missing.
   [ERROR] 
   [ERROR] for artifact: 
   [ERROR]   org.apache.seata:seata-grpc:jar:2.8.0-SNAPSHOT
   ```
   
   <img width="2092" height="1230" alt="Image" 
src="https://github.com/user-attachments/assets/7d0b943b-c5ab-42b9-96e5-a40b23336ef9";
 />
   
   ### Ⅲ. Describe what you expected to happen
   
   Seata should build successfully on the LoongArch architecture, or it should 
be possible to work around this issue by specifying protobuf/gRPC version 
parameters to use lower versions (such as protobuf 3.25.4 and gRPC 1.54.2) 
available in the LoongArch Maven repository.
   
   
   ### Ⅳ. How to reproduce it (as minimally and precisely as possible)
   
   
   1. Clone the Seata repository on a LoongArch machine
   2. Run `mvn clean package`
   3. The build fails at the `seata-grpc` module
   
   **Root Cause Analysis:**
   
   1. The Maven Central repository does not contain the `protoc-gen-grpc-java` 
executable for the LoongArch architecture
   2. The LoongArch Maven repository 
(https://maven.loongnix.cn/loongarch/maven/) has `io.grpc:protoc-gen-grpc-java` 
up to version 1.54.2 only, which does not meet the required version 1.55.1
   3. The version numbers `3.25.4` (protobuf) and `1.55.1` (gRPC) are hardcoded 
in multiple places in the code:
      ```
      ./core/pom.xml:  
com.google.protobuf:protoc:3.25.4:exe:${os.detected.classifier}
      ./test-suite/test-new-version/pom.xml:  
com.google.protobuf:protoc:3.25.4:exe:${os.detected.classifier}
      ./test-suite/test-new-version/pom.xml:  
io.grpc:protoc-gen-grpc-java:1.55.1:exe:${os.detected.classifier}
      ./serializer/seata-serializer-protobuf/pom.xml:  
com.google.protobuf:protoc:3.25.4:exe:${os.detected.classifier}
      ./dependencies/pom.xml:  <protobuf.version>3.25.5</protobuf.version>
      ./dependencies/pom.xml:  <grpc.version>1.55.1</grpc.version>
      ./extensions/rpc/seata-grpc/pom.xml:  
com.google.protobuf:protoc:3.25.4:exe:${os.detected.classifier}
      ./extensions/rpc/seata-grpc/pom.xml:  
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.55.1:exe:${os.detected.classifier}</pluginArtifact>
      ```
   
       <img width="1448" height="146" alt="Image" 
src="https://github.com/user-attachments/assets/f2ec49dd-3826-4704-a666-818cc34b06d2";
 />
   
   4. `<protobuf.version>3.25.5</protobuf.version>` and 
`<grpc.version>1.55.1</grpc.version>` are defined in `./dependencies/pom.xml`, 
but there is no parent-child relationship between it and 
`./extensions/rpc/seata-grpc/pom.xml` (or other sub-modules), so 
`${protobuf.version}` and `${grpc.version}` cannot be resolved in the 
`seata-grpc` module and other sub-modules
   5. Attempting to downgrade the build with `mvn clean package 
-Dgrpc.version=1.54.2` still results in `${protobuf.version}` and 
`${grpc.version}` being unresolvable, with the error:
      ```
      Downloading from nexus-settings: 
.../io/grpc/protoc-gen-grpc-java/$%7Bgrpc.version%7D/protoc-gen-grpc-java-$%7Bgrpc.version%7D.pom
      ```
   
       <img width="1644" height="91" alt="Image" 
src="https://github.com/user-attachments/assets/e4030c80-4a75-4b00-9f94-b57a16f38c28";
 />
   
   **Root Cause:** The `<protobuf.version>` and `<grpc.version>` properties are 
defined in `./dependencies/pom.xml`, but this POM has no parent-child 
relationship with the `seata-grpc` module (their common parent is 
`org.apache.seata:seata-build`), so the properties cannot be inherited and used.
   
   
   ### Ⅴ. Anything else we need to know?
   
   _No response_
   
   ### Ⅵ. Environment
   
   - Seata client/server version: 2.8.0-SNAPSHOT
   - OS: Linux (LoongArch)
   


-- 
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