smengcl opened a new pull request, #11672: URL: https://github.com/apache/ozone/pull/11672
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? `dist-tar-stitching` creates `ozone-X.tar.gz` with plain `tar` and `gzip`, so the archive records metadata specific to the build: entry mtimes, permissions following the umask, owner and group names of the builder, and the mtime and file name in the gzip header. Entry order follows the directory listing order of the filesystem. As a result, the binary tarball differs between builds even when every file in it is identical. This PR makes the archive metadata deterministic: * When GNU tar is available (as in the Linux release build environment), create the archive with `--format=gnu --sort=name --mtime=<project.build.outputTimestamp> --owner=0 --group=0 --numeric-owner --mode=go+u,go-w`. Other tar implementations (e.g. bsdtar on macOS) keep creating a plain archive. * Compress with `gzip -n`. * Pass `project.build.outputTimestamp` to the script. Other gaps found while investigating are tracked in separate subtasks of HDDS-11056 (HDDS-17283 to HDDS-17286). ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17275 ## How was this patch tested? CI does not cover this, since the `repro` check compares only attached Maven artifacts (HDDS-17286 tracks adding a tarball check). Manually, using the dist directory from a local `-Pdist` build: copied it in two containers and ran the script on each copy. | Environment | GNU tar | User | umask | |---|---|---|---| | `rockylinux:9` | 1.34 | root | 022 | | `ubuntu:24.04` | 1.35 | uid 1000 | 077 | * With this patch, both tarballs are identical. All entries have owner 0/0 and mtime from `project.build.outputTimestamp`, permissions are normalized with executable bits kept, symlinks are preserved, and the gzip header has no timestamp or file name. * Without this patch, the two tarballs differ. Also checked that the effective POM passes the timestamp to the script, that the plain fallback still works on macOS, and that `shellcheck` reports no issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
