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

rustdoc link resolution is nondeterministic, depends on job number #106011

Open
jonas-schievink opened this issue Dec 21, 2022 · 1 comment
Open
Labels
A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

jonas-schievink commented Dec 21, 2022

rust-analyzer generates documentation by running cargo doc --all --no-deps in CI, but I've noticed that the resulting documentation doesn't have any clickable links, even to other workspace crates. Some investigation showed that I couldn't reproduce this behavior locally unless I pass -j1 to Cargo, which indicates that the behavior is nondeterministic.

In total, I've observed these 3 different results:

Screenshot_20221221_184626
Screenshot_20221221_184644
screenshot-2022-12-21-18:41:14

These were all generated from the same commit, rust-lang/rust-analyzer@761b127, using Rust 1.66.0. (the item is hir::Semantics::speculative_expand)

@jonas-schievink jonas-schievink added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-reproducibility Area: Reproducible / deterministic builds labels Dec 21, 2022
@jyn514
Copy link
Member

jyn514 commented Mar 11, 2023

Some investigation showed that I couldn't reproduce this behavior locally unless I pass -j1 to Cargo, which indicates that the behavior is nondeterministic.

If this is fixed by running fewer rustdoc processes in parallel, this is a cargo issue, not a rustdoc issue. Cargo needs to only run rustdoc on the crate once all its dependencies have been documented.

cc

// See if there's documentation generated into the local directory
// WARNING: since rustdoc creates these directories as it generates documentation, this check is only accurate before rendering starts.
// Make sure to call `location()` by that time.
let local_location = dst.join(self.name(tcx).as_str());
if local_location.is_dir() {
return Local;
}

@jyn514 jyn514 added the T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants