Commit graph

36 commits

Author SHA1 Message Date
Joey Hess
f2a54e3401
Android: Improve installation process when the user's login shell is not bash.
~/.profile works for bash, but not all other login shells.

This setting PATH is a minor convenience for users, particuarly since
typing on android is so much harder. The usual linux standalone bundle
just expects the user to know how to add it to PATH. I don't want this
code to grow special cases for every possible login shell. So displaying a
message to the presumably minority who don't use bash seems like the best
choice.

Longer term, I'd hope termux gets some way to set an environment variable
for all login shells. Systems using PAM can, via ~/.pam_environment. Or
alternatively, add a git-annex package to termux, even if just an installer
package. I'd rather spend time on either of those than on making this minor
thing support more login shells.

This commit was sponsored by mo on Patreon.
2019-05-23 13:06:31 -04:00
Joey Hess
42842ea0ea
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.
2018-10-13 15:04:10 -04:00
Joey Hess
d14983ee68
webapp: fix termux detection
The bundled uname -o says Linux in termux; have runshell on Android
delete it so the termux one is used instead.

This fixes the webapp so it will enter Android mode.

This commit was sponsored by mo on Patreon.
2018-10-13 12:08:27 -04:00
Joey Hess
0240775f32
adding arm64 build, and improved termux installation process
* Added arm64 Linux standalone build. (No autobuilder yet.)
* Improved termux installation process.

Added git-annex-install.sh script to avoid user needing to type as much in
termux. The scope of this script is limited; runshell handles the rest.

Runshell runs termux-fix-shebang on the shell scripts. The problem is
the bundled bin/sh script, deleting that script also works, but then the
others probably use the system Android /bin/sh, which could be old or
broken or not posix or whatever. Using termux sh to run the scripts is
better.

This commit was sponsored by Eric Drechsel on Patreon.
2018-10-11 13:32:00 -04:00
Joey Hess
a97ef366fa
Linux standalone: Avoid using bundled cp before envionment is fully set up.
On android arm64, I saw the cp fail with "Bad system call", because proot
has not run yet. runshell only recently started using cp, and it's bundled
with git-annex, so this fixes a reversion.

This commit was sponsored by Nick Piper on Patreon.
2018-10-10 16:02:25 -04:00
Joey Hess
142795993a
hide stderr if cmp is used on file that does not exist
seen on android in termux
2018-10-10 15:28:27 -04:00
Joey Hess
fa44bca8b3
linux standalone: When LOCPATH is already set, use it instead of the bundled locales.
It can be set to an empty string to use the system locales too. Of course
whether that will work depends on the amount of divergence.

This commit was supported by the NSF-funded DataLad project.
2018-08-20 12:20:54 -04:00
Joey Hess
a8a0f7fc58
refuse to run if we can't write to HOME 2018-07-10 14:20:23 -04:00
Joey Hess
eb08deefa5
Revert "fall back to /tmp for LOCPATH if HOME does not exist or not writable"
This reverts commit f991c8c526.

On second thought, this makes it unbearably slow and leaves far too much
cruft behind.
2018-07-10 14:15:47 -04:00
Joey Hess
f991c8c526
fall back to /tmp for LOCPATH if HOME does not exist or not writable
In this case, we can't clean up old locale caches, but presumably the
system has something to clean up /tmp eventually.
2018-07-10 13:26:35 -04:00
Joey Hess
e802323071
deal with the persistent locpath issue
linux standalone: Generate locale files in ~/.cache/git-annex/locales/ so
they're available even when the standalone tarball is installed in a
directory owned by root.

This avoids a full-on reference counting cleanup hell, by letting old
locale caches linger as long as the standalone bundle directory associated
with them is still around. Old ones get cleaned up.

In the case where the directory has a new bundle unpacked over top of it,
the old locale cache is invalidated and rebuilt. Of course, running
programs using that may get confused, but this was already the case, and
unpacking over top of a bundle is probably not a good idea anyhow.

