Skip to content

rustdoc generation of search-index.js depends on the order crates are documented #61216

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
ollie27 opened this issue May 26, 2019 · 2 comments · Fixed by #73998
Closed

rustdoc generation of search-index.js depends on the order crates are documented #61216

ollie27 opened this issue May 26, 2019 · 2 comments · Fixed by #73998
Labels
A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ollie27
Copy link
Member

ollie27 commented May 26, 2019

Take two crates:

foo.rs:

pub struct FooBar;

bar.rs:

pub struct BarFoo;

Using rustdoc 1.36.0-nightly (8869ee03d 2019-05-23) for example and running rustdoc foo.rs then rustdoc bar.rs gives a search-index.js:

var N=null,E="",T="t",U="u",searchIndex={};
var R=["result","FooBar","BarFoo","try_from","try_into","borrow","borrow_mut","type_id","typeid"];
searchIndex["bar"]={"doc":E,"i":[[3,R[2],"bar",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[3],E,E,0,[[[U]],[R[0]]]],[11,R[4],E,E,0,[[],[R[0]]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[T]]],[11,R[7],E,E,0,[[["self"]],[R[8]]]]],"p":[[3,R[2]]]};
searchIndex["foo"]={"doc":E,"i":[[3,R[1],"foo",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[3],E,E,0,[[[U]],[R[0]]]],[11,R[4],E,E,0,[[],[R[0]]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[T]]],[11,R[7],E,E,0,[[["self"]],[R[8]]]]],"p":[[3,R[1]]]};
initSearch(searchIndex);addSearchOptions(searchIndex);

but running rustdoc bar.rs then rustdoc foo.rs gives:

var N=null,E="",T="t",U="u",searchIndex={};
var R=["result","BarFoo","try_from","try_into","borrow","borrow_mut","type_id","typeid","FooBar"];
searchIndex["bar"]={"doc":E,"i":[[3,R[1],"bar",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[2],E,E,0,[[[U]],[R[0]]]],[11,R[3],E,E,0,[[],[R[0]]]],[11,R[4],E,E,0,[[["self"]],[T]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[R[7]]]]],"p":[[3,R[1]]]};
searchIndex["foo"]={"doc":E,"i":[[3,R[8],"foo",E,N,N],[11,"from",E,E,0,[[[T]],[T]]],[11,"into",E,E,0,[[],[U]]],[11,R[2],E,E,0,[[[U]],[R[0]]]],[11,R[3],E,E,0,[[],[R[0]]]],[11,R[4],E,E,0,[[["self"]],[T]]],[11,R[5],E,E,0,[[["self"]],[T]]],[11,R[6],E,E,0,[[["self"]],[R[7]]]]],"p":[[3,R[8]]]};
initSearch(searchIndex);addSearchOptions(searchIndex);

They should be identical and they are when using --disable-minification. This breaks reproducible builds (#34902).

@ollie27 ollie27 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 26, 2019
@GuillaumeGomez
Copy link
Member

Funny because the fix for this is an improvement I intended to do: restart the string minification process over all strings.

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jun 2, 2019

Or we could sort them everytime? Since we rewrite the whole file in any case...

EDIT: we already do that, never mind...

@jonas-schievink jonas-schievink added the A-reproducibility Area: Reproducible / deterministic builds label Aug 19, 2019
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 16, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 16, 2020
…arth

Rollup of 21 pull requests

Successful merges:

 - rust-lang#73566 (Don't run `everybody_loops` for rustdoc; instead ignore resolution errors)
 - rust-lang#73771 (Don't pollute docs/suggestions with libstd deps)
 - rust-lang#73794 (Small cleanup for E0705 explanation)
 - rust-lang#73807 (rustdoc: glue tokens before highlighting)
 - rust-lang#73835 (Clean up E0710 explanation)
 - rust-lang#73926 (Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64)
 - rust-lang#73981 (Remove some `ignore-stage1` annotations.)
 - rust-lang#73998 (add regression test for rust-lang#61216)
 - rust-lang#74140 (Make hir ProjectionKind more precise)
 - rust-lang#74148 (Move #[doc(alias)] check in rustc)
 - rust-lang#74159 (forbid generic params in the type of const params)
 - rust-lang#74171 (Fix 44056 test with debug on macos.)
 - rust-lang#74221 (Don't panic if the lhs of a div by zero is not statically known)
 - rust-lang#74325 (Focus on the current file in the source file sidebar)
 - rust-lang#74359 (rustdoc: Rename internal API fns to `into_string`)
 - rust-lang#74370 (Reintroduce spotlight / "important traits" feature)
 - rust-lang#74390 (Fix typo in std::mem::transmute documentation)
 - rust-lang#74391 (BtreeMap: superficially refactor root access)
 - rust-lang#74392 (const generics triage)
 - rust-lang#74397 (Fix typo in the latest release note)
 - rust-lang#74406 (Set shell for github actions CI)

Failed merges:

r? @ghost
@bors bors closed this as completed in 95bf7b7 Jul 16, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants