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

android support #549

Closed
abrarishere opened this issue Aug 8, 2024 · 11 comments · Fixed by #953
Closed

android support #549

abrarishere opened this issue Aug 8, 2024 · 11 comments · Fixed by #953
Labels
node issues relating to the fact that basedpyright depends on nodejs (the nodejs-wheel pypi package)

Comments

@abrarishere
Copy link

When i tried to install basedpyright using

pip install basedpyright

It failed because it was unable to find cmake.

So I installed cmake and it downloaded

So, Please add following lines in documentation

> Before installing **basedpyright** make sure you have cmake installed.
@KotlinIsland
Copy link
Collaborator

Could you please add your full system+python details and installation output. Basedpyright should not require cmake

@DetachHead DetachHead added the awaiting response waiting for more info from the author - will eventually close if they don't respond label Aug 8, 2024
@abrarishere
Copy link
Author

System info:
Linux localhost 4.14.180-perf+ #2 SMP PREEMPT Sat Sep 3 23:17:03 CST 2022 aarch64 Android

Python info:
python -V
Python 3.11.9

I am using pip
pip install basedpyright

Error occurs in this process:

Building wheel for nodejs-wheel-binaries (pyproject.toml)

@DetachHead DetachHead added the node issues relating to the fact that basedpyright depends on nodejs (the nodejs-wheel pypi package) label Aug 9, 2024
@DetachHead DetachHead changed the title Installation requires cmake android support Aug 9, 2024
@DetachHead
Copy link
Owner

the issue is that nodejs-wheel (the package we use to automatically handle nodejs so that users don't have to) only bundles wheels for windows, macos and linux. but you're on android, so i would recommend raising an issue there to see if they're willing to publish wheels for android.

as a workaround, if you install nodejs manually, you can install the basedpyright npm package instead

@abrarishere
Copy link
Author

I installed basedpyright using Node.js as you suggested, but will it work with Neovim? When I try to install it using MasonInstall basedpyright, it attempts to use pip. Could you guide me through the process?

@DetachHead DetachHead removed the awaiting response waiting for more info from the author - will eventually close if they don't respond label Aug 10, 2024
@DetachHead
Copy link
Owner

hmm, it probably won't work with anything that expects the pypi package unfortunately.

perhaps we could also publish a nodeless release which would allow users on platforms other than windows/mac/linux to use a different node binary

@abrarishere
Copy link
Author

Ok, I am waiting for that.

@KotlinIsland
Copy link
Collaborator

@DetachHead how do we want to handle this issue? we can't do anything about nodejs-wheel here. do we want to close this issue and open "publish a nodeless release which would allow users on platforms other than windows/mac/linux to use a different node binary"?

@KotlinIsland KotlinIsland added the needs investigation awaiting verification by a maintainer that the issue is valid label Aug 15, 2024
@DetachHead
Copy link
Owner

there are other issues for supporting other OS's as well. i was just gonna leave them all open until we decide on a solution

@TTsdzb
Copy link

TTsdzb commented Dec 15, 2024

If you're using Termux I suggest manage your own language servers, instead of using mason.nvim. There are a couple of language servers couldn't be installed successfully in my experience. For example, some language servers do not provide arm64 binaries, even they can be found in official apt repositories and can be installed manually.

as a workaround, if you install nodejs manually, you can install the basedpyright npm package instead

You can install it through the following steps:

  1. Install basedpyright globally through npm:
npm i -g basedpyright

2. Soft link executables:

This step is not required after #953, please wait for npm package release

cd ~/../usr/bin
ln -s ../lib/node_modules/basedpyright/index.js basedpyright
ln -s ../lib/node_modules/basedpyright/langserver.index.js basedpyright-langserver

Then you'll have basedpyright and basedpyright-langserver directly in your PATH, and you're ready to go without that mason package.

@TTsdzb
Copy link

TTsdzb commented Dec 15, 2024

Then you'll have basedpyright and basedpyright-langserver directly in your PATH, and you're ready to go without that mason package.

If you're on Termux and the language server is installed but still can't be executed, check the header of the executable file:

nvim `which basedpyright`

You'll see the following line:

#!/usr/bin/env node

This will not work unless your Android distribution has /usr/bin/env inside. If so, change the line into:

#!/data/data/com.termux/files/usr/bin/env node

Then do the same thing for basedpyright-langserver.

@TTsdzb
Copy link

TTsdzb commented Dec 15, 2024

The Termux environment itself is way too different from a regular Linux system. If these looks too hacky, proot-distro can be used to create a normal Linux environment without root privilege.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node issues relating to the fact that basedpyright depends on nodejs (the nodejs-wheel pypi package)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants