Misterio77 / flavours

🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
MIT License
501 stars 29 forks source link

Can't install via cargo #37

Closed dive-deeper closed 2 years ago

dive-deeper commented 2 years ago

Since I don't have Arch or Nix I wanted to install simply using cargo install flavours. However it runs into compilation errors (see output below). Specifying a version didn't work either (e.g. cargo install flavours --version 0.5.0, etc.). I pinned down the problem to the clap and clap_generate packages but couldn't solve it anyway. It downloads and compiles the version 3.0.0-beta.4 although you specify 3.0.0-beta.2 in the Cargo.toml. I am just a Rust beginner, so it might be an easy to correct error,

I looked into the pkgbuild for Arch and was able to install it using those commands in Ubuntu.

Here's the output of cargo install (trimmed for visibility):

   Compiling flavours v0.5.0
error[E0599]: no variant or associated item named `GlobalVersion` found for enum `AppSettings` in the current scope
 --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:8:31
  |
8 |         .setting(AppSettings::GlobalVersion)
  |                               ^^^^^^^^^^^^^ variant or associated item not found in `AppSettings`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
  --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:52:39
   |
52 |                 .setting(AppSettings::DisableVersion)
   |                                       ^^^^^^^^^^^^^^
   |                                       |
   |                                       variant or associated item not found in `AppSettings`
   |                                       help: there is a variant with a similar name: `DisableVersionFlag`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
  --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:61:39
   |
61 |                 .setting(AppSettings::DisableVersion)
   |                                       ^^^^^^^^^^^^^^
   |                                       |
   |                                       variant or associated item not found in `AppSettings`
   |                                       help: there is a variant with a similar name: `DisableVersionFlag`

error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
  --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:68:22
   |
68 |                     .multiple(true)
   |                      ^^^^^^^^ method not found in `Arg<'_>`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
  --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:83:39
   |
83 |                 .setting(AppSettings::DisableVersion)
   |                                       ^^^^^^^^^^^^^^
   |                                       |
   |                                       variant or associated item not found in `AppSettings`
   |                                       help: there is a variant with a similar name: `DisableVersionFlag`

error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
  --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:90:22
   |
90 |                     .multiple(true)
   |                      ^^^^^^^^ method not found in `Arg<'_>`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
   --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:105:39
    |
105 |                 .setting(AppSettings::DisableVersion)
    |                                       ^^^^^^^^^^^^^^
    |                                       |
    |                                       variant or associated item not found in `AppSettings`
    |                                       help: there is a variant with a similar name: `DisableVersionFlag`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
   --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:159:39
    |
159 |                 .setting(AppSettings::DisableVersion)
    |                                       ^^^^^^^^^^^^^^
    |                                       |
    |                                       variant or associated item not found in `AppSettings`
    |                                       help: there is a variant with a similar name: `DisableVersionFlag`

error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
   --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:166:22
    |
166 |                     .multiple(true)
    |                      ^^^^^^^^ method not found in `Arg<'_>`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
   --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:186:39
    |
186 |                 .setting(AppSettings::DisableVersion)
    |                                       ^^^^^^^^^^^^^^
    |                                       |
    |                                       variant or associated item not found in `AppSettings`
    |                                       help: there is a variant with a similar name: `DisableVersionFlag`

error[E0599]: no variant or associated item named `DisableVersion` found for enum `AppSettings` in the current scope
   --> /home/<user>/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.0/src/cli.rs:201:39
    |
201 |                 .setting(AppSettings::DisableVersion)
    |                                       ^^^^^^^^^^^^^^
    |                                       |
    |                                       variant or associated item not found in `AppSettings`
    |                                       help: there is a variant with a similar name: `DisableVersionFlag`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `flavours` due to 11 previous errors

Just wanted to give a heads-up. Thanks for your effort developing this package! Cheers.

Misterio77 commented 2 years ago

Thanks for the report, i just reproduced this right now. I have a couple changes waiting to be released, so i'll go ahead and bump the version so this (hopefully) gets fixed.

Misterio77 commented 2 years ago

Seems to work now :))

dive-deeper commented 2 years ago

Hey! That was really fast ;) yep, it works for me as well. I'll close the ticket then. Thanks!

midick commented 2 years ago

I am also trying to install on Ubuntu (20.04) and am running into a similar issue. cargo install flavours fails when compiling clap-3.0.0-beta.5 with two errors:

error[E0658]: arbitrary expressions in key-value attributes are unstable                                                                                                                                                                                                                                                         --> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.5/src/lib.rs:8:10                                                                                                                                                                                                                               
  |
8 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information

error[E0658]: use of unstable library feature 'osstring_ascii'
   --> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.5/src/parse/matches/matched_arg.rs:130:19
    |
130 |                 v.eq_ignore_ascii_case(val)
    |                   ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #70516 <https://github.com/rust-lang/rust/issues/70516> for more information
midick commented 2 years ago

I am also completely unfamiliar with Rust, so it might be that I am missing something super obvious

Misterio77 commented 2 years ago

Hey! Your error might be caused by an out of date rust install. Could you try installing a newer one using rustup?

midick commented 2 years ago

Hi, thank you for the super fast response! I did install a newer version now (1.56.0) and the installation is now progressing a bit further. It still fails though while compiling flavours with a bunch of errors of the type

error[E0599]: no variant or associated item named `UnifiedHelpMessage` found for enum `AppSettings` in the current scope
 --> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:9:31                          
  |                                                                                                                     
9 |         .setting(AppSettings::UnifiedHelpMessage)                                                                   
  |                               ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `AppSettings` 
error[E0599]: no variant or associated item named `ColoredHelp` found for enum `AppSettings` in the current scope       
  --> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/cli.rs:13:31                        
   |                                                                                                                    
13 |         .setting(AppSettings::ColoredHelp)                                                                         
   |                               ^^^^^^^^^^^ variant or associated item not found in `AppSettings`  

and a couple of those:

error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/flavours-0.5.1/src/completions.rs:12:25
    |
12  |         Some("bash") => generate::<Bash, _>(&mut build_cli(), "flavours", &mut io::stdout()),
    |                         ^^^^^^^^^^^^^^^^^^^ ----------------  ----------  ----------------- supplied 3 arguments
    |                         |
    |                         expected 4 arguments
    |
note: function defined here
   --> /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/clap_generate-3.0.0-beta.5/src/lib.rs:239:8
    |
239 | pub fn generate<G, S>(gen: G, app: &mut clap::App, bin_name: S, buf: &mut dyn Write)
    |        ^^^^^^^^
Misterio77 commented 2 years ago

@midick, it seems this issue happens every time clap introduces a breaking change, as cargo install was not respecting the version locked in Cargo.lock, thus downloading an incompatible clap version. This should be fixed in 0.5.2, please let me know if it works for you :)

midick commented 2 years ago

thank you so much! i installs flawlessly and works like a charm.