Skip to content

install nightly before checking what version it is #518

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

Merged
merged 3 commits into from
Dec 13, 2019

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 12, 2019

fixes crashes on the first run

r? @pietroalbini

@pietroalbini
Copy link
Member

update_toolchain above is supposed to install the release though. Can you make it return an Option<String> and handle the None around the codebase?

@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

Ah that's the issue, main calls add_essential_files instead of update_toolchain: https://github.com/rust-lang/docs.rs/blob/master/src/bin/cratesfyi.rs#L185

@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

Ok I fixed that instead, @pietroalbini could you review again?

@pietroalbini
Copy link
Member

So, I think having the add-essential-files command unconditionally adding the essential files is something we still want: it happens that something is missing or wrong with them, and in those cases I don't want to fiddle with the database by removing the cached rustc version to make the command work.

Still, that doesn't mean the add-essential-files is the right command to call in the entrypoint: what I would do is creating a new update-toolchain command which calls the update_toolchain method, moving the --only-first-time logic to it, and changing the entrypoint to use it.

using update-toolchain instead of add-essential files installs the
toolchain first if it doesn't exist.

This still keeps the `add-essential-files` command in case someone needs
to update the essential files without updating the toolchain version.
@jyn514
Copy link
Member Author

jyn514 commented Dec 12, 2019

I made the changes you suggested, but it got me thinking - do we need the toolchain to be installed just for the web server? It looks like the server only needs access to the database, not to rustdoc or anything similar. cratesfyi build crate already runs update_toolchain when called: https://github.com/rust-lang/docs.rs/blob/master/src/docbuilder/rustwide_builder.rs#L225

@pietroalbini
Copy link
Member

This looks great! Thanks!

I made the changes you suggested, but it got me thinking - do we need the toolchain to be installed just for the web server?

Yeah, because we need to have the essential files to render the pages, as every page includes rustdoc's CSS.

@pietroalbini pietroalbini merged commit 1de587d into rust-lang:master Dec 13, 2019
@jyn514 jyn514 deleted the first-run branch December 13, 2019 13:59
@pietroalbini
Copy link
Member

This was reverted due to #521.

@jyn514 jyn514 mentioned this pull request Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants