Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Fix for PropertiesFileTransformer breaks Reproducible builds in 8.1.1 #102

Merged
merged 6 commits into from
Jun 7, 2024

Conversation

agascon
Copy link

@agascon agascon commented Jun 7, 2024

Closes GradleUp#858.


Please have a look, added a test (which should fail with 8.1.1) and a fix on CleanProperties.

Removing the timestamp which default Properties class is adding could be tricky. I changed the previous mechanism to be bit more flexible (was not working either as some blank comment line is added now), but either way don't know if is a good approach. Please check

StripCommentsWithTimestampBufferedWriter(final Writer out) {
super(out);

lengthOfExpectedTimestamp = ("#" + new Date().toString()).length()
Copy link
Owner

Choose a reason for hiding this comment

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

This Date is related to your locale, how can we make sure the device locale is matched with the jar locale?

Copy link
Author

Choose a reason for hiding this comment

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

The idea of this is to just remove the comment lines which include the timestamp, which is generated when the properties file is written, so I assume locale is the same. Timestamp is not coming from other jar files. Either way I agree is a bit tricky.

Another option could be try to parse the date to see if it's a date or not, or maybe keep it simple and strip all comment lines.

Probably these changes are a mitigation as the real solution should come from the component writing the properties file, but anyway is more solid than the previous one which was removing only the first line.

Copy link
Owner

Choose a reason for hiding this comment

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

Timestamp is not coming from other jar files.

In this case, seems the fix is solid.

Another option could be try to parse the date to see if it's a date or not

In this case, seems we still have to determine the real locale is.

@Goooler Goooler merged commit 071a11c into Goooler:main Jun 7, 2024
1 check passed
@Goooler
Copy link
Owner

Goooler commented Jun 25, 2024

I've published this in https://github.com/Goooler/shadow/releases/tag/v8.1.8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants