gdesrosiers1805 opened a new pull request, #1674:
URL: https://github.com/apache/daffodil/pull/1674

   The gzip layer previously used GZIPOutputStream with the JDK's default 
compression level (6), which produces byte-different output across JVMs linked 
against different zlib implementations. Specifically, Fedora's OpenJDK links 
against zlib-ng while Temurin and most other distributions bundle stock zlib. 
Both produce valid compressed gzip but the deflate token streams differ due to 
different match-finding heuristics, causing test failures on Fedora42.
   
   Changes:
   
   - Add `compressionLevel` DFDL variable to the gzip layer schema, defaulting 
to Deflater.DEFAULT_COMPRESSION (-1). Schemas can opt into a specific level via 
`dfdl:newVariableInstance`.
   
   - Add ConfigurableGZIPOutputStream, a GZIPOutputStream subclass that allows 
the compression level to be set via constructor argument.
   
   - Update GZipLayer to accept the compressionLevel variable via 
setLayerVariableParameters and use it when constructing the output stream.
   
   - Add `-parameters` to javac options. This preserves Java parameter names in 
bytecode, which is required by Daffodil's reflection-based layer parameter 
resolution. Without this, Java setters appear with parameters named 
arg0/arg1/... and cannot be matched to schema variables.
   
   - Update test schemas (exampleGzipLayer.dfdl.xsd, 
exampleGzipLayer2.dfdl.xsd) to set compressionLevel=9, ensuring byte-stable 
output for tests with hardcoded baseline data.
   
   - Update TestGzipErrors.makeGZIPData to generate test input data using level 
9 for byte stability across JVMs.
   
   At higher compression levels (especially 9), stock zlib and zlib-ng tend to 
converge on identical output.
   
   DAFFODIL-3082


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