samtay / so

A terminal interface for Stack Overflow
MIT License
1.35k stars 36 forks source link

Endeavouring to install `so` in Termux with `cargo` without success #49

Open b9Joker108 opened 1 day ago

b9Joker108 commented 1 day ago

Describe the bug I have endeavoured to install so in Termux with cargo, without success.

To Reproduce Steps to reproduce the behavior:

  1. cargo install so
  2. I checked appropriate environment variables are set:
❯ echo $JAVA_HOME
echo $PATH
/data/data/com.termux/files/usr/opt/openjdk-17
/data/data/com.termux/files/home/.local/bin:/data/data/com.termux/files/home/.local/share/basalt/source/pkg/bin:/data/data/com.termux/files/usr/share/texlive/bin/aarch64-linux:/data/data/com.termux/files/home/.local/bin/1password_cli_v2:/data/data/com.termux/files/home/.zi/polaris/sbin:/data/data/com.termux/files/home/.zi/polaris/bin:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/texlive:/data/data/com.termux/files/home/.cargo/bin:/data/data/com.termux/files/home/markdown.index:/data/data/com.termux/files/home/.dotfiles/scripts/sh.scripts:/data/data/com.termux/files/home/bin:/data/data/com.termux/files/home/browsh/:/data/data/com.termux/files/home/install/bin:/data/data/com.termux/files/usr/opt/openjdk-17/bin

I got the following error output:

...
Compiling enum-map-derive v0.17.0
   Compiling darling v0.13.4
   Compiling jni v0.19.0
error[E0425]: cannot find value `EXPECTED_JVM_FILENAME` in this scope
   --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jni-0.19.0/build.rs:102:25
    |
102 |         if file_name == EXPECTED_JVM_FILENAME {
    |                         ^^^^^^^^^^^^^^^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `jni` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `so v0.4.9`, intermediate artifacts can be found at `/data/data/com.termux/files/usr/tmp/cargo-install`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Environment

❯ termux-info
Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=12648
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.nyist.edu.cn/termux/apt/termux-main stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/21 termux extras
# sources.list.d/ivam3-termux-packages.list
deb [trusted=yes arch=all] https://ivam3.github.io/termux-packages stable extras
# x11-repo (sources.list.d/x11.list)
deb https://mirror.nyist.edu.cn/termux/apt/termux-x11 x11 main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# root-repo (sources.list.d/root.list)
deb https://mirror.nyist.edu.cn/termux/apt/termux-root root stable
# sources.list.d/rendiix.list
deb https://rendiix.github.io android-tools termux
Updatable packages:
All packages up to date
termux-tools version:
1.43.6
Android version:
14
Kernel build information:
Linux localhost 5.15.123-android13-8-28577532-abX910XXS4BXG5 #1 SMP PREEMPT Thu Jul 11 02:48:07 UTC 2024 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-X910
LD Variables:
LD_LIBRARY_PATH=:/data/data/com.termux/files/home/install/lib:/data/data/com.termux/files/home/install/lib:/data/data/com.termux/files/home/install/lib:/data/data/com.termux/files/home/install/lib:/data/data/com.termux/files/home/install/lib:/data/data/com.termux/files/home/install/lib
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.widget versionCode:13
com.termux.x11 versionCode:14
com.termux.api versionCode:51
com.termux.window versionCode:15
com.termux.styling versionCode:1000

Any assistance progressing and resolving issue, greatly appreciated.

samtay commented 2 hours ago

I have never built this on Android, but I imagine this is an issue with your environment. You'd probably have better luck opening an issue with the jni crate, or perhaps the webbrowser crate that is pulling it in.

If you'd like, I can feature gate the webbrowser dependency which is only used for opening a browser and navigating to the specific question/answer on stackexchange. Then you could e.g. cargo install so --no-default-features --features termion-backend and just not have the browser functionality.