hutiefang76 opened a new pull request, #12902:
URL: https://github.com/apache/seatunnel/pull/12902

   ### Purpose of this pull request
   
   Yes, contributing this fix to Apache SeaTunnel.
   
   Fixes #12897. Protobuf format schema compilation fails on native macOS ARM64 
because protoc-jar 3.11.4 has neither an embedded compiler nor a downloadable 
protoc 3.11.4 binary for that platform.
   
   Request protoc 3.25.3 only when running on macOS with `arm64` or `aarch64`. 
That release provides the native binary and matches the module's protobuf-java 
version. All other platforms retain the existing compiler selection and 
argument order; the POM and dependency versions are unchanged.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Native Apple Silicon JVMs can compile `protobuf_schema` instead of 
failing to locate the compiler. When the native binary is absent from 
protoc-jar's temporary cache, the first compilation needs access to Maven 
Central. A cleared temporary cache can require another download.
   
   EN/ZH documentation describes that requirement and the compiler-version 
difference: schemas shared with platforms using the older compiler must use 
syntax supported on those target platforms too. Public methods, descriptor 
cleanup and the nonzero-compiler-exit `PROTOBUF-01` error contract are 
preserved. Download failures can still propagate as I/O errors.
   
   ### How was this patch tested?
   
   * On unmodified `dev`, the existing `ProtobufConverterTest` failed on a 
native macOS ARM64 JDK 17 with the missing protoc 3.11.4 binary.
   * With the fix, all 22 Protobuf module tests passed on that host, with no 
failures, errors or skips. The tests executed the real native protoc 3.25.3 
binary. Existing tests are retained; new cases cover proto2 
required/optional/repeated descriptor semantics, exact proto3 wire bytes and 
round-trip values, and malformed-schema error behavior.
   * The same 22 tests passed in a fresh Linux x86_64 JDK 17 container with 
Maven offline and Docker networking disabled. Its logs confirm extraction and 
execution of the embedded protoc 3.11.4 binary. Only Maven dependencies were 
prewarmed; no protoc binary or temporary compiler cache was mounted into the 
container.
   * Root `./mvnw spotless:apply` and `./mvnw -q -DskipTests verify` passed.
   
   The affected module test command was:
   
   ```sh
   ./mvnw -B -pl seatunnel-formats/seatunnel-format-protobuf -am 
-Dtest=ProtobufConverterTest,SchemaRegistryAwareProtobufDeserializationSchemaTest
 -Dsurefire.failIfNoSpecifiedTests=false package
   ```
   
   The Linux control used `maven:3.9.9-eclipse-temurin-17` with `--platform 
linux/amd64 --network none` and `mvn -o`. Linux ARM64, macOS x86_64 and Windows 
were not executed locally; their compiler-selection branch is unchanged.
   
   AI assistance was used for implementation and review. The validation above 
was actually executed.
   
   ### Check list
   
   * [x] No new JAR dependency or checked-in binary package is added.
   * [x] EN/ZH Protobuf format documentation is updated.
   * [x] Existing compiler selection on other platforms is preserved.
   * [x] Existing format tests are extended; no connector registration changes 
are needed.
   


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

Reply via email to