Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 3 tasks
ljgonzalez1 opened this issue Jan 9, 2023 · 3 comments
Closed
2 of 3 tasks

Comments

@ljgonzalez1
Copy link

  • I am on the latest ActivityWatch version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
    • I have searched the issues of this repo-
    • believe that this is not a duplicate.
  • OS name and version: KDE Neon. An Ubuntu 22.04 based distro.
    • More info:
  ╭──luis at GL753VD in ~/git/activitywatch on master
  ╰─ neofetch
             `..---+/---..`                luis@GL753VD 
         `---.``   ``   `.---.`            ------------ 
      .--.`        ``        `-:-.         OS: KDE neon 5.26 x86_64 
    `:/:     `.----//----.`     :/-        Host: GL753VD 1.0 
   .:.    `---`          `--.`    .:`      Kernel: 5.15.0-56-generic 
  .:`   `--`                .:-    `:.     Uptime: 2 hours, 39 mins 
 `/    `:.      `.-::-.`      -:`   `/`    Packages: 4769 (dpkg), 20 (flatpak), 4 (snap) 
 /.    /.     `:++++++++:`     .:    .:    Shell: zsh 5.8.1 
`/    .:     `+++++++++++/      /`   `+`   Resolution: 1368x768, 1920x1080 
/+`   --     .++++++++++++`     :.   .+:   DE: Plasma 5.26.4 
`/    .:     `+++++++++++/      /`   `+`   WM: KWin 
 /`    /.     `:++++++++:`     .:    .:    WM Theme: Glass-Kv-ver5 
 ./    `:.      `.:::-.`      -:`   `/`    Theme: [Plasma], Breeze [GTK2/3] 
  .:`   `--`                .:-    `:.     Icons: Imagination-Breeze-Dark [Plasma], Imagination-Breeze-Dark [GTK2/3] 
   .:.    `---`          `--.`    .:`      Terminal: yakuake 
    `:/:     `.----//----.`     :/-        CPU: Intel i7-7700HQ (8) @ 3.800GHz 
      .-:.`        ``        `-:-.         GPU: NVIDIA GeForce GTX 1050 Mobile 
         `---.``   ``   `.---.`            GPU: Intel HD Graphics 630 
             `..---+/---..`                Memory: 5172MiB / 15885MiB 
  • ActivityWatch version: Latest commit on master branch in github (09/01/2023 14:10 GMT-3)

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
  1. 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

I'd expect a "success compiling activitywatch" or equivalent.

Additional context

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
Copy link

github-actions bot commented Jan 9, 2023

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
Copy link
Member

ErikBjare commented Jan 9, 2023 via email

@ljgonzalez1
Copy link
Author

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:

  • Just ran this to change to rust nightly:
rustup toolchain install nightly && \
rustup run nightly rustc --version && \
rustup default nightly  && \
rustup update
  • Checked dependecies (now rust shows as nightly):
echo "GIT:" && git --version;
echo "\nMAKE:" && make --version | head -n 1;
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 1
GIT:
git version 2.34.1

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 "<string>", line 1, in <module>
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 "<string>", line 1, in <module>
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/luis/git/activitywatch/aw-server/aw_server/__init__.py", line 8, in <module>
    from .server import create_app
  File "/home/luis/git/activitywatch/aw-server/aw_server/server.py", line 8, in <module>
    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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants