iqlusioninc/abscissa

abscissa_core v0.6.0-pre.2 based apps fail to build because of the Clap dependency

ScottDillman opened this issue · 2 comments

It looks like the recent move to Clap has had some side effects.

The error that I am seeing when compiling apps generated with the CLI is below:

error[E0432]: unresolved import `clap::Clap`
   --> /home/ctrauma/.cargo/registry/src/github.com-1ecc6299db9ec823/abscissa_core-0.6.0-pre.2/src/lib.rs:141:9
    |
141 | pub use clap::Clap;
    |         ^^^^^^^^^^ no `Clap` in the root
% abscissa --version
abscissa 0.6.0-pre.2
% abscissa new test
     Created `test` (application directory)
     Created new file: .gitignore
     Created new file: Cargo.toml
     Created new file: README.md
     Created new file: src/application.rs
     Created new file: src/bin/test/main.rs
     Created new file: src/commands.rs
     Created new file: src/commands/start.rs
     Created new file: src/config.rs
     Created new file: src/error.rs
     Created new file: src/lib.rs
     Created new file: src/prelude.rs
     Created new file: tests/acceptance.rs
     Running git init test
     Running cargo generate-lockfile
    Finished `test` generated in 0.14s
% cargo build --release
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.80
   Compiling autocfg v1.0.1
   Compiling version_check v0.9.3
   Compiling memchr v2.4.1
   Compiling libc v0.2.104
   Compiling serde_derive v1.0.130
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.130
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.25
   Compiling fnv v1.0.7
   Compiling strsim v0.10.0
   Compiling cc v1.0.71
   Compiling ident_case v1.0.1
   Compiling once_cell v1.8.0
   Compiling log v0.4.14
   Compiling eyre v0.6.5
   Compiling adler v1.0.2
   Compiling gimli v0.25.0
   Compiling unicode-segmentation v1.8.0
   Compiling semver v1.0.4
   Compiling pin-project-lite v0.2.7
   Compiling hashbrown v0.11.2
   Compiling unicode-width v0.1.9
   Compiling rustc-demangle v0.1.21
   Compiling indenter v0.3.3
   Compiling smallvec v1.7.0
   Compiling bitflags v1.3.2
   Compiling zeroize v1.4.2
   Compiling ansi_term v0.12.1
   Compiling termcolor v1.1.2
   Compiling owo-colors v1.3.0
   Compiling canonical-path v2.0.2
   Compiling fs-err v2.6.0
   Compiling arc-swap v1.4.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling unicase v2.6.0
   Compiling tracing-core v0.1.21
   Compiling sharded-slab v0.1.4
   Compiling num-traits v0.2.14
   Compiling miniz_oxide v0.4.4
   Compiling num-integer v0.1.44
   Compiling indexmap v1.7.0
   Compiling thread_local v1.1.3
   Compiling textwrap v0.14.2
   Compiling heck v0.3.3
   Compiling backtrace v0.3.61
   Compiling regex-automata v0.1.10
   Compiling addr2line v0.16.0
   Compiling aho-corasick v0.7.18
   Compiling object v0.26.2
   Compiling os_str_bytes v4.2.0
   Compiling matchers v0.0.1
   Compiling quote v1.0.10
   Compiling time v0.1.44
   Compiling atty v0.2.14
   Compiling wait-timeout v0.2.0
   Compiling tracing-log v0.1.2
   Compiling regex v1.5.4
   Compiling color-eyre v0.5.11
   Compiling darling_core v0.13.0
   Compiling synstructure v0.12.6
   Compiling tracing-attributes v0.1.18
   Compiling clap_derive v3.0.0-beta.5
   Compiling thiserror-impl v1.0.30
   Compiling darling_macro v0.13.0
   Compiling darling v0.13.0
   Compiling abscissa_derive v0.6.0-pre.2
   Compiling tracing v0.1.29
   Compiling tracing-subscriber v0.2.25
   Compiling thiserror v1.0.30
   Compiling clap v3.0.0-beta.5
   Compiling toml v0.5.8
   Compiling chrono v0.4.19
   Compiling secrecy v0.8.0
   Compiling abscissa_core v0.6.0-pre.2
error[E0432]: unresolved import `clap::Clap`
   --> /home/ctrauma/.cargo/registry/src/github.com-1ecc6299db9ec823/abscissa_core-0.6.0-pre.2/src/lib.rs:141:9
    |
141 | pub use clap::Clap;
    |         ^^^^^^^^^^ no `Clap` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `abscissa_core` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

This is because clap is improperly pinning clap_derive due to what is arguably a bug in the way the semver crate interprets prereleases.

To correct it you'll need to explicitly pin clap_derive in Cargo.toml:

clap = "=3.0.0-beta.4"
clap_derive = "=3.0.0-beta.4"

We'll be bumping to beta.5 soon and will include this in the generated boilerplate in the next prerelease.

thanks for the quick response and the work around, worked perfectly.. 👍