veeso / termscp

🖥 A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB
https://termscp.veeso.dev
MIT License
1.55k stars 46 forks source link

[BUG] - FreeBSD Support Broken #138

Closed sakhmatd closed 1 year ago

sakhmatd commented 1 year ago

Description

Compiling the package on FreeBSD from cargo currently fails due to broken support in keyring-rs (see hwchen/keyring-rs#36). In addition, using the installer as listed in the readme for the project also fails.

Steps to reproduce

Attempt to install termscp using the installer with curl --proto '=https' --tlsv1.2 -sSLf "https://git.io/JBhDb" | sh.

Once that fails, attempt to install from cargo directly using: cargo install --locked termscp

Removing the --locked flag does not help.

Expected behaviour

Normal installation should occur.

Environment

Log

Attempting to use the installer using curl --proto '=https' --tlsv1.2 -sSLf "https://git.io/JBhDb" | sh fails with this:

sh: !: not found

Attempting to install termscp with cargo using cargo install --locked termscp fails with this:

error[E0583]: file not found for module `platform`
  --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/lib.rs:79:1
   |
79 | mod platform;
   | ^^^^^^^^^^^^^
   |
   = help: to create the module `platform`, create file "/.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/platform.rs" or "/.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/platform/mod.rs"
error[E0412]: cannot find type `Error` in module `crate::platform`
  --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/error.rs:15:38
   |
15 |     PlatformFailure(crate::platform::Error),
   |                                      ^^^^^ not found in `crate::platform`
   |
help: consider importing one of these items
   |
7  | use core::error::Error;
   |
7  | use core::fmt::Error;
   |
7  | use crate::Error;
   |
7  | use std::error::Error;
   |
     and 2 other candidates
help: if you import `Error`, refer to it directly
   |
15 -     PlatformFailure(crate::platform::Error),
15 +     PlatformFailure(Error),
   |
error[E0412]: cannot find type `Error` in module `crate::platform`
  --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/error.rs:21:38
   |
21 |     NoStorageAccess(crate::platform::Error),
   |                                      ^^^^^ not found in `crate::platform`
   |
help: consider importing one of these items
   |
7  | use core::error::Error;
   |
7  | use core::fmt::Error;
   |
7  | use crate::Error;
   |
7  | use std::error::Error;
   |
     and 2 other candidates
help: if you import `Error`, refer to it directly
   |
21 -     NoStorageAccess(crate::platform::Error),
21 +     NoStorageAccess(Error),
   |
error[E0425]: cannot find function `platform` in module `platform`
  --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/lib.rs:71:15
   |
71 |     platform::platform()
   |               ^^^^^^^^ not found in `platform`
error[E0425]: cannot find function `set_password` in module `platform`
   --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/lib.rs:140:19
    |
140 |         platform::set_password(&self.target, password)
    |                   ^^^^^^^^^^^^ not found in `platform`
error[E0425]: cannot find function `get_password` in module `platform`
   --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/lib.rs:148:19
    |
148 |         platform::get_password(&mut map)
    |                   ^^^^^^^^^^^^ not found in `platform`
error[E0425]: cannot find function `get_password` in module `platform`
   --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/lib.rs:158:34
    |
158 |         let password = platform::get_password(&mut map)?;
    |                                  ^^^^^^^^^^^^ not found in `platform`
error[E0425]: cannot find function `delete_password` in module `platform`
   --> /.cargo/registry/src/github.com-1ecc6299db9ec823/keyring-1.2.0/src/lib.rs:166:19
    |
166 |         platform::delete_password(&self.target)
    |                   ^^^^^^^^^^^^^^^ not found in `platform`
Some errors have detailed explanations: E0412, E0425, E0583.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `keyring` due to 8 previous errors

Additional information

I am not sure if keyring-rs can be avoided until patched on FreeBSD or if this issue is currently purely on keyring-rs, but perhaps the installer could be fixed.

veeso commented 1 year ago

I need to fix the install script then, but build should work with

cargo install --locked --no-default-features termscp
sakhmatd commented 1 year ago

It does build and seems to work fine with those flags specified. Thanks!

Let me know if you want me to test the install script.

veeso commented 1 year ago

Thanks, I should've fixed the script. Could you try please?

sakhmatd commented 1 year ago

Thanks! There was an additional issue with the script. I have submitted a pull request to fix that and add support for doas for good measure.