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.73k stars 533 forks source link

Failed to compile from source due to error related to Plex and Feature keyword #837

Closed ljgonzalez1 closed 1 year ago

ljgonzalez1 commented 1 year ago

Describe the bug

Program failed to compile from source due to problems related with plex. Can't give too much detail as I don't know the language well enough.

As far as I know the problem is from rust or rust-related. It says #![feature(*) sould not be used in a stable release and then it fails to compile.

It is somewhat related to the issue #763, but there's not a lot of info in the issue and there was not a clear solution either.

To Reproduce

Steps to reproduce the behavior:

  1. Run git clone https://github.com/ActivityWatch/activitywatch.git --recursive
  2. Run cd ./activitywatch
  3. Not required, but I installed them for every version of python just in case.
    for python_version in "" .7 .8 .9; do
    for python_module in poetry pyinstaller; do
    "python3${python_version}" -m pip install $python_module
    # Trully not recommended
    # Sometimes it can really mess things up if it fails to install or break dependencies
    # Luckily it went well this time.
    sudo "python3${python_version}" -m pip install $python_module
  4. Checked for dependencies:
    ╭──luis at GL753VD in ~/git/activitywatch on master
    ╰─ echo "GIT:" && git --version;
    echo "\nMAKE:" && make --version;
    echo "\nPYTHON:" && python --version || python3 --version;
    echo "\nPOETRY:" && poetry --version;
    echo "\nNODE:" && node --version;
    echo "\nRUST:" && cargo --version;
    echo "\n7z:" && echo "$(7z)" | head -n 3 | tail -n 2
    
    GIT:
    git version 2.34.1

MAKE: GNU Make 4.3 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

PYTHON: Python 3.9.16

POETRY: Poetry (version 1.3.1)

NODE: v12.22.9

RUST: cargo 1.65.0 (4bc8f24d3 2022-10-20)

7z: 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 p7zip Version 16.02 (locale=es_CL.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (906E9),ASM,AES-NI)

4- Run `make build` to compile the program.
5- Brew a cup of coffee and wait a while.
6- Failed to compile. (Not so summed up) summary of the output
  6.1- Some checks and dependencies, I guess (everything ok).

if [ -e "aw-core/.git" ]; then \ echo "Submodules seem to already be initialized, continuing..."; \ else \ git submodule update --init --recursive; \ fi Submodules seem to already be initialized, continuing... pip install 'setuptools>49.1.1' Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: setuptools>49.1.1 in /usr/local/lib/python3.9/site-packages (58.1.0) make --directory=aw-core build make[1]: Entering directory '/home/luis/git/activitywatch/aw-core' poetry install Installing dependencies from lock file

«...»

Installing the current project: aw-watcher-window (0.2.0)

if macOS, build swift

if [ "Linux" = "Darwin" ]; then \ make build-swift; \ fi make[1]: Leaving directory '/home/luis/git/activitywatch/aw-watcher-window' make --directory=aw-server build SKIP_WEBUI= make[1]: Entering directory '/home/luis/git/activitywatch/aw-server' mkdir -p aw_server/static/ make --directory=aw-webui build DEV= make[2]: Entering directory '/home/luis/git/activitywatch/aw-server/aw-webui'

  6.2- Node reated stuff (everything ok).

npm ci npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

«...»

WARNING Compiled with 2 warnings 14:46:07

warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: js/3097.fd7a90af.js (414 KiB) js/chunk-vendors.906b2183.js (943 KiB) js/6604.55c4d043.js (269 KiB)

warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. Entrypoints: index (1.16 MiB) css/chunk-vendors.82a142ae.css js/chunk-vendors.906b2183.js css/index.442e69e5.css js/index.723cfbad.js

«...»

dist/css/3467.547af20e.css 0.06 KiB 0.08 KiB dist/css/9663.380cc15a.css 0.06 KiB 0.08 KiB dist/css/5953.cd69135e.css 0.04 KiB 0.06 KiB

Images and other types of assets omitted. Build at: 2023-01-09T17:46:07.251Z - Hash: 098d290603da17ed - Time: 51574ms

DONE Build complete. The dist directory is ready to be deployed. INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

  6.3- Poetry related stuff (everything ok)

