ActivityWatch / activitywatch

The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.
https://activitywatch.net/
Mozilla Public License 2.0
11.98k stars 544 forks source link

Debian: Unable to build from source using documented steps #900

Closed mryellow closed 1 year ago

mryellow commented 1 year ago

Describe the bug

      building '_cffi_backend' extension
      creating build/temp.linux-x86_64-cpython-37
      creating build/temp.linux-x86_64-cpython-37/c
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -flto -fuse-linker-plugin -ffat-lto-objects -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/home/user/opt/activitywatch/venv/include -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-x86_64-cpython-37/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                ^~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

      ----------------------------------------
  Command "/home/user/opt/activitywatch/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-y5ruy00l/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nn6ijr8z/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-tc2nuozt --compile --install-headers /home/user/opt/activitywatch/venv/include/site/python3.7/cffi" failed with error code 1 in /tmp/pip-install-y5ruy00l/cffi/

To Reproduce

Seems the issue is Poetry, but still makes ActivityWatch unusable.

This needs a clear and easy multi-platform installer before usable in environments where not every user is a power-user.

johan-bjareholt commented 1 year ago

Building from source is not intended for non-developers.

A quick google suggests this is what you need to do if ffi.h is missing on debian: sudo apt install libffi-dev

Asking for a multi-platform installer is like asking for a vehicle that can both drive on land, sail on seas and fly, it's so complex that you might as well just do one car, one boat and one plane separately and get a better result. Unfortunately we have not had the time to do fix installers for all platforms yet.

As I wrote in another bug report, the pre-built version should work if you upgrade your debian version. Sorry for being a bit quick on deprecating distributions (debian buster which you seem to be running is a bit old, but not that old and still supported by debian so IMO activitywatch should support that).

mryellow commented 1 year ago

AppImage can be easy for end-users when attempting to distribute software for Linux without submitting to distro repos.

johan-bjareholt commented 1 year ago

@mryellow Please see the following issue regarding AppImage

https://github.com/ActivityWatch/activitywatch/issues/10

johan-bjareholt commented 1 year ago

Oh, AppImage support is actually already finished. It's available to download on https://activitywatch.net/downloads/