Make unsigned macOS deploy tool builds deterministic - #102
Merged
Conversation
Collaborator
Author
|
Please squash and merge after reviewing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There are two changes here:
The first is that now two macOS unsigned builds are deterministic (byte for byte equal). However, they can no longer be opened without ad-hoc or official signatures (which the build used to do). This was stripped, so that we could have GitHub Actions emit a deterministic hash to check against a local build to check for reproducibility. See discussion on what this means in my comments in the image below.

In addition to that change, the way GitHub Actions emits the hash is via hashing the macOS .app folder (see https://askubuntu.com/questions/1091335/create-checksum-sha256-of-all-files-and-directories for discussion on this). Essentially, it takes a hashes of all the files in the folder (recursively), and then takes a hash of the list of those hashes. After which, we can compare to a local build, make sure it matches, and then sign it. If we were to try to zip it beforehand and hash the zip, there would be nondeterministic metadata, which is why this was done the way it is, and it works quite well.
Relevant to issue #94