make[2]: Leaving directory '/home/luis/git/activitywatch/aw-server/aw-webui' cp -r aw-webui/dist/* aw_server/static/

Needed for https://github.com/ActivityWatch/activitywatch/pull/274, works around https://github.com/pypa/pip/issues/6279

https://github.com/ActivityWatch/activitywatch/pull/367 Other solutions have been tried but did not actually work.

If you aren't sure windows long paths are working, don't remove this

rm -rf aw-webui/node_modules/.cache poetry install Installing dependencies from lock file

No dependencies to install or update

  6.4- Rust related stuff (it fails here)

Installing the current project: aw-server (0.12.0) make[1]: Leaving directory '/home/luis/git/activitywatch/aw-server' Looking for rust... /home/luis/.cargo/bin/cargo Rust found! make[1]: Entering directory '/home/luis/git/activitywatch/aw-server-rust' cargo build --release --bin aw-server Compiling version_check v0.9.4 Compiling libc v0.2.137 Compiling proc-macro2 v1.0.47 Compiling quote v1.0.21 Compiling unicode-ident v1.0.5 Compiling syn v1.0.103 Compiling autocfg v1.1.0 Compiling cfg-if v1.0.0 Compiling typenum v1.15.0 Compiling memchr v2.5.0 Compiling generic-array v0.14.6 Compiling serde_derive v1.0.147 Compiling serde v1.0.147 Compiling log v0.4.17 Compiling futures-core v0.3.25 Compiling getrandom v0.2.8 Compiling rand_core v0.6.4 Compiling ahash v0.7.6 Compiling slab v0.4.7 Compiling futures-channel v0.3.25 Compiling futures-task v0.3.25 Compiling tokio v1.21.2 Compiling futures-util v0.3.25

«...»

Compiling aw-transform v0.1.0 (/home/luis/git/activitywatch/aw-server-rust/aw-transform) Compiling uuid v1.2.1 Compiling plex v0.2.5 Compiling gethostname v0.4.0 error[E0554]: #![feature] may not be used on the stable release channel --> /home/luis/.cargo/registry/src/github.com-1ecc6299db9ec823/plex-0.2.5/src/lib.rs:2:12 | 2 | #![feature(proc_macro_diagnostic)] | ^^^^^^^^^^^^^^^^^^^^^

error[E0554]: #![feature] may not be used on the stable release channel --> /home/luis/.cargo/registry/src/github.com-1ecc6299db9ec823/plex-0.2.5/src/lib.rs:3:12 | 3 | #![feature(proc_macro_span)] | ^^^^^^^^^^^^^^^

For more information about this error, try rustc --explain E0554.

  6.5- Make exits

error: could not compile plex due to 2 previous errors warning: build failed, waiting for other jobs to finish... make[1]: [Makefile:19: aw-server] Error 101 make[1]: Leaving directory '/home/luis/git/activitywatch/aw-server-rust' make: [Makefile:36: build] Error 2



## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
I'd expect a "success compiling activitywatch" or equivalent.

<!-- ## Documentation -->
<!--
  If applicable, add screenshots or logs to help explain your problem.

  Logs can be found in different places depending on platform:
   - Windows: `C:\Users\<USER>\AppData\Local\ActivityWatch\Logs`
   - macOS: `/Users/<USER>/Library/Logs/activitywatch`
   - Linux: `/home/<USER>/.cache/activitywatch/log`
  They can be opened with any plain text editor.
-->

## Additional context
<!-- Add any other context about the problem here. -->
Hope I was detailed enough. Enything else you need let me know. Hope someone can help me.
Trust me, right now I have almost no idea about rust. I'd try to fix it if I knew how.

To whoever reads this, thank you in advance for your time and may be your assistance.
github-actions[bot] commented 1 year ago

Hi there! As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct. Thanks a bunch for opening your first issue! 🙏

ErikBjare commented 1 year ago

As the error and docs state, you cannot build aw-server-rust on Rust stable. You need Rust nightly: https://rust-lang.github.io/rustup/concepts/channels.html

On Mon, Jan 9, 2023, 19:03 github-actions[bot] @.***> wrote:

Hi there! As you're new to this repo, please make sure you've used an appropriate issue template https://github.com/ActivityWatch/activitywatch/issues/new/choose and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines https://github.com/ActivityWatch/activitywatch/blob/master/CONTRIBUTING.md and our code of conduct https://github.com/ActivityWatch/activitywatch/blob/master/CODE_OF_CONDUCT.md . Thanks a bunch for opening your first issue! 🙏

— Reply to this email directly, view it on GitHub https://github.com/ActivityWatch/activitywatch/issues/837#issuecomment-1376035590, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKXDOVCWNXXBFOANGEWJJ3WRRHIZANCNFSM6AAAAAATVW5NQY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ljgonzalez1 commented 1 year ago

Oh, you are right. Thank you very much, and sorry for that.


Leaving this mostly for other people who skip steps like me and encounter the same problem:

MAKE: GNU Make 4.3

PYTHON: Python 3.9.16

POETRY: Poetry (version 1.3.1)

NODE: v12.22.9

RUST: cargo 1.68.0-nightly (8c460b223 2023-01-04)

7z: p7zip Version 16.02 (locale=es_CL.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (906E9),ASM,AES-NI)


- Recompiled with `make build`.

  - 🎉 This time plex compiles 🥳.

«...» Compiling aw-transform v0.1.0 (/home/luis/git/activitywatch/aw-server-rust/aw-transform) Compiling fern v0.6.1 Compiling rocket_cors v0.6.0-alpha1 (https://github.com/lawliet89/rocket_cors?rev=54fae07#54fae070) Compiling plex v0.2.5 Compiling uuid v1.2.1 Compiling gethostname v0.4.0 «...»


- 
  - There were some problems importing the aw_server module due to not changing to the correct folder in the Makefile. It said:

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'aw_server'

  so I replaced the line 59 from `python -c "import aw_server; print(aw_server.__version__)"` to `python -c "import importlib; aw_server = importlib.import_module('aw-server.aw_server'); print(aw_server.__version__)"`

-
  - Failed again. 

Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/home/luis/git/activitywatch/aw-server/aw_server/init.py", line 8, in from .server import create_app File "/home/luis/git/activitywatch/aw-server/aw_server/server.py", line 8, in import aw_datastore ModuleNotFoundError: No module named 'aw_datastore'



-
  - A bit tired. I surrender... for now. I'll try to build later/ another day.
---

### The good thing is that the rust related problem was solved. So, thank you very much @ErikBjare 😄