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
[WIP] Media versioning #265
Conversation
@@ -381,7 +382,7 @@ def structs(cls): | |||
dbg(lazymsg=lambda: "%s: exporting member %s<%s>" % (repr(cls), member_name, member_type), lvl=3) | |||
|
|||
if isinstance(member_type, MultisubtypeMember): | |||
for subtype_name, subtype_class in member_type.class_lookup.items(): | |||
for subtype_name, subtype_class in sorted(member_type.class_lookup.items()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to sort the items?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't sort the items, their order is undefined; in practice, it varies from run to run.
The iteration order translates to the order of the segments in the generated C++ code, which will be different with each run, triggering unneeded re-builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, thought I was still reading the hashing code, not the C++ struct exporting one! now it makes sense lol
This is kinda obsolete since the python interface was merged, I'll try updating some time and introduce mod pack config files. We have basic media file versioning now with |
To revive this, the format hashing should be ported to the current version again. |
This is now upstream btw, came in with e59f5c8. |
My attempt on versioning the media files. Introduces a data pack format (#86).
Basically, all converted and generated files will store some version (e.g. the gamedata specification hash). The engine can detect required/present discrepancies and trigger reconversion.
When this is merged, users won't have to reconvert everything for changes in one area only, but this will require #79 to be finished.
This implements and thus closes #204.
New features: