Yaribz / SPADS

SpringRTS Perl Autohost for Dedicated Server
GNU General Public License v3.0
15 stars 13 forks source link

Override LC_ALL instead of LANG #57

Closed CommanderSpice closed 1 year ago

CommanderSpice commented 1 year ago

This fixes the 7za binary crashing on Gentoo (sys-libs/glibc-2.36-r5, not sure if relevant):

$ LANG=C ./7za-16.2
7za-16.2: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
fish: Job 1, 'LANG=C ./7za-16.2' terminated by signal SIGABRT (Abort)
$ LC_ALL=C ./7za-16.2
7-Zip (a) [32] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C,Utf16=off,HugeFiles=on,32 bits,16 CPUs x86)
[...]

Workaround options:

  1. Run SPADS with LC_ALL=C or another non-UTF-8 locale.
  2. Point the symlink for 7za to the system binary. SPADS should revert this when its 7za binary is updated: ln -sf -t src/ /usr/bin/7za.

The correct fix would be to update the distributed binary with one that can handle an UTF-8 locale.

Yaribz commented 1 year ago

Thanks ! (I don't want to add a requirement for SPADS so workaround 2. is not really an option, and unfortunately it's very hard to get a more up to date statically linked 7za 32-bit binary which is as much universally compatible as this one)