Upload exactly the shared files needed and give precedence to global files over local ones#1340
Merged
jyn514 merged 3 commits intorust-lang:masterfrom Apr 13, 2021
Merged
Conversation
This avoids false positives for the essential files. Previously, docs.rs would copy any files with a resource suffix as an essential file, even if it couldn't be shared between crates (such as search-index.js).
This avoids copying shared files for crates other than the empty
library. This
a) Allows removing `copy_doc_dir`, which allows crates to add their own custom CSS (with `--theme` or otherwise), and
b) Avoids unnecessary disk IO.
Here are the files generated for a build of regex 1.4.1:
```
cratesfyi=# select path from files where path like '%regex/1.4.1%' and path not like '%regex/1.4.1/%/%';
path
-----------------------------------------------------------------------
sources/regex/1.4.1/PERFORMANCE.md
rustdoc/regex/1.4.1/.lock
sources/regex/1.4.1/Cargo.toml
sources/regex/1.4.1/.cargo_vcs_info.json
sources/regex/1.4.1/LICENSE-APACHE
rustdoc/regex/1.4.1/source-files-20210402-1.53.0-nightly-138fd56cf.js
rustdoc/regex/1.4.1/settings.html
rustdoc/regex/1.4.1/search-index-20210402-1.53.0-nightly-138fd56cf.js
rustdoc/regex/1.4.1/crates-20210402-1.53.0-nightly-138fd56cf.js
sources/regex/1.4.1/CHANGELOG.md
sources/regex/1.4.1/LICENSE-MIT
sources/regex/1.4.1/rustfmt.toml
sources/regex/1.4.1/HACKING.md
sources/regex/1.4.1/test
sources/regex/1.4.1/Cargo.toml.orig
sources/regex/1.4.1/UNICODE.md
sources/regex/1.4.1/.gitignore
sources/regex/1.4.1/Cargo.lock
sources/regex/1.4.1/README.md
(19 rows)
```
Note in particular that search-index.js and crates.js are included, but
not shared files like `storage.js` or `rustdoc.css`.
This avoids broken docs for crates build with an old version of rustdoc that didn't respect the shared static root.
3 tasks
Nemo157
approved these changes
Apr 6, 2021
Contributor
Nemo157
left a comment
There was a problem hiding this comment.
Code looks good. Testing and deployment is blocked on a new nightly with rustfmt being released.
Contributor
|
Tested locally now that we have a new nightly, appears to be working well. |
This was referenced Apr 14, 2021
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See rust-lang/rust#83784 for more info about the history of this PR (and the commits also have more information).
--emit=unversioned-files,toolchain-shared-filesfor generating the shared files--emit=invocation-specificfor building cratesFixes #1327. Fixes #294 (hopefully for real this time).
r? @Nemo157