runshell: Use system locales when built with GIT_ANNEX_PACKAGE_INSTALL set

This is to work around https://github.com/datalad/datalad/issues/2769
which I don't know how to reproduce outside that environment, nor do I
understand the root cause of. For some time, Neurodebian has been working
around it by building its standalone debs with a patch that disables use
of the locales bundled with the standalone build, letting the system
locales be used.

Using the system locales is asking for trouble if there's
significant version skew between the system and bundled glibc, and
possibly also if the architeciture is different, or whatever. That's why
git-annex bundles and uses its own locales, because numerous users
reported real problems with using the system locales.

... However, in the specific case of the Neurodebian standalone debs,
the deb is built on a system very like the one it's targeted to be
installed on. Or well, so they assure me, although doc/install/Ubuntu.mdwn
also promotes those for use across all versions of Ubuntu, and the deb
is built avoiding xz so it will work with old versions of dpkg, so I wonder
how true it is. It does seem that, at least currently, there is no bad
version skew in the locales of the systems the deb is used on, since
it's already been using the system locales for some time.

Anyway, since the Neurodebian build already is setting
GIT_ANNEX_PACKAGE_INSTALL=1 in runshell, I made runshell use system
locales when that's set. This is a small scope creep for
GIT_ANNEX_PACKAGE_INSTALL, but it's not documented and AFAIK only used
for the Neurodebian build, so that seems ok. This will let them stop
carrying their patch for this forward.

This work is supported by the NIH-funded NICEMAN (ReproNim TR&D3) project.
This commit is contained in:
Joey Hess 2018-10-13 15:04:02 -04:00
parent eff1750e9e
commit 42842ea0ea
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,8 @@ git-annex (6.20181012) UNRELEASED; urgency=medium
and with yesod < 1.4.3, and without concurrent-output, and with yesod < 1.4.3, and without concurrent-output,
which were onyl being used for the Android cross build. which were onyl being used for the Android cross build.
* Webapp: Fix termux detection. * Webapp: Fix termux detection.
* runshell: Use system locales when built with
GIT_ANNEX_PACKAGE_INSTALL set. (For Neurodebian packages.)
-- Joey Hess <id@joeyh.name> Sat, 13 Oct 2018 00:52:02 -0400 -- Joey Hess <id@joeyh.name> Sat, 13 Oct 2018 00:52:02 -0400

View file

@ -123,10 +123,11 @@ export MANPATH
unset LD_PRELOAD unset LD_PRELOAD
# Avoid using system locales, which may interact badly with bundled libc. # Avoid using system locales, which may interact badly with bundled libc.
# (But if LOCPATH is set, don't override it.) # (But if LOCPATH is set, don't override it, and if GIT_ANNEX_PACKAGE_INSTALL
# is set, use the system locales.)
ORIG_LOCPATH="$LOCPATH" ORIG_LOCPATH="$LOCPATH"
export ORIG_LOCPATH export ORIG_LOCPATH
if [ -z "${LOCPATH+set}" ]; then if [ -z "${LOCPATH+set}" ] && [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
LOCPATH="$HOME/.cache/git-annex/locales/$(echo "$base" | tr / _ )" LOCPATH="$HOME/.cache/git-annex/locales/$(echo "$base" | tr / _ )"
export LOCPATH export LOCPATH