Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Doesn't compile in WSL with ubuntu 20.04 #2535

Closed
2 tasks done
IceSentry opened this issue Jun 13, 2021 · 2 comments
Closed
2 tasks done

Doesn't compile in WSL with ubuntu 20.04 #2535

IceSentry opened this issue Jun 13, 2021 · 2 comments
Labels
C-bug Category: Updating dependencies

Comments

@IceSentry
Copy link

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Rust Version

rustc 1.52.1 (9bc8c42bb 2021-05-09)

Clap Version

3.0.0-beta.2

Minimal reproducible code

fn main() {
	println!("Hello, world!");
}

in Cargo.toml

[package]
name = "clap-test"
version = "0.1.0"
authors = ["author"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = "3.0.0-beta.2"

Steps to reproduce the bug with the above code

run cargo build in wsl with ubuntu 20.04

Actual Behaviour

 > cargo build
   Compiling clap v3.0.0-beta.2
error[E0107]: this struct takes 3 type arguments but only 2 type arguments were supplied
  --> /home/<username>/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.0.0-beta.2/src/parse/matches/arg_matches.rs:77:22
   |
77 |     pub(crate) args: IndexMap<Id, MatchedArg>,
   |                      ^^^^^^^^ --  ---------- supplied 2 type arguments
   |                      |
   |                      expected 3 type arguments
   |
note: struct defined here, with 3 type parameters: `K`, `V`, `S`
  --> /home/<username>/.cargo/registry/src/github.com-1ecc6299db9ec823/indexmap-1.6.2/src/map.rs:76:12
   |
76 | pub struct IndexMap<K, V, S> {
   |            ^^^^^^^^ -  -  -
help: add missing type argument
   |
77 |     pub(crate) args: IndexMap<Id, MatchedArg, S>,
   |                                             ^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0107`.
error: could not compile `clap`

To learn more, run the command again with --verbose.

Expected Behaviour

Compiles successfully when added as a dependency

Additional Context

I recently completely reinstalled wsl with ubuntu 20.04 and I have nothing but the rust toolchain installed on top of the default installation and anything required to compile rust projects. I can compile other projects that do not use clap. Yes, I ran an apt update and apt upgrade. I tried building a project using clap and saw this output. I then reproduced the bug by adding the dependency to an empty project and I saw the same output of clap not being able to compile.

I know this works correctly in my windows install, but I also compiled that project yesterday in a ubuntu 18.04 not through wsl and it worked.

I'm not sure if the issue is with WSL or ubuntu 20.04

Debug Output

No response

@IceSentry IceSentry added the C-bug Category: Updating dependencies label Jun 13, 2021
@pksunkara
Copy link
Member

pksunkara commented Jun 13, 2021 via email

@pksunkara
Copy link
Member

Looks like it's an issue with rust and WSL and ubuntu. There's a workaround at indexmap-rs/indexmap#144 (comment).

@clap-rs clap-rs locked and limited conversation to collaborators Jun 13, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants