Test how build files change between rebuilds #1959
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't merge this.
This PR explores why are two builds of the same WordPress version different.
Different ZIPs
Each build will create files with newly created dates, so the ZIP content will be different. We can work around this by rewriting the time created to be the same for each build.
By default, ZIPs aren't deterministic because they contain metadata like time created.
ZIP files aren't deterministic because they contain metadata that can be different between builds. This can be avoided by not including metadata in the build.
Making ZIPs deteministic
We are able to make ZIP builds deterministic, by dropping extra metadata and making the date created on files the same.
Here is a working example of the code.
Example of two static asset zips generated from the same data.
Different SQLite files
Each WordPress build has different SQLite database files.
The difference is coming from different create/update dates in the database and password hashes.
Diff summary
Diff
Diff generated by
sqldiff 2/wp-content/database/.ht.sqlite 2/wp-content/database/.ht.sqliteThis exploration was part of testing #1955 (comment)