Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JVM resources jar file to be deterministic by default (Cherry-pick of #16950) #17032

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

Eric-Arellano
Copy link
Contributor

At the moment, java or scala projects won't benefit much from the remote cache because the resources jar local process file will usually win the remote cache read. As zip is non-deterministic, which means that the resources jar file would invalidate any dependents in the graph.

Using reproducible_jars would solve that, but the price would be running the strip jar for all jars.

This PR solves this by changing the dates of all the files in the zip file before archiving.

[ci skip-rust]

…16950)

At the moment, java or scala projects won't benefit much from the remote cache because the resources jar local process file will usually win the remote cache read. As zip is non-deterministic, which means that the resources jar file would invalidate any dependents in the graph.

Using reproducible_jars would solve that, but the price would be running the strip jar for all jars.

This PR solves this by changing the dates of all the files in the zip file before archiving.

[ci skip-rust]
[ci skip-build-wheels]
@Eric-Arellano Eric-Arellano added the category:bugfix Bug fixes for released features label Sep 27, 2022
@Eric-Arellano
Copy link
Contributor Author

Not a clean cherry-pick, and this includes #17026

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@Eric-Arellano Eric-Arellano merged commit 841b1c3 into pantsbuild:2.13.x Sep 28, 2022
@Eric-Arellano Eric-Arellano deleted the cp-jar-determin-13 branch September 28, 2022 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants