Clap: Could not compile `clap`. process didn't exit successfully

Created on 5 May 2019  路  6Comments  路  Source: clap-rs/clap

Hi, I am a bit unsure where to put this issue as it happens when using tether crate but only bindgen is dependent on clap.

Rust Version

rustc 1.34.1 (fc50f328b 2019-04-24)

Affected Version of clap

2.33.0

Bug Summary

RSL won't start because it can't compile clap in VS Code extension.

Actual Behavior Summary

An Error is shown:

{
    "resource": "/home/asmar/projects/rust/tether_test/Cargo.toml",
    "owner": "rust",
    "severity": 8,
    "message": "Could not compile `clap`.\nprocess didn't exit successfully: `/home/asmar/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rls --crate-name clap /home/asmar/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.33.0/src/lib.rs --color never --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature=\"ansi_term\"' --cfg 'feature=\"atty\"' --cfg 'feature=\"color\"' --cfg 'feature=\"default\"' --cfg 'feature=\"strsim\"' --cfg 'feature=\"suggestions\"' --cfg 'feature=\"vec_map\"' -C metadata=92f4b88ca94d45f6 -C extra-filename=-92f4b88ca94d45f6 --out-dir /home/asmar/projects/rust/tether_test/target/rls/debug/deps -L dependency=/home/asmar/projects/rust/tether_test/target/rls/debug/deps --extern ansi_term=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libansi_term-5d0ea3e7965a4619.rlib --extern atty=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libatty-b238ee1612164c59.rlib --extern bitflags=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libbitflags-1eecf389306a3c09.rlib --extern strsim=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libstrsim-9254da5d76dd790e.rlib --extern textwrap=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libtextwrap-bcb2e577ece43bfb.rlib --extern unicode_width=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libunicode_width-19d5b772cca570d6.rlib --extern vec_map=/home/asmar/projects/rust/tether_test/target/rls/debug/deps/libvec_map-fa11111d90438a74.rlib --cap-lints allow --error-format=json --sysroot /home/asmar/.rustup/toolchains/stable-x86_64-unknown-linux-gnu` (exit code: 101)",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 10000,
    "endColumn": 1
}

Steps to Reproduce the issue

Open Cargo project that has tether="0.3.0" dependency with VS Code and Rust (rls) extension.

Most helpful comment

For some reason rls fails to compile clap or things that depend on it. Interesting thing is that just compiling/running my program with cargo run will work, just not when VS Code tries to compile using rls.

All 6 comments

I ran into a similar issue. Posted it as an issue to rls here: https://github.com/rust-lang/rls/issues/1454

For some reason rls fails to compile clap or things that depend on it. Interesting thing is that just compiling/running my program with cargo run will work, just not when VS Code tries to compile using rls.

@mati865 is right. Try the fix in https://github.com/bitflags/bitflags/issues/177, it worked for me.

How can I lock the version of bitflags, which is a dependency of clap? In my case, adding bitflags = "1.0.4" to Cargo.toml didn't work (Cargo.lock still contains bitflags 1.0.5, not 1.0.4). What worked for me is that I edited auto-generated Cargo.lock manually:

  1. replacing all occurrences of bitflags version 1.0.5 to 1.0.4 and
  2. replacing checksum value of bitflags 1.0.5to the value of 1.0.4. I found the checksum value here

    "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
    

Add this to your Cargo.toml

[dependencies]
bitflags = "=1.0.4"

Looks like you are missing the second = sign ("=1.0.4").

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kbknapp picture kbknapp  路  16Comments

kbknapp picture kbknapp  路  30Comments

CAD97 picture CAD97  路  21Comments

joshtriplett picture joshtriplett  路  75Comments

joshtriplett picture joshtriplett  路  41Comments