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

Give precedence to local shared files over global ones #1324

Merged
merged 1 commit into from
Mar 21, 2021

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Mar 20, 2021

When serving 'essential files', we can either serve the global one,
created when building empty_library, or the local one, created when
building the local crate. Currently we default to the global one, but
this causes issues when the file should never have been global in the
first place (such as recently for crates.js). This is why #1317 needed to be deployed to fix #1313.

This gives precedence to the local file so that the bug will be fixed
when rustdoc fixes it, even if we forget to update
ESSENTIAL_FILES_UNVERSIONED.

r? @Nemo157

@jyn514 jyn514 added S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed A-builds Area: Building the documentation for a crate A-backend Area: Webserver backend labels Mar 20, 2021
@Nemo157
Copy link
Member

Nemo157 commented Mar 20, 2021

The comment above was already out of date, but now it's even more out of date 😁

@jyn514 jyn514 added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Mar 20, 2021
When serving 'essential files', we can either serve the global one,
created when building `empty_library`, or the local one, created when
building the local crate. Currently we default to the global one, but
this causes issues when the file should never have been global in the
first place (such as recently for `crates.js`: see
rust-lang#1313).

This gives precedence to the local file so that the bug will be fixed
when rustdoc fixes it, even if we forget to update
`ESSENTIAL_FILES_UNVERSIONED`.
@jyn514 jyn514 force-pushed the local-precedence branch from 01972f6 to 214710f Compare March 21, 2021 13:22
@jyn514
Copy link
Member Author

jyn514 commented Mar 21, 2021

lol, thanks, I fixed the comment :) while reading it I think database_handler can be removed right away, it's only for the favicon but we already handle that in the router. Making a separate PR for that now.

@jyn514 jyn514 added S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Mar 21, 2021
@jyn514 jyn514 force-pushed the local-precedence branch from ea6e643 to 228ee9f Compare March 21, 2021 13:44
@jyn514 jyn514 force-pushed the local-precedence branch from 228ee9f to 214710f Compare March 21, 2021 14:57
@jyn514 jyn514 merged commit d98b58f into rust-lang:master Mar 21, 2021
@jyn514 jyn514 deleted the local-precedence branch March 21, 2021 16:22
jyn514 added a commit to jyn514/rust that referenced this pull request Mar 26, 2021
The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: rust-lang/docs.rs#1312 (comment)

The end goal is to fix rust-lang/docs.rs#1327
by reverting rust-lang/docs.rs#1324.

This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 2, 2021
…imulacrum

rustdoc: Add unstable option to only emit shared/crate-specific files

The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: rust-lang/docs.rs#1312 (comment)

The end goal is to fix rust-lang/docs.rs#1327 by reverting rust-lang/docs.rs#1324.

This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.

I recommend reviewing this one commit at a time.

r? `@GuillaumeGomez` cc `@Nemo157` `@pietroalbini`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 2, 2021
…imulacrum

rustdoc: Add unstable option to only emit shared/crate-specific files

The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: rust-lang/docs.rs#1312 (comment)

The end goal is to fix rust-lang/docs.rs#1327 by reverting rust-lang/docs.rs#1324.

This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.

I recommend reviewing this one commit at a time.

r? ``@GuillaumeGomez`` cc ``@Nemo157`` ``@pietroalbini``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend Area: Webserver backend A-builds Area: Building the documentation for a crate S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs.rs reuses crate-specific resources from empty_library for other crates
2 participants