Skip to content

Support modern Python versions #4783

@WhyNotHugo

Description

@WhyNotHugo
  • I have searched open and closed issues for duplicates

Bug Description

I'm trying to set up a development environment for Signal since I want to make some low-hanging UI improvements.

However, setting it up fails, since I need an ancient version of Python, <3.0.0. Python 3 is about a decade old, and currently, the oldest upstream supported Python is 3.5.

Python 2 has reached its EOL a long time ago and is unsupported.

Steps to Reproduce

  1. git clone https://github.com/signalapp/Signal-Desktop.git
  2. cd Signal-Desktop
  3. npm install --global yarn # (only if you don’t already have yarn)
  4. yarn install --frozen-lockfile # Install and build dependencies (this will take a while)

Actual Result:

yarn install v1.22.10
[1/6] Validating package.json...
[2/6] Resolving packages...
[3/6] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/6] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "prop-types@^15.0.0".
warning " > [email protected]" has unmet peer dependency "prop-types@^15.5.7".
warning " > [email protected]" has incorrect peer dependency "grunt@~0.4.5".
[5/6] Building fresh packages...
[1/37] ⠐ @journeyapps/sqlcipher
[2/37] ⠐ dtrace-provider
[3/37] ⠐ curve25519-n
[6/37] ⠐ sharp
error /home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher: Command failed.
Exit code: 1
Command: node-pre-gyp install --build-from-source
Arguments:
Directory: /home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info build requesting source compile
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "/usr/bin/python"
gyp ERR! find Python - version is "3.9.1"
gyp ERR! find Python - version is 3.9.1 - should be >=2.6.0 <3.0.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python 2.7.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/lib/find-python.js:303:47)
gyp ERR! stack     at PythonFinder.runChecks (/home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/lib/find-python.js:132:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/lib/find-python.js:175:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/lib/find-python.js:267:16)
gyp ERR! stack     at exithandler (child_process.js:302:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:314:5)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:456:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Linux 5.10.5-arch1-1
gyp ERR! command "/home/hugo/.cache/nvm/versions/node/v12.13.0/bin/node" "/home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/bin/node-gyp.js" "configure" "--build-from-source" "--module=/home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher/lib/binding/node-v72-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher/lib/binding/node-v72-linux-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/home/hugo/.cache/nvm/versions/node/v12.13.0/bin/node /home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/bin/node-gyp.js configure --build-from-source --module=/home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher/lib/binding/node-v72-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher/lib/binding/node-v72-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 5.10.5-arch1-1
node-pre-gyp ERR! command "/home/hugo/.cache/nvm/versions/node/v12.13.0/bin/node" "/home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher/node_modules/.bin/node-pre-gyp" "install" "--build-from-source"
node-pre-gyp ERR! cwd /home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher
node-pre-gyp ERR! node -v v12.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute '/home/hugo/.cache/nvm/versions/node/v12.13.0/bin/node /home/hugo/workspace/Forks/Signal-Desktop/node_modules/node-gyp/bin/node-gyp.js configure --build-from-source --module=/home/hugo/workspace/Forks/Signal-Desktop/node_modules/@journeyapps/sqlcipher/lib/binding/node-v72-linux-x64/node_sqlite3.node --module

Expected Result:

This should work without requiring unsupported tooling.
Note that, additionally, CONTRIBUTING.md does not mention this requirement at all, nor any suggestions on how to work around this (e.g.: for node, nvm is mentioned).

Platform Info

  • Signal Version: master
  • Operating System: ArchLinux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions