Skip to content

Unpack the gradle distributions without restoring timestamps from the archive in an attempt to fix #210#369

Closed
cobexer wants to merge 1 commit intomasterfrom
cobexer/updates
Closed

Unpack the gradle distributions without restoring timestamps from the archive in an attempt to fix #210#369
cobexer wants to merge 1 commit intomasterfrom
cobexer/updates

Conversation

@cobexer
Copy link
Copy Markdown
Member

@cobexer cobexer commented Nov 6, 2025

@cobexer cobexer requested review from a team as code owners November 6, 2025 14:28
@cobexer cobexer self-assigned this Nov 6, 2025
… archive

Fixes #210

The timestamp in the archive may be far in the past (reproducible archives - https://docs.gradle.org/9.2.0/userguide/working_with_files.html#sec:reproducible_archives)
and may cause problems in situations where 32bit applications interact with the filesystem.
As the timestampp is entirely irrelevant, resetting it to the uncompress time avoids the problem.

Signed-off-by: Christoph Obexer <cobexer@gradle.com>
@cobexer cobexer changed the title cobexer/updates Improve consistency and platform support Nov 6, 2025
\
&& echo "Installing Gradle" \
&& unzip gradle.zip \
&& unzip -DD gradle.zip \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment thread jdk17-noble/Dockerfile
\
&& echo "Installing Gradle" \
&& unzip gradle.zip \
&& unzip -DD gradle.zip \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ This doesn't fix #210 for me when doing docker build --platform linux/arm/v7 . on this Dockerfile. It's generally not about the timestamp, but about the inode returned by the underlying fs, so I don't think this will do much. The timestamps should still be within 32-bit range.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can reproduce this failure as well. That means that the other side effect of the touch of /opt/gradle/lib/ is also/more relevant: the inode being copied up into the upper layer of the overlayfs.

I don't think it would make sense to trigger that on purpose.

@cobexer
Copy link
Copy Markdown
Member Author

cobexer commented Nov 14, 2025

Moved unrelated changes to #372

@cobexer cobexer marked this pull request as draft November 14, 2025 15:51
@cobexer cobexer changed the title Improve consistency and platform support Unpack the gradle distributions without restoring timestamps from the archive in an attempt to fix #210 Nov 17, 2025
@cobexer
Copy link
Copy Markdown
Member Author

cobexer commented Nov 17, 2025

Since the problem can still be reproduced with "normal" timestamps we conclude that the source of the issue is the directory inode number, and working around that is not something we want to do.

Instead, JDKs should resolve that issue.

@cobexer cobexer closed this Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running Gradle emulated for arm32 on an arm64 host fails with Cannot locate JAR for module 'ant' on old Java versions (<23)

4 participants