Closed bgrgicak closed 3 weeks ago
Hmm... I guess this was auto-closed as part of merging #1955.
🤔 I wonder why the WordPress Major/Minor builds were not always committing new builds very frequently until the last couple of months.
Hmm... I guess this was auto-closed as part of merging https://github.com/WordPress/wordpress-playground/pull/1955.
That's ok we don't need this PR.
🤔 I wonder why the WordPress Major/Minor builds were not always committing new builds very frequently until the last couple of months.
It's because of this API endpoint.
I assume that until now it only had one minor version listed under autoupdate
. When 6.6
started listing two patch versions (6.6.2
and 6.6.1
) the error started occurring.
What would happen is that build.js
would first build 6.6.2
as the last version and store it as 6.6
.
After that the last minus one would use 6.6.1
instead of 6.5
and rebuild 6.6
. This would lead to a loop where every run would rebuild 6.6
.
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.sqlite
This exploration was part of testing https://github.com/WordPress/wordpress-playground/pull/1955#issuecomment-2444303825