cargo install mdbook-open-on-gh fails in github Actions CI #11

Closed
opened 2022-12-16 17:24:41 +00:00 by joepio · 1 comment
joepio commented 2022-12-16 17:24:41 +00:00 (Migrated from github.com)

Hi there! Thanks for making & sharing this.

I noticed that my CI was failing on v2.3.0:

Compiling mdbook-open-on-gh v2.3.0
error[E0432]: unresolved import `clap::crate_version`
 --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-open-on-gh-2.3.0/src/bin/mdbook-open-on-gh.rs:1:12
  |
1 | use clap::{crate_version, Arg, ArgMatches, Command};
  |            ^^^^^^^^^^^^^ no `crate_version` in the root

error: cannot determine resolution for the macro `crate_version`
  --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-open-on-gh-2.3.0/src/bin/mdbook-open-on-gh.rs:11:18
   |
11 |         .version(crate_version!())
   |                  ^^^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

For more information about this error, try `rustc --explain E0432`.
error: could not compile `mdbook-open-on-gh` due to 2 previous errors
error: failed to compile `mdbook-open-on-gh v2.3.0`, intermediate artifacts can be found at `/tmp/cargo-installDfIvH7`
Error: Process completed with exit code 101.

Installing 2.1.0 and 2.3.0 also fail.

      - run: cargo install mdbook-open-on-gh --version 2.1.0

EDIT: I guess this is the issue, we need the cargo feature.

Hi there! Thanks for making & sharing this. I noticed that my [CI was failing](https://github.com/atomicdata-dev/atomic-data-docs/actions/runs/3715102338/jobs/6299863967#step:4:341 ) on v2.3.0: ``` Compiling mdbook-open-on-gh v2.3.0 error[E0432]: unresolved import `clap::crate_version` --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-open-on-gh-2.3.0/src/bin/mdbook-open-on-gh.rs:1:12 | 1 | use clap::{crate_version, Arg, ArgMatches, Command}; | ^^^^^^^^^^^^^ no `crate_version` in the root error: cannot determine resolution for the macro `crate_version` --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-open-on-gh-2.3.0/src/bin/mdbook-open-on-gh.rs:11:18 | 11 | .version(crate_version!()) | ^^^^^^^^^^^^^ | = note: import resolution is stuck, try simplifying macro imports For more information about this error, try `rustc --explain E0432`. error: could not compile `mdbook-open-on-gh` due to 2 previous errors error: failed to compile `mdbook-open-on-gh v2.3.0`, intermediate artifacts can be found at `/tmp/cargo-installDfIvH7` Error: Process completed with exit code 101. ``` Installing 2.1.0 and 2.3.0 also [fail](https://github.com/atomicdata-dev/atomic-data-docs/actions/runs/3715776671/jobs/6301339584#step:4:341). ``` - run: cargo install mdbook-open-on-gh --version 2.1.0 ``` EDIT: I guess [this is the issue](https://docs.rs/clap/3.2.22/clap/macro.crate_version.html), we need the `cargo` feature.
joepio commented 2022-12-18 20:00:17 +00:00 (Migrated from github.com)

Can confirm it works, thanks for merging and uploading the new version!

Can confirm it works, thanks for merging and uploading the new version!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jer/mdbook-open-on-gh#11
No description provided.