Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated XML is non-deterministic due to sharedstrings #103

Closed
NobleDraconian opened this issue May 11, 2020 · 2 comments · Fixed by #190
Closed

Generated XML is non-deterministic due to sharedstrings #103

NobleDraconian opened this issue May 11, 2020 · 2 comments · Fixed by #190
Labels
good first issue Good for newcomers module: rbx_xml type: bug Something isn't working

Comments

@NobleDraconian
Copy link

NobleDraconian commented May 11, 2020

Currently, any XML generated with rbx-dom is non-deterministic due to sharedstrings being changed every time, even if no asset/code files have been changed. This makes things like checksum verification impossible.

Reproduction steps:

  1. Build a rojo project into a.rbxlx
  2. Rebuild the rojo project again, this time into b.rbxlx
  3. Run a diff to compare the files. Notice how the sharedstrings have changed even though no source/asset files were changed.

image

@ghost
Copy link

ghost commented Jun 26, 2021

This is definitely still an issue and I ran into it myself when trying to make an export script for remodel.
I'm not able to export all assets and simply commit ones with changes, because sharedstrings end up changing their order randomly.

This removes the viability of using remodel to easily export all assets through one command and diff them, instead artists would have to go through with manually exporting their assets into a directory, remembering which assets were changed and which not, etc...

Way easier to have everything export into the filesystem and then commit what you see is different.

@LPGhatguy
Copy link
Contributor

The binary format doesn't have this issue, and diffs within the XML are usually not readable. I recommend using the binary format if you can.

Should be an easy fix, just needs to happen. We should change the HashMap we use for the shared string dictionary to a BTreeMap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers module: rbx_xml type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants