Skip to content
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

Docs build on docs.rs is failing #56

Closed
conorsch opened this issue Sep 19, 2023 · 8 comments
Closed

Docs build on docs.rs is failing #56

conorsch opened this issue Sep 19, 2023 · 8 comments

Comments

@conorsch
Copy link
Contributor

See example failure here: https://docs.rs/crate/ibc-types/0.6.1/builds/915166

[INFO] [stderr] warning: Target filter specified, but no targets matched. This is a no-op
[INFO] [stderr]     Checking bytes v1.5.0
[INFO] [stderr]     Checking serde_bytes v0.11.12
[INFO] [stderr]     Checking serde_json v1.0.107
[INFO] [stderr]     Checking ed25519-consensus v2.1.0
[INFO] [stderr]    Compiling safe-proc-macro2 v1.0.36
[INFO] [stderr]    Compiling crunchy v0.2.2
[INFO] [stderr] error[E0422]: cannot find struct, variant or union type `LineColumn` in crate `proc_macro`
[INFO] [stderr]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/safe-proc-macro2-1.0.36/src/wrapper.rs:485:33
[INFO] [stderr]     |
[INFO] [stderr] 485 |                 let proc_macro::LineColumn { line, column } = s.start();
[INFO] [stderr]     |                                 ^^^^^^^^^^ not found in `proc_macro`
[INFO] [stderr]     |
[INFO] [stderr] help: consider importing one of these items
[INFO] [stderr]     |
[INFO] [stderr] 1   + use crate::LineColumn;
[INFO] [stderr]     |
[INFO] [stderr] 1   + use crate::fallback::LineColumn;
[INFO] [stderr]     |
[INFO] [stderr] help: if you import `LineColumn`, refer to it directly
[INFO] [stderr]     |
[INFO] [stderr] 485 -                 let proc_macro::LineColumn { line, column } = s.start();
[INFO] [stderr] 485 +                 let LineColumn { line, column } = s.start();
[INFO] [stderr]     |
[INFO] [stderr] 

Looks like we should bump proc-macro2 within the deps.

@conorsch
Copy link
Contributor Author

PR should resolve it. Looks like the docs.rs build process is using a version of proc-macro2 that's a bit too old. We don't commit lockfiles for these libraries, so instead I added a recent version of proc-macro2 to the deps of ibc-types-core-channel. However, we won't know the problem is fixed until we post another release, thereby triggering the docs.rs build.

@conorsch
Copy link
Contributor Author

Still failing:

ibc-types-docsrs-failure

@erwanor erwanor moved this to Future in Testnets Sep 22, 2023
@rnbguy
Copy link
Contributor

rnbguy commented Sep 23, 2023

Hey, this is coming from safe-proc-macro2(dependency of safe-regex) which was using removed proc_macro::LineColumn. It is not related to proc-macro2.

The author has made a new release. If you're not using cargo.lock, the next release should publish just fine on docs.rs. Otherwise perform a cargo update to fetch the latest safe-proc-macro2.

@conorsch
Copy link
Contributor Author

conorsch commented Oct 6, 2023

Thanks for explaining! We're not using a lockfile, since these crates are libraries, not binaries, and that's what the cargo book recommends. It's not clear to me how to force docs.rs to run cargo update in the build environment, but I'll look into that next.

@rnbguy
Copy link
Contributor

rnbguy commented Oct 11, 2023

No worries about the lockfile. I just didn't check if you're using it or not. But in the downstream, if you have a binary crate with rust docs, you must run cargo update to update its lockfile.

For the docs.rs, crate-owners can not trigger a fresh cargo doc build for a failed one ... yet. So you have to wait till the next release on crates-io.

@erwanor
Copy link
Member

erwanor commented Oct 11, 2023

Thanks a lot for looking into this @rnbguy!!

@rnbguy
Copy link
Contributor

rnbguy commented Oct 11, 2023

For what it's worth, I see that you are using safe_regex only once.

let re = safe_regex::regex!(br".*[^-]-[1-9][0-9]*");

We also faced the same issue at cosmos/ibc-rs#875. We just replaced safe_regex with a manual parser maintaining no_std.

@conorsch
Copy link
Contributor Author

Docs no longer failing, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Future
Development

No branches or pull requests

3 participants