Speech-Rule-Engine / speech-rule-engine

Generating speech descriptions for XML structures
https://zorkow.github.io/speech-rule-engine/
Apache License 2.0
75 stars 39 forks source link

Sre crash when it build in some locales #734

Open BlueCat0 opened 1 year ago

BlueCat0 commented 1 year ago

When I build sre from my laptop, it crash when load rule file. I checked it and found the action file load earlier than base file, which will cause crash here. https://github.com/Speech-Rule-Engine/speech-rule-engine/blob/cc46b71d739bc0104c36e8147e0d91a5acffa06d/ts/rule_engine/speech_rule_engine.ts#L820-L826

I found lib/mathmaps was createad by makefiles https://github.com/Speech-Rule-Engine/speech-rule-engine/blob/cc46b71d739bc0104c36e8147e0d91a5acffa06d/Makefile#L71-L86 it should be noticed that for in loop in bash not guarantee alphabetical order, it depends on locale.

in my case, when LANG was set to zh_CN.UTF-8, the merged json file order will cause crash.

"base/rules/clearspeak_base_actions.min"
"base/rules/clearspeak_base.min"

and when set LC_COLLATE to C, it will has same order with released file.

"base/rules/clearspeak_base.min"
"base/rules/clearspeak_base_actions.min"

add this env to makefile will help.

zorkow commented 1 year ago

Thanks for reporting this. I was not aware of the bash feature.