Add the Version element to a written MPC XPM file - #346
Open
douglas-carmichael wants to merge 1 commit into
Open
Add the Version element to a written MPC XPM file#346douglas-carmichael wants to merge 1 commit into
douglas-carmichael wants to merge 1 commit into
Conversation
The element was created and filled with the file version, but it was never appended to the document, so it did not end up in the file. It is the element by which the format is recognized: getProgramElement wants the root, a Version child and a Program child, therefore a written XPM was rejected when it was read back again. Analyzing: TestInst_C.xpm Could not read metadata: Unknown Root Append it, and write the platform next to the file version so that the 'Detected MPC keygroup version %1, written on %2.' log line is complete. The unchanged reader of the current release accepts the resulting file, which confirms that this is the element it was missing. The written XPM is otherwise unchanged and the samples are byte-identical.
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.
A written XPM cannot be read back by ConvertWithMoss itself:
MPCKeygroupCreator.createXmlDocumentcreates theVersionelement and fills in the file version, but it never appends it to the document, so it does not reach the file.MPCModernDetector.getProgramElementneeds the root, aVersionchild and aProgramchild, and reports "Unknown Root" for anything else - so every XPM written so far is rejected on the way back in.The fix
Append the element, and write the platform next to the file version so the log line
Detected MPC keygroup version %1, written on %2.has both of its values.Verification
The unchanged reader of the current
mainaccepts the file written by this branch:That is the part worth pointing at - the reader was not touched, so this confirms the
Versionelement is exactly what it was missing rather than a new requirement being introduced.The written XPM is otherwise unchanged: diffing the output of
mainagainst this branch shows only the four added lines, and the sample files are byte-identical.Not verified on a device. The element matches what hardware-written XPM files carry, and its absence was plainly an oversight rather than a deliberate omission, but I have no MPC here to load the result on.