vi / websocat

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
MIT License
7.17k stars 278 forks source link

Build failure - smart-default / quote #29

Open h1z1 opened 5 years ago

h1z1 commented 5 years ago

Fully admit I don't know a lot of Rust so not sure what is wrong. From what I gather quote fails to compile? 45523d81b0e08bda277616d80fff3b85e46c9f5c tries to bump the minimum rust version but I didn't receive any such error.

   Compiling websocket v0.22.0
error[E0432]: unresolved import `quote::quote`
  --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:15:13
   |
15 | use quote::{quote, ToTokens};
   |             ^^^^^ no `quote` in the root

error: cannot find macro `parse_macro_input!` in this scope
  --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:64:17
   |
64 |     let input = parse_macro_input!(input as DeriveInput);
   |                 ^^^^^^^^^^^^^^^^^

error: cannot find macro `quote!` in this scope
  --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:82:14
   |
82 |             (quote! {
   |              ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:100:14
    |
100 |             (quote! {
    |              ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:108:8
    |
108 |     Ok(quote! {
    |        ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:182:13
    |
182 |         Ok((quote! {
    |             ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:168:31
    |
168 |         &syn::Fields::Unit => quote!{},
    |                               ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:132:24
    |
132 |                     Ok(quote! { #field_name : #default_value })
    |                        ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:134:17
    |
134 |                 quote!{
    |                 ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:155:17
    |
155 |                 quote! {
    |                 ^^^^^

error: aborting due to 10 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `smart-default`.
warning: build failed, waiting for other jobs to finish...
error: build failed
vi commented 5 years ago

Which Rust version do you use?

vi commented 5 years ago

Tried building 45523d81b0e08bda277616d80fff3b85e46c9f5c with rustc 1.34.0-nightly (f6fac4225 2019-02-03) on GNU/Linux and I don't see the error.

Also builds after cargo update. Also builds with rustc 1.31.1 (b6c32da9b 2018-12-18) and rustc 1.32.0 (9fda7c223 2019-01-16), and rustc 1.30.1 (1433507eb 2018-11-07), with or without cargo update.

h1z1 commented 5 years ago

@vi rustc 1.28.0 (9634041f0 2018-07-30)

vi commented 5 years ago

You should either update Rust or use Websocat version tagged as "last_version_that_supports_rust_1_28". Currently you'll probably only miss the --conncap option compared to Websocat from master. At the moment this tag should support all features present in master branch.

I noticed that README states 1.28 as a supported version. I updated this stale information.

h1z1 commented 5 years ago

Indeed. Was 45523d81b0e08bda277616d80fff3b85e46c9f5c meant to detect that?

vi commented 5 years ago

This commit makes Travis check against 1.30 instead of 1.28. Also update dependencies that stopped supporting 1.28.

I want websocat to be eventually included in Debian repository, and outdated dependencies are not a good idea there. Rust version in Debian Testing is currently 1.31, so there's no real reason to support earlier Rust versions.

h1z1 commented 5 years ago

so there's no real reason to support earlier Rust versions.

Except every other distro / install that doesn't run nor track debian releases. You're of course free to do as you wish, just noticed it didn't compile.

vi commented 5 years ago

Do you know any distros that are locked to older Rust versions? Debian is not a fast-paced distro and I expect it to have older Rust compared to a typical other distribution (except of Red Hat / CentOS world)

If there are specific examples of distributions that accept Rust-based packages into repositories and that are expected to still be containing Rust 1.28 half a year in future (for example), I may consider keeping a 1.28-compatible branch and backport fixes there if possible.

h1z1 commented 5 years ago

Coming from CentOS/RHEL, I wouldn't expect much in at least official repos if that is what you mean? There are community backed ones of course. Rust 1.31 is in EPEL. 1.29 isn't that old as far as api breaking deprecation goes but TBH I don't use Rust enough to care either way. Wrote a wrapper in bash.

vi commented 5 years ago

Websocat 1.2.0 should be OK for current CentOS/RHEL then (I can try to make a pre-built RPM in Github releases if needed).

But Websocat 1.3.0 would probably require later Rust version.