Warning: linker on each command in Android 8.20210429
Recently (about 2 or 3 weeks ago) each 'git annex ' in Termux for Android throws multiple warnings. The exact warning message is this:
WARNING: linker: Warning: failed to find generated linker configuration from "/linkerconfig/ld.config.txt"
The amount of warnings depends on the command:
$ git annex --version
--> 2 warningsgit annex status
--> 3 warnings$ git annex sync origin
--> 80 warnings
The issue was already raised in the Termux matrix/discord, as i suspected it might by coming from Termux. They suspect it is a vendor specific problem, although one of them could also reproduce it via git-annex-install
on a pixel4a.
The warning stems from the function get_ld_config_file_path
in linker.cpp as part of the Android source code. I could not find any call to this in git-annex's source code, so it seems like it is called through some dependency.
As this issue greatly affects the usability of git-annex on Android, i would very much appreciate any work to solve this (if possible, i.e. if the issue is even caused by git-annex).
System description
- Samsung Galaxy S20 FE (SM-G780G) with latest Android (12) from Samsung
- Termux installed via F-Droid version 0.118.0
- git-annex version 8.20210429-g538780eba
- LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
I notice this warning is mentioned here: https://github.com/termux/proot-distro/blob/master/README.md
git-annex does use proot on android, that is necessary for some locking system calls to work, which Android for some reason blocks otherwise.
git-annex runs inside proot on android, so each time it (or the git bundled with it) is shipped, proot prints this warning.
I have the same issue.
@joey Does 'shipped' mean only upon git-annex installation on termux or each time I run a command? Because I do get this warning several times during runtime, each time I run a git annex command.
It helps to pinpoint the error to proot, but on their git they talk about this warning occurring only during installation, not several time during use.
I tried: 1. installing proot specifically in termux with
pkg install proot-distro
: -> installed two new packages, but warning still there 2. new git annex install on termux: -$ pkg up
-$ source git-annex-install
- saw the aforementioned linker warning once - when e.g. using$ git annex sync origin
the warning still shows upNext steps to try: 1. new termux install on android 2. try older termux version
Any other tips/ideas how to fix this?
Try nix-on-droid. It also uses proot (for everything actually) but Nix has an entirely different linking model to traditional distributions.
Just open
nix-shell -p git git-annex
or add those two to yourenvironment.packages
in~/.config/nixpkgs/nix-on-droid.nix
and thennix-on-droid switch
. (Usingnix-env
is also possible but I wouldn't recommend it.)@Atemu great tip! I had seen nix-on-droid and wondered about it.
I have added some instructions based on your comment to Android.
Looks like
git-annex webapp
does not work in nix-on-droid, because it cannot open a web page. Perhaps there is some way to do that; on termux git-annex uses xdg-open, but I tried it on nix-on-droid and it does not work. For now I documented nix-on-droid as an alternative for users who want to use git-annex at the command line.Thank you for the tip @Atemu. I will try that out.
In the meantime (and since termux-proot-distro-devs say the warning is harmless), I managed to filter out only the aforementioned "WARNING: linker:"... from the cli output:
$ git annex <command> 2> >(grep -v "WARNING: linker:" >&2)
or as an alias in shellrc
alias ga = 'git annex $1 2> >(grep -n "WARNING: linker:" >&2)'
proot
commands. But maybe that give some more inside.