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

Can`t build from source! #84

Closed
tanqiangyes opened this issue Apr 19, 2024 · 3 comments
Closed

Can`t build from source! #84

tanqiangyes opened this issue Apr 19, 2024 · 3 comments

Comments

@tanqiangyes
Copy link

tanqiangyes commented Apr 19, 2024

step 1:
git clone https://github.com/ekzhang/sshx.git
step 2:
git checkout tags/v0.2.3 -b v0.2.3
dtep 3:
cargo install --path crates/sshx

will output error:

error[E0658]: use of unstable library feature 'proc_macro_byte_character'
  --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.81\src\wrapper.rs:871:21
   |
871 |                     proc_macro::Literal::byte_character(byte)
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #115268 <https://github.com/rust-lang/rust/issues/115268> for more information
   = help: add `#![feature(proc_macro_byte_character)]` to the crate attributes to enable
   = note: this compiler was built on 2024-04-01; consider upgrading it if it is out of date

error[E0658]: use of unstable library feature 'proc_macro_c_str_literals'
  --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\proc-macro2-1.0.81\src\wrapper.rs:898:21
   |
898 |                     proc_macro::Literal::c_string(string)
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #119750 <https://github.com/rust-lang/rust/issues/119750> for more information
   = help: add `#![feature(proc_macro_c_str_literals)]` to the crate attributes to enable
   = note: this compiler was built on 2024-04-01; consider upgrading it if it is out of date

  Compiling try-lock v0.2.5
For more information about this error, try `rustc --explain E0658`.
error: could not compile `proc-macro2` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sshx v0.2.3 (E:\work\sshx\crates\sshx)`, intermediate artifacts can be found at `E:\work\sshx\target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

if need, I can try to deal it.

@ekzhang
Copy link
Owner

ekzhang commented Apr 19, 2024

What's your rustc version? I googled this and found https://users.rust-lang.org/t/cannot-compile-simple-tokio-example/109956/5 as a potential solution.

@tanqiangyes
Copy link
Author

yes,I updated rust version to 79, use nightly, but there still other errors:

error[E0425]: cannot find function `sysconf` in crate `libc`
  --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\iterfds\fditer.rs:96:38
   |
96 |         let fdlimit = unsafe { libc::sysconf(libc::_SC_OPEN_MAX) };
   |                                      ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `_SC_OPEN_MAX` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\iterfds\fditer.rs:96:52
    |
96  |         let fdlimit = unsafe { libc::sysconf(libc::_SC_OPEN_MAX) };
    |                                                    ^^^^^^^^^^^^ help: a constant with a similar name exists: `FOPEN_MAX`
    |
   ::: C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libc-0.2.153\src\windows\mod.rs:119:1
    |
119 | pub const FOPEN_MAX: ::c_uint = 20;
    | ----------------------------- similarly named constant `FOPEN_MAX` defined here

error[E0425]: cannot find function `fcntl` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:128:20
    |
128 |     unsafe { libc::fcntl(fd, libc::F_GETFD) >= 0 }
    |                    ^^^^^ not found in `libc`

error[E0425]: cannot find value `F_GETFD` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:128:36
    |
128 |     unsafe { libc::fcntl(fd, libc::F_GETFD) >= 0 }
    |                                    ^^^^^^^ not found in `libc`

error[E0425]: cannot find function `fcntl` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:166:32
    |
166 |     let flags = unsafe { libc::fcntl(fd, libc::F_GETFD) };
    |                                ^^^^^ not found in `libc`

error[E0425]: cannot find value `F_GETFD` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:166:48
    |
166 |     let flags = unsafe { libc::fcntl(fd, libc::F_GETFD) };
    |                                                ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `FD_CLOEXEC` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:168:37
    |
168 |     if flags >= 0 && (flags & libc::FD_CLOEXEC) != libc::FD_CLOEXEC {
    |                                     ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `FD_CLOEXEC` in crate `libc`
    |
168 |     if flags >= 0 && (flags & libc::FD_CLOEXEC) != libc::FD_CLOEXEC {
    |                                                          ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `fcntl` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:171:19
    |
171 |             libc::fcntl(fd, libc::F_SETFD, flags | libc::FD_CLOEXEC);
    |                   ^^^^^ not found in `libc`

error[E0425]: cannot find value `F_SETFD` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:171:35
    |
171 |             libc::fcntl(fd, libc::F_SETFD, flags | libc::FD_CLOEXEC);
    |                                   ^^^^^^^ not found in `libc`

error[E0425]: cannot find value `FD_CLOEXEC` in crate `libc`
   --> C:\Users\admin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\close_fds-0.3.2\src\util.rs:171:58
    |
171 |             libc::fcntl(fd, libc::F_SETFD, flags | libc::FD_CLOEXEC);
    |                                                          ^^^^^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.

@ekzhang
Copy link
Owner

ekzhang commented Apr 23, 2024

Windows is not supported yet. You're welcome to help port it over. See existing issue for guidance.

@ekzhang ekzhang closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants