termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.33k stars 3.06k forks source link

Can we add Unison and Duplicity? #129

Open gerroon opened 8 years ago

gerroon commented 8 years ago

Hi

It would be great if we have Unison and Duplicity in the repo. This will allow good backup options on Android.

elwint commented 1 year ago

@elwint

Note that outside the distro environment unison only works with the -ignorelocks flag for some reason.

Without the flag, what is the exit code? 159? Or anything else above 128 (indicating abnormal termination)? See my post above. I should add that for my use case -ignorelocks does not help.

Without the flag it throws a normal error that the archives are locked with exit code 3.

navid-zamani commented 1 year ago

Note that outside the distro environment unison only works with the -ignorelocks flag for some reason.

This is perfect solution. The last bit, we can start unison with the -ignorelocks flag, or we can add ignorelocks = true to prf file.

I remember that this was a bug due to misusage, that could be circumvented. But I can't remember where I got the answer anymore.
I’d rather not ignore locks, as the data is too important to mess up unison's reliability.

(I can also report it to work perfectly otherwise for everything else. If only Android would not limit itself to Windows file name reserved characters outside of Termux…)

elwint commented 1 year ago

Note that outside the distro environment unison only works with the -ignorelocks flag for some reason.

This is perfect solution. The last bit, we can start unison with the -ignorelocks flag, or we can add ignorelocks = true to prf file.

I remember that this was a bug due to misusage, that could be circumvented. But I can't remember where I got the answer anymore. I’d rather not ignore locks, as the data is too important to mess up unison's reliability.

(I can also report it to work perfectly otherwise for everything else. If only Android would not limit itself to Windows file name reserved characters outside of Termux…)

I found out the issue with strace, it seems that when it acquires a lock, it tries to create a hard link in the rename function. This is not allowed by Android SELinux policy, which is causing the error.

It looks like this function is only required on old NFS file systems where O_EXCL is broken.

I did some testing and it seems that locks are also ignored if you run unison within proot with --link2symlink because link2symlink breaks the hard link check (the rename function always returns true, even if the lock file already exists). (fixed in https://github.com/termux/proot/issues/284)

If you don't use <NFSv3, simply remove these lines (so that it uses the create function instead) in lock.ml before compiling the binary to safely use unison in Termux without the -ignorelocks flag outside proot.

maxmopp commented 8 months ago

After using locked version of unison-2.51.2 /ocaml 4.02.1 for a long time /Android, Linux) I compiled a working version of unison-2.53 /ocaml 4-5.1.0 for Android in termux.

ocaml 5.1.1

I went with https://www.reddit.com/r/termux/comments/xtfquk/can_we_install_ocaml_on_termux/ # pkg install build-essential # curl -LO https://github.com/ocaml/ocaml/archive/refs/tags/5.1.1.zip # mkdir ~/tmp && export TMPDIR=$HOME/tmp # unzip 5.1.1.zip # cd ocaml-5.1.1 .# /configure --prefix=$PREFIX # make # make install

unison 2.53.4

# curl -LO https://github.com/bcpierce00/unison/archive/v2.53.4.tar.gz # make

# src/unison -version
unison version 2.53.4 (ocaml 5.1.1)