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

Support for Termux #163

Open
ayoubelmhamdi opened this issue Mar 11, 2023 · 4 comments
Open

Support for Termux #163

ayoubelmhamdi opened this issue Mar 11, 2023 · 4 comments
Labels
enhancement New feature or request refactor Refactor portions of codebase
Milestone

Comments

@ayoubelmhamdi
Copy link

I am encountering issues when building crates in Termux, as rustup stable-aarch64-linux-android is not fully supported in this environment. I think it would be helpful if distant.nvim could add support for Termux, as this would enable users to easily use remote Rust development features from their Android devices.

Specifically, I have encountered issues.
   Compiling num_cpus v1.15.0
   Compiling termios v0.2.2
   Compiling serial-core v0.4.0
error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:116:15
    |
116 | pub use ::os::target::{cc_t,speed_t,tcflag_t}; // types
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:117:15
    |
117 | pub use ::os::target::{VEOF,VEOL,VERASE,VINTR,VKILL,VMIN,VQUIT,VSTART,VSTOP,VSUSP,VTIME}; // c_cc subscripts
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:118:15
    |
118 | pub use ::os::target::{BRKINT,ICRNL,IGNBRK,IGNCR,IGNPAR,INLCR,INPCK,ISTRIP,IXANY,IXOFF,IXON,PARMRK}; // input modes
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:119:15
    |
119 | pub use ::os::target::{OPOST,ONLCR,OCRNL,TAB3,ONOCR,ONLRET}; // output modes
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:120:15
    |
120 | pub use ::os::target::{B0,B50,B75,B110,B134,B150,B200,B300,B600,B1200,B1800,B2400,B4800,B9600,B19200,B38400}; // baud rate selection
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:121:15
    |
121 | pub use ::os::target::{CSIZE,CS5,CS6,CS7,CS8,CSTOPB,CREAD,PARENB,PARODD,HUPCL,CLOCAL}; // control modes
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:122:15
    |
122 | pub use ::os::target::{ECHO,ECHOE,ECHOK,ECHONL,ICANON,IEXTEN,ISIG,NOFLSH,TOSTOP}; // local modes
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:123:15
    |
123 | pub use ::os::target::{TCSANOW,TCSADRAIN,TCSAFLUSH}; // attribute selection
    |               ^^^^^^ could not find `target` in `os`

error[E0432]: unresolved import `os::target`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:124:15
    |
124 | pub use ::os::target::{TCIFLUSH,TCIOFLUSH,TCOFLUSH,TCIOFF,TCION,TCOOFF,TCOON}; // line control
    |               ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
 --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:9:55
  |
9 |     pub fn tcgetattr(fd: c_int, termios_p: *mut ::os::target::termios) -> c_int;
  |                                                       ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:10:82
   |
10 |     pub fn tcsetattr(fd: c_int, optional_actions: c_int, termios_p: *const ::os::target::termios) -> c_int;
   |                                                                                  ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:15:44
   |
15 |     pub fn cfmakeraw(termios_p: *mut ::os::target::termios);
   |                                            ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:16:48
   |
16 |     pub fn cfgetispeed(termios_p: *const ::os::target::termios) -> ::os::target::speed_t;
   |                                                ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:16:74
   |
16 |     pub fn cfgetispeed(termios_p: *const ::os::target::termios) -> ::os::target::speed_t;
   |                                                                          ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:17:48
   |
17 |     pub fn cfgetospeed(termios_p: *const ::os::target::termios) -> ::os::target::speed_t;
   |                                                ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:17:74
   |
17 |     pub fn cfgetospeed(termios_p: *const ::os::target::termios) -> ::os::target::speed_t;
   |                                                                          ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:18:46
   |
18 |     pub fn cfsetispeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int;
   |                                              ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:18:76
   |
18 |     pub fn cfsetispeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int;
   |                                                                            ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:19:46
   |
19 |     pub fn cfsetospeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int;
   |                                              ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:19:76
   |
19 |     pub fn cfsetospeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int;
   |                                                                            ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:20:45
   |
20 |     pub fn cfsetspeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int;
   |                                             ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/ffi.rs:20:75
   |
20 |     pub fn cfsetspeed(termios_p: *mut ::os::target::termios, speed: ::os::target::speed_t) -> c_int;
   |                                                                           ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:167:18
    |
167 |     inner: ::os::target::termios
    |                  ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:183:31
    |
183 |     fn inner(&self) -> &::os::target::termios {
    |                               ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:187:43
    |
187 |     fn inner_mut(&mut self) -> &mut ::os::target::termios {
    |                                           ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:193:25
    |
193 |     type Target = ::os::target::termios;
    |                         ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:195:31
    |
195 |     fn deref(&self) -> &::os::target::termios {
    |                               ^^^^^^ could not find `target` in `os`

error[E0433]: failed to resolve: could not find `target` in `os`
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/termios-0.2.2/src/lib.rs:201:43
    |
201 |     fn deref_mut(&mut self) -> &mut ::os::target::termios {
    |                                           ^^^^^^ could not find `target` in `os`

   Compiling grep-matcher v0.1.6
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `termios` due to 28 previous errors
warning: build failed, waiting for other jobs to finish...
^C  Building [=========>               ] 163/379: openssl-sys...
~ $ cargo install distant --target=

TERMUX

termux is an android app that emulates Linux functionality. It has a package manager (similar to Debian apt) and many applications. However, it does not have the distant binary in Termux.
Thank you for your consideration.
https://github.com/chipsenkbeil/distant.nvim/issues/83

@chipsenkbeil
Copy link
Owner

It looks like there errors stem from termios which is used by termwiz and portable-pty dependencies. There may be other compilation issues as well which aren't detected until we resolve these.

The termwiz and portable-pty dependencies are used to support remote shells. The fastest way to fix this would be to see if we can disable that functionality on the android platform for termux and see if compilation succeeds. If so, we can have a build with that feature disabled, which is possible now that we have a capabilities checklist as part of the API.

@ayoubelmhamdi
Copy link
Author

Thank you for the information and for looking into this issue. I understand that the errors with compiling distant in Termux may be related to the termios library used by the termwiz and portable-pty dependencies.

As you suggested, one possible solution would be to disable the remote shell functionality on the Android platform for Termux, which may help resolve the compilation issues. I think this would be a great idea, as it would enable Termux users to use distant and take advantage of its remote file editing features.

If you could provide a build of distant with the remote shell functionality disabled, that would be much appreciated by the Termux community. We are excited about the prospect of using distant on our Android devices, and we believe that this would greatly benefit our development workflows.

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented Mar 12, 2023

It looks like someone created and merged a package for you that compiles distant for termux: termux/termux-packages#15610.

I'll make a note of the changes required to get it to compile and incorporate those eventually, but seems like you're unblocked for now.

@ayoubelmhamdi
Copy link
Author

you make a great job @chipsenkbeil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Refactor portions of codebase
Projects
None yet
Development

No branches or pull requests

2 participants