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

Investigate running Oasis on Android #240

Closed
georgeowell opened this issue Feb 19, 2020 · 9 comments · Fixed by #247
Closed

Investigate running Oasis on Android #240

georgeowell opened this issue Feb 19, 2020 · 9 comments · Fixed by #247
Labels
help wanted Extra attention is needed

Comments

@georgeowell
Copy link
Collaborator

Rômulo Alves has got Oasis working on Android! They posted about it on SSB. Christian posted one bug already #237

The install instructions:

  1. Install/open Termux
  2. Install node: pkg install nodejs
  3. Install libsodium: pkg install libsodium
  4. Install Oasis
  5. Run Oasis oasis --open

Termux packages nodejs version 13 by default which isn't a stable version which we support.

There's a few errors on install:

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-android-armv7.tar.gz
ERR! sharp Prebuilt libvips binaries are not yet available for android-armv7
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
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 - "python" is not in PATH or produced an error
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 checking if "python3" can be used
gyp ERR! find Python - "python3" 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.
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 (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271: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 3.10.49-g415000d
gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/sharp
gyp ERR! node -v v13.0.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

And a few errors on launch:

server error, from net:192.168.1.24:33772~shs:
Error: This socket has been ended by the other party
    at Socket.writeAfterFIN [as write] (net.js:442:14)
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/stream-to-pull-stream/index.js:63:30
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/pull-cat/index.js:35:13
    at callback (/data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/pull-pushable/index.js:84:5)
    at Object.push [as write] (/data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/pull-pushable/index.js:44:7)
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/secret-handshake/protocol.js:103:19
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/secret-stack/plugins/shs.js:54:17
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/ssb-invite/index.js:67:16
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/level-sublevel/shell.js:101:15
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/level-sublevel/nut.js:121:19

It seems to run fine in general though!
oasis-android-2020-02-19-124026

I can peer locally with my laptop running over the LAN. I can't currently see comments or replies or in fact any content from others including from my laptop. I wonder if that is some sort of firewall issue.

So basically I can post onto Scuttleverse but can't pull anything down from it. I can't seem to follow the account on my laptop either.

UI performance is very good!

@georgeowell georgeowell added the help wanted Extra attention is needed label Feb 19, 2020
@georgeowell
Copy link
Collaborator Author

I also got this error when trying to follow my laptop account:

server error, from net:192.168.1.24:34204~shs:
Error: stream ended with:64 but wanted:112
    at drain (/data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/pull-reader/index.js:43:26)
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/pull-reader/index.js:63:18
    at /data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/pull-reader/index.js:20:7
    at drain (/data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/stream-to-pull-stream/index.js:126:18)
    at Socket.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/@fraction/oasis/node_modules/stream-to-pull-stream/index.js:143:5)
    at Socket.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1198:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

@christianbundy
Copy link
Member

WOO. I'm excited to try this sometime later today.

Termux packages nodejs version 13 by default which isn't a stable version which we support.

Btw, we support the Node.js current and active releases, and Node 13 is "current" so we're good to go. 👍

I can't seem to follow the account on my laptop either.

I'm imagining going to the Settings to see the peers, selecting the peer, and hitting follow. What happens when you do that?

@christianbundy
Copy link
Member

christianbundy commented Feb 20, 2020

I'm bumping into: Level/leveldown#705

FWIW I've had to install a few other deps to circumvent errors in the build process. So far I have:

pkg install nodejs libsodium python git libtool make autoconf automake

@christianbundy
Copy link
Member

Also, I had to manually go through the steps in https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally which is a pain in the ass. Maybe we should have a copy-and-paste install script that handles this? I'm not sure.

@christianbundy
Copy link
Member

christianbundy commented Feb 20, 2020

GOT IT WORKING.

  1. I had to compile from source, which took 21 minutes and left me with a broken sodium-native (fixed with rm -rf node_modules/sodium-native).
  2. Looking in the settings doesn't show local peers that you don't follow (TODO: make an issue to fix this) so for each device I had to:
  • Go to my profile
  • Copy and paste the Markdown mention
  • Remove the Markdown bits to get the feed ID
  • Paste the feed ID into my Signal's Note To Self chat (with only myself)
  • Copy the ID on the other device and paste it into the search
  • Follow!
  1. Following my phone from my desktop was EZPZ because it only downloaded one message.
  2. Following my desktop from my phone is probably going to take Literally Forever while it indexes. This is sort of expected, but still sucks. It's not good that the HTTP requests just stall forever while we wait.

@christianbundy
Copy link
Member

There's lots of "cannot connect to server" errors and stuff that I think might actually be the server being so overwhelmed that it's not responding to new MuxRPC requests. Interesting. IIRC @staltz mentioned that this happens sometimes while indexing Manyverse, where the UI's connection with the server drops or becomes unresponsive. 🤷‍♂️

@christianbundy
Copy link
Member

The readme works though:

signal-attachment-2020-02-20-084616

Two design notes:

  • It would be cool if the <nav> and <section> margins weren't bumping up against the edges of the screen, even a tiny margin would be shweet.
  • We're using SSB-Markdown, which uses the unconventional "one newline creates a line break" that's only used by GitHub comments (not even readmes). Unfortunately this is screwing with the readme rendering and adding hard line breaks where there shouldn't be any.

@christianbundy
Copy link
Member

Quick note: we don't need Sharp, so I'd recommend npm install --no-optional to make sure we don't waste time on it. 🎉

@christianbundy
Copy link
Member

IT'S WORKING!!!!!!!!!!!!!!!!!!

signal-attachment-2020-02-20-123058

@christianbundy christianbundy linked a pull request Feb 20, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

Successfully merging a pull request may close this issue.

2 participants