collapse
collapse copied to clipboard
error compiling clap
I'm having trouble building collapse. Could I please ask for help figuring this out?
cargo --version
cargo 1.28.0 (96a2c7d16 2018-07-13)
rustc --version
rustc 1.28.0 (9634041f0 2018-07-30)
cargo build --release
Compiling clap v2.32.0
error[E0583]: file not found for module `option`
--> /Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/args/arg_builder/mod.rs:10:5
|
10 | mod option;
| ^^^^^^
|
= help: name the file either option.rs or option/mod.rs inside the directory "/Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/args/arg_builder"
error: aborting due to previous error
For more information about this error, try `rustc --explain E0583`.
error: Could not compile `clap`.
warning: build failed, waiting for other jobs to finish...
error: build failed
rustc --explain E0583
A file wasn't found for an out-of-line module.
Erroneous code example:
```
mod file_that_doesnt_exist; // error: file not found for module
fn main() {}
```
Please be sure that a file corresponding to the module exists. If you
want to use a module named `file_that_doesnt_exist`, you need to have a file
named `file_that_doesnt_exist.rs` or `file_that_doesnt_exist/mod.rs` in the
same directory.
$ cargo build --release
Updating registry `https://github.com/rust-lang/crates.io-index`
Updating git repository `https://github.com/sdleffler/vosealias-rs`
Downloading ndarray v0.6.10
Downloading image v0.20.1
Downloading bitflags v0.7.0
Downloading bit-set v0.4.0
Downloading bit-vec v0.4.4
Downloading log v0.3.9
Downloading pbr v0.3.1
Downloading regex v0.1.80
Downloading itertools v0.5.10
Downloading num-traits v0.1.43
Downloading matrixmultiply v0.1.15
Downloading num-complex v0.1.43
Downloading num-traits v0.2.6
Downloading rawpointer v0.1.0
Downloading tiff v0.2.1
Downloading num-rational v0.2.1
Downloading png v0.12.0
Downloading lzw v0.10.0
Downloading gif v0.10.1
Downloading scoped_threadpool v0.1.9
Downloading jpeg-decoder v0.1.15
Downloading byteorder v1.2.7
Downloading num-iter v0.1.37
Downloading num-derive v0.2.3
Downloading proc-macro2 v0.4.23
Downloading quote v0.6.10
Downloading syn v0.15.20
Downloading inflate v0.4.3
Downloading deflate v0.7.19
Downloading adler32 v1.0.3
Downloading color_quant v1.0.1
Downloading rayon v1.0.3
Downloading cfg-if v0.1.6
Downloading lazy_static v1.2.0
Downloading nodrop v0.1.13
Downloading log v0.4.6
Downloading winapi v0.2.8
Downloading kernel32-sys v0.2.2
Downloading winapi-build v0.1.1
Downloading thread_local v0.2.7
Downloading regex-syntax v0.3.9
Downloading aho-corasick v0.5.3
Downloading memchr v0.1.11
Downloading utf8-ranges v0.1.3
Downloading thread-id v2.0.0
Compiling proc-macro2 v0.4.23
Compiling cfg-if v0.1.6
Compiling nodrop v0.1.13
Compiling scopeguard v0.3.3
Compiling unicode-xid v0.1.0
Compiling memoffset v0.2.1
Compiling lazy_static v1.2.0
Compiling num-traits v0.2.6
Compiling winapi-build v0.1.1
Compiling libc v0.2.43
Compiling rayon-core v1.4.1
Compiling num-integer v0.1.39
Compiling num-derive v0.2.3
Compiling rayon v1.0.3
Compiling num-iter v0.1.37
Compiling winapi v0.2.8
Compiling adler32 v1.0.3
Compiling either v1.5.0
Compiling byteorder v1.2.7
Compiling num-rational v0.2.1
Compiling matrixmultiply v0.1.15
Compiling lzw v0.10.0
Compiling rawpointer v0.1.0
Compiling unicode-width v0.1.5
Compiling ndarray v0.6.10
Compiling bitflags v1.0.4
Compiling color_quant v1.0.1
Compiling vec_map v0.8.1
Compiling strsim v0.7.0
Compiling regex-syntax v0.3.9
Compiling bit-vec v0.4.4
Compiling ansi_term v0.11.0
Compiling utf8-ranges v0.1.3
Compiling scoped_threadpool v0.1.9
Compiling bitflags v0.7.0
Compiling lazy_static v0.2.11
Compiling crossbeam-utils v0.2.2
Compiling log v0.4.6
Compiling arrayvec v0.4.7
Compiling kernel32-sys v0.2.2
Compiling num_cpus v1.8.0
Compiling rand v0.4.3
Compiling memchr v0.1.11
Compiling time v0.1.40
Compiling atty v0.2.11
Compiling inflate v0.4.3
Compiling itertools v0.5.10
Compiling textwrap v0.10.0
Compiling deflate v0.7.19
Compiling bit-set v0.4.0
Compiling gif v0.10.1
Compiling log v0.3.9
Compiling crossbeam-epoch v0.3.1
Compiling aho-corasick v0.5.3
Compiling clap v2.32.0
error[E0583]: file not found for module `option`
--> /Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/args/arg_builder/mod.rs:10:5
|
10 | mod option;
| ^^^^^^
|
= help: name the file either option.rs or option/mod.rs inside the directory "/Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/args/arg_builder"
error: aborting due to previous error
For more information about this error, try rustc --explain E0583.
error: Could not compile clap.
warning: build failed, waiting for other jobs to finish...
error: build failed
Hi! This looks like a build error within clap, which is not part of collapse, but a dependency that I don't have control over. 2.32.0 seems to be the newest version of clap, which I use for CLI parsing. Not sure what's going on. I'll try to reproduce it myself and report back.
I've pushed a new commit which fixes builds for me on Rust 1.29. The clap dependency here is set to use the newest clap published as long as it doesn't go over major version 2, so it may be that clap 2.32 does not want to compile on stable Rust 1.28 as the newest stable Rust version is actually 1.30.1. In any case it now compiles for me on 1.29 with the updates I just made. I'm going to update to 1.30.1 and see how it does.
Seems to work fine on newest stable Rust. I suggest updating your Rust installation and trying again. For what it's worth, I did not get the clap error compiling on Rust 1.29 - instead, the build failed when trying to compile the pbr dependency, which is the progress bar I used.
Since I believe the root cause of this issue is an outdated Rust installation, I'm going to close this issue. Please comment again if you're still having trouble.
Thanks for the comments! I appreciate your help.
I did rustup update to update my rust to version 1.30.0
Then I did cargo build --release and got the same error as before:
Compiling clap v2.32.0
Compiling rand v0.3.22
error[E0583]: file not found for module `option`
--> /Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/args/arg_builder/mod.rs:10:5
|
10 | mod option;
| ^^^^^^
|
= help: name the file either option.rs or option/mod.rs inside the directory "/Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/args/arg_builder"
error: aborting due to previous error
For more information about this error, try `rustc --explain E0583`.
error: Could not compile `clap`.
warning: build failed, waiting for other jobs to finish...
error: build failed
$ rustc --version
rustc 1.30.1 (1433507eb 2018-11-07)
$ cargo --version
cargo 1.30.0 (a1a4ad372 2018-11-02)
Next, I tried removing clap and trying again. Now I get a new error, similar to the one you mentioned!
First, get rid of clap:
$ rm -rf /Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0
Now try building again:
$ cargo build --release
Compiling clap v2.32.0
Compiling quote v0.6.10
Compiling crossbeam-deque v0.2.0
Compiling num-integer v0.1.39
Compiling num-complex v0.1.43
Compiling num-traits v0.1.43
Compiling thread-id v2.0.0
Compiling pbr v0.3.1
Compiling thread_local v0.2.7
Compiling vosealias v0.2.0 (https://github.com/sdleffler/vosealias-rs#73db72c8)
Compiling rayon-core v1.4.1
error[E0283]: type annotations required: cannot resolve `std::string::String: std::convert::AsRef<_>`
--> /Users/slowikow/.cargo/registry/src/github.com-1ecc6299db9ec823/pbr-0.3.1/src/pb.rs:348:64
|
348 | base = base + repeat!(self.bar_current.as_ref(), curr_count - 1) +
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0283`.
error: Could not compile `pbr`.
warning: build failed, waiting for other jobs to finish...
error: build failed
Worked for me using the latest nightly:
$ rustc --version
rustc 1.32.0-nightly (f1e2fa8f0 2018-11-20)
$ cargo --version
cargo 1.32.0-nightly (b3d0b2e54 2018-11-15)
@slowkow that looks like whatever is failing the build wants to be using Edition 2018. Can you try again using Rust nightly? If you're using rustup you can do rustup override set nightly to tell rustup to use nightly for a single project.
Er, the clap error looks that way. I can't speak for the second error.