To support that, added a buildid file, which only needs to be unique across
builds of git-annex with different libc versions. sha1sum of git-annex
seems good enough for that.

Removed debian/patches/standalone-no-LOCPATH as it's no longer
necessary.

This commit was supported by the NSF-funded DataLad project.
2018-07-10 12:13:19 -04:00
Joey Hess
71f450f677
use proot to support Android 8
runshell: Use proot when running on Android, to work around Android 8's
ill-advised seccomp filtering of system calls, including ones crucial for
reliable thread locking. (This will only work with termux's version of
proot.)

See https://github.com/termux/termux-packages/issues/420#issuecomment-386636938

This commit was sponsored by andrea rota.
2018-05-08 13:55:10 -04:00
Joey Hess
b2accf9da1
Assistant: Fix installation of menus, icons, etc when run from within runshell.
runshell followed by git annex webapp didn't install that stuff, because
GIT_ANNEX_APP_BASE is not set. Running git-annex.linux/git-annex-webapp did
install that stuff, since that script set the env var. I noticed this with
the termux port whose instructions currently go that way.

Seems the right thing to do is to move the env var setting to runshell.
2018-04-25 17:58:00 -04:00
Joey Hess
118ed8f92b
runshell: hacks for termux; add tip
Added some tweaks to make git-annex work in termux on Android. The regular
arm standalone tarball now works in termux.

I guess the test for "$base/bin/git" is not really necessary, since it
tests for git-annex. Since that gets deleted on android, removed that test.

These are pretty hackish hacks, especially adding it to PATH. The goal is
to make it work well enough out of the box on Android.

This commit was sponsored by Eric Drechsel on Patreon.
2018-04-25 13:48:37 -04:00
Joey Hess
dd7ab91f97
runshell: Unset LD_PRELOAD
Preloaded libraries from the host system may not get along with the bundled
linker.

This was observed by users in termux:

ERROR: ld.so: object '/data/data/com.termux/files/usr/lib/libtermux-exec.so' from LD_PRELOAD cannot be preloaded (wrong ELF class:
ELFCLASS64): ignored.
Bad system call

But it could also affect more usual systems; the preloaded library might rely
on symbols from the host libc that are not available or have the wrong versions
in the bundled libc. Unsetting LD_PRELOAD entirely seems safest.
2018-04-25 13:40:48 -04:00
Edward Betts
0750913136
correct spelling mistakes 2017-02-12 17:30:23 -04:00
Joey Hess
95c8b37544
Linux standalone: Improve generation of locale definition files, supporting locales such as, en_GB.UTF-8. 2016-12-19 17:03:52 -04:00
Joey Hess
aacd9b190d
Linux standalone: Include locale files in the bundle, and generate locale definition files for the locales in use when starting runshell.
Currently only done for utf-8 locales because the charset can easily be
told for those. Other locales don't include the charset in their name.

The locale definition is generated under git-annex.linux/locales.
So, this only works if the user can write there.

If locale generation fails for any reason, it's silently skipped.

The git-annex-standalone.deb installs the bundle under /usr, so this locale
generation won't work for non-root users.
2016-10-04 16:37:43 -04:00
Joey Hess
a93e38e8fc
add LOCPATH to GIT_ANNEX_STANDLONE_ENV 2016-10-04 15:32:58 -04:00
Joey Hess
c079811226
Linux standalone: Add back the LOCPATH=/dev/null hack to avoid the system locale-archive being read.
Version mismatches between the system locale-archive and the glibc in the
bundle have been observed to cause git crashes.

Unfortunately, this causes locales to not be used in the linux standalone
bundle, as was the case until version 6.20160419.

glibc hardcodes the path to /usr/lib/locale/locale-archive and does not
let an environment variable cause a different locale-archive file to be used.

The only other option to include locales in the bundle would be to include
exploded locale definition directories in the bundle for a number of
locales, generated by localedef. But these take at least 300 kb per locale,
and there are a great many locales; it would be hundreds of megabytes to
include them all.

