-
Notifications
You must be signed in to change notification settings - Fork 49
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
To enable reproducible builds AbstractArchiver#addFileSet
should add the files in order
#114
Comments
no need to sort entries, which would cost some CPU cycles |
Correct me if I'm wrong but the change in Common Compress keeps the
entries in the same order they are added. But what if we add a
directory? Is there any guarantee that the files will be iterated in any
particular order (added to the archive in any particular order)?
…On 16.8.2019 г. 22:46, Hervé Boutemy wrote:
no need to sort entries, which would cost some CPU cycles
Commons Compress has been updated to keep order of entries vs order of
addition: see https://issues.apache.org/jira/browse/COMPRESS-485
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#114?email_source=notifications&email_token=ADBOQ3INEGIHT6KDZB2RBDTQE372NA5CNFSM4HSOPKYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4PRDAA#issuecomment-522129792>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADBOQ3ML4VSCLX7TDKYSPF3QE372NANCNFSM4HSOPKYA>.
|
Yes, the change in Common Compress keeps the entries in the same order they are added.
then clearly, order in which files are iterated is not reproducible, as you guessed (but did not prove ;) ) |
@hboutemy, I can easily test on FreeBSD with Java 7, 8, 11, 12 if you tell me what to do. |
permits optional ordering of archive entries to enable reproducible builds
API added in plexus-archiver (using codehaus-plexus/plexus-io#18 and codehaus-plexus/plexus-utils#70 updates) |
@hboutemy great work! |
In order to enable reproducible builds,
Archiver
instances should add their entries in some predictable and reproducible way. To this endAbstractArchiver#addFileSet
should add the files in some order. Sorted alphabetically for example.As the current implementation does not guarantee any particular order we could just modify it to add the entries in alphabetical order, but we may add addition argument that indicates if the entries should be sorted. What do you think?
To implement this a change in
PlexusIoFileResourceCollection
is required as well. I've opened a ticket for it too - codehaus-plexus/plexus-io#18The text was updated successfully, but these errors were encountered: