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

Unable to build using cargo install emoji_pix #9

Closed
z0rg0n opened this issue Mar 12, 2022 · 2 comments · Fixed by #10
Closed

Unable to build using cargo install emoji_pix #9

z0rg0n opened this issue Mar 12, 2022 · 2 comments · Fixed by #10

Comments

@z0rg0n
Copy link

z0rg0n commented Mar 12, 2022

I installed rustup following this

rustup --version returns:

rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.59.0 (9d1b2106e 2022-02-23)`

cargo --version returns:

cargo 1.59.0 (49d8809dc 2022-02-10)

cargo install emoji_pix returns an error:

   Compiling scarlet v1.1.0
   Compiling emoji_pix v0.2.0
error[E0432]: unresolved imports `clap::Clap`, `clap::crate_authors`, `clap::crate_version`
 --> /home/z0rg0n/.cargo/registry/src/github.com-1ecc6299db9ec823/emoji_pix-0.2.0/src/lib.rs:4:25
  |
4 | use clap::{AppSettings, Clap, crate_authors, crate_version};
  |                         ^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^^^^ no `crate_version` in the root
  |                         |     |
  |                         |     no `crate_authors` in the root
  |                         no `Clap` in the root

error: cannot determine resolution for the derive macro `Clap`
  --> /home/z0rg0n/.cargo/registry/src/github.com-1ecc6299db9ec823/emoji_pix-0.2.0/src/lib.rs:38:10
   |
38 | #[derive(Clap)]
   |          ^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot find attribute `clap` in this scope
  --> /home/z0rg0n/.cargo/registry/src/github.com-1ecc6299db9ec823/emoji_pix-0.2.0/src/lib.rs:39:3
   |
39 | #[clap(setting = AppSettings::ColoredHelp, version = crate_version!(), author = crate_authors!("\n"))]
   |   ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> /home/z0rg0n/.cargo/registry/src/github.com-1ecc6299db9ec823/emoji_pix-0.2.0/src/lib.rs:47:7
   |
47 |     #[clap(short, long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> /home/z0rg0n/.cargo/registry/src/github.com-1ecc6299db9ec823/emoji_pix-0.2.0/src/lib.rs:52:7
   |
52 |     #[clap(short, long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> /home/z0rg0n/.cargo/registry/src/github.com-1ecc6299db9ec823/emoji_pix-0.2.0/src/lib.rs:57:7
   |
57 |     #[clap(default_value = "Gaussian", short, long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

For more information about this error, try `rustc --explain E0432`.
error: could not compile `emoji_pix` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `emoji_pix v0.2.0`, intermediate artifacts can be found at `/tmp/cargo-install6oTHpu`

Caused by:
  build failed

More detail on the error using rustic --explain E0432:


An import was unresolved.

Erroneous code example:


use something::Foo; // error: unresolved import `something::Foo`.


In Rust 2015, paths in `use` statements are relative to the crate root. To
import items relative to the current and parent modules, use the `self::` and
`super::` prefixes, respectively.

In Rust 2018, paths in `use` statements are relative to the current module
unless they begin with the name of a crate or a literal `crate::`, in which
case they start from the crate root. As in Rust 2015 code, the `self::` and
`super::` prefixes refer to the current and parent modules respectively.

Also verify that you didn't misspell the import name and that the import exists
in the module from where you tried to import it. Example:


use self::something::Foo; // Ok.

mod something {
    pub struct Foo;
}


If you tried to use a module from an external crate and are using Rust 2015,
you may have missed the `extern crate` declaration (which is usually placed in
the crate root):


extern crate core; // Required to use the `core` crate in Rust 2015.

use core::any;


In Rust 2018 the `extern crate` declaration is not required and you can instead
just `use` it:


use core::any; // No extern crate required in Rust 2018.

Not sure what I'm doing wrong. I've never used Rust before.

@multimeric
Copy link
Owner

Good find! I think that's just a newer version of clap breaking the build. I'll take a look.

@multimeric
Copy link
Owner

Should be fixed in 0.2.1.

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

Successfully merging a pull request may close this issue.

2 participants