(Hmm, we could include localdef in the bundle, and check LANG in runshell
and compile the locale directories on the fly. This would need
/usr/share/i18n/ and /usr/lib/locale-archive to be included in the bundle.
It's.. doable.)

I know this is going to once again cause users of the bundle to complain
that eg, ls doesn't show their unicode filenames right. Better than strange
crashes though.
2016-10-04 12:53:09 -04:00
Joey Hess
f947781fa0
Avoid setting LOCPATH in linux standalone builds now that ghc has been fixed to not hang when it cannot find locale files. 2016-04-20 12:40:11 -04:00
Joey Hess
398d93d4d2
Linux and OSX standalone builds put the bundled gpg last in PATH, so any system gpg will be preferred over it. 2016-02-19 16:19:19 -04:00
Joey Hess
d9d87fdbc9
Make the git-annex-standalone.deb prevent runshell from installing wrappers into $HOME/.ssh 2015-11-10 12:53:46 -04:00
Joey Hess
3e49f9fcab
runshell: Avoid failing when $HOME/.ssh does not exist and cannot be created. 2015-11-10 11:42:06 -04:00
Joey Hess
7133b68afe Linux standalone: Work around problem that prevented it from working properly if unpacked into a directory that contains ":" or ";" in its name. 2015-08-04 16:08:19 -04:00
Joey Hess
5e1f1bd252 Linux standalone, OSX app: Improve runshell script to always quote shell vars, so that it will work when eg, untarred into a directory path with spaces in its name. 2015-05-26 15:38:54 -04:00
Joey Hess
911335247c if ~/.ssh does not exist and cannot be created, avoid failing 2015-04-20 13:15:01 -04:00
Joey Hess
00b07d7155 Better fix for standalone tarball git-annex sync linker shim bug, that works for "git annex sync" as well as "git-annex sync". 2015-03-27 16:06:50 -04:00
Joey Hess
5be536e523 Fix bug introduced in the last release that broke git-annex sync when git-annex was installed from the standalone tarball.
This was introduced by commit 450ee53ab6

However, the same problem could affect other calls to programPath,
specifically some on the assistant. So, I fixed it at a deeper level.
2015-03-27 12:55:18 -04:00
Joey Hess
76cde095fe Linux standalone: Set LOCPATH=/dev/null to work around https://ghc.haskell.org/trac/ghc/ticket/7695
This prevents localization from working, but git-annex is not localized anyway.
2015-02-25 16:31:01 -04:00
Joey Hess
88fbb13ee3 Linux standalone: Improved process names of linker shimmed programs. 2015-02-16 19:36:26 -04:00
Joey Hess
5903d20d5e Support symlinking git-annex and git-annex-shell from the Linux standalone bundle into PATH.
Unless busybox doesn't support readlink -f, then it just uses readlink and
symlinking won't work. Also, OSX has no readlink -f so not done there.

Thanks, jlebar.
2014-05-16 16:22:56 -04:00
Joey Hess
eba3a28a28 webapp: Support using git-annex on a remote server, which was installed from the standalone tarball or OSX app, and so does not have git-annex in PATH (and may also not have git or rsync in PATH).
* webapp: Support using git-annex on a remote server, which was installed
  from the standalone tarball or OSX app, and so does not have
  git-annex in PATH (and may also not have git or rsync in PATH).
* standalone tarball, OSX app: Install a ~/.ssh/git-annex-wrapper, which
  can be used to run git-annex, git, rsync, etc.
2014-04-20 18:39:10 -04:00
Joey Hess
4124a27ec9 make wrappers run git-shell, now that it's included, rather than git shell 2013-12-27 16:36:48 -04:00
Joey Hess
307c57b29b add git-shell wrappers 2013-12-27 16:06:11 -04:00
Joey Hess
706c74aa98 Include git-receive-pack, git-upload-pack, and git wrappers in the Linux standalone build, and OSX app, so they will be available when it's added to PATH. 2013-12-24 16:28:10 -04:00