Don't overwrite AppImage magic hex#112
Open
jkaczman wants to merge 1 commit into
Open
Conversation
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.
The deterministic AppImage Deploy Tool build created by the reproducible build release script has an incorrect header that does not conform to the AppImage Specification Type 2 image format. The magic hex needs to match what they've outlined in that specification (and discussed in the below GitHub issue).
The way we emit a deterministic AppImage is via a normal build, and then taking it apart and re-building it back together to be deterministic (introduced in e1c6921). However, when we were putting it back together, we were overwriting the magic hex that's meant to be in the header with the size of the runtime. Since libappimage is capable of knowing the size of the runtime without us explicitly saying so (as seen below), this is unnecessary and a bug. Removing the overwrite fixes the issue, and correctly maintains the proper magic hex.
(https://github.com/AppImage/AppImageKit/blob/master/src/runtime.c, https://github.com/AppImageCommunity/libappimage/blob/f8f106b42911aea53e3fa1618e9198b1bbd3bfc9/src/libappimage/utils/ElfFile.h#L16)
fixes #111