XAMPPRocky / fluent-templates

Easily add Fluent to your Rust project.
Apache License 2.0
136 stars 28 forks source link

Sort the 'insert_resources' data to make static_loader! deterministic #56

Closed Aaron1011 closed 6 months ago

Aaron1011 commented 6 months ago

Currently, the TokenStream produced by the static_loader! macro depends on the default HashMap iteration order, as well as the filesystem directory iteration order.

To allow static_loader! to be compatible with a reproducible build, I've sorted the output of insert_resources before iterating over it. This ensures that the final TokenStream depends only on the loaded filenames and the file contents.

XAMPPRocky commented 6 months ago

Thank you for your PR!

torokati44 commented 6 months ago

It would be awesome if you could cut a 0.8.1 sometime soon with this in it!

XAMPPRocky commented 6 months ago

It'll be at least week before I can perform a release, as I'm currently going in for surgery so I'll have less bandwidth in the short term.

torokati44 commented 6 months ago

Oh, that's completely fine then, best of luck with the procedure! 🤞

torokati44 commented 6 months ago

Yay, thanks for v0.9.0! Is everything alright, stranger?

XAMPPRocky commented 6 months ago

Yes, all good :)