"fdroid build --server" cannot find _fdroidserver_ files to copy into VM guest
The documentation suggests installing fdroidserver from a package repository. However, running the fdroid build
commands from the package produces the following error:
$ fdroid build org.fdroid.fdroid -l --server
...
ERROR: Could not build app org.fdroid.fdroid due to unknown error: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/fdroidserver/build.py", line 1143, in main
options.onserver, options.refresh):
File "/usr/lib/python3/dist-packages/fdroidserver/build.py", line 933, in trybuild
build_server(app, build, vcs, build_dir, output_dir, log_dir, force)
File "/usr/lib/python3/dist-packages/fdroidserver/build.py", line 120, in build_server
ftp.put(os.path.join(serverpath, '..', 'fdroid'), 'fdroid')
File "/usr/lib/python3/dist-packages/paramiko/sftp_client.py", line 668, in put
file_size = os.stat(localpath).st_size
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3/dist-packages/fdroidserver/../fdroid'
I'm not an Python expert, but looking at line 120 in this case seems to reveal the relative path dependency:
117:serverpath = os.path.abspath(os.path.dirname(__file__))
...
120:ftp.put(os.path.join(serverpath, '..', 'fdroid'), 'fdroid')
A quick glance seems to suggest this issue is also present in master still.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
$ dpkg -l | grep fdroid
ii fdroidserver 0.8-1~xenial all F-Droid build server and repository tools for Android
Edited by Hans-Christoph Steiner