rustup: file:// urls for doc incompatible with snap/flatpak/container-based-development

Problem you are trying to solve

There are various issues around confinement and working with containers on Linux where the path of the html docs either ends up wrong or the browser does not have permission to open the html docs.

  • a flatpak or snap of firefox cannot open files in /home (it would need to be granted permission)
  • if i’m developing inside a container (eg a vscode remote container) the paths rustup produces are incorrect outside the container

Solution you’d like

Provide an option to serve the docs as a port like mdbook serve ( https://rust-lang.github.io/mdBook/cli/serve.html ), maybe like rustup doc --serve

This allows for both confined applications and developing inside a container to then work as they don’t need to access the html files via a path, but instead just open localhost:8080 etc.

Notes

This would resolve issues like #3110 #2997 #2988 as there is no issue with confinement on ports.

If this is something this is possible, it would be good for cargo doc --serve to also exist as the same problem occurs with cargo doc --open. And this would then make both rustup and cargo consistent with mdbook serve which has this ability.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@brettearle we use external crates that are license compatible; we’re just about to introduce a pervasive tokio runtime, so I would suggest something async + tokio based.

Hello I just stumbled on this issue in Ubuntu as well. Any motion on the serve feature?

G’day If @HarrisonHemstreet isn’t currently working on this?, can I jump on board? I’ll just put up a MVP --serve flag and serve it on 0. What’s the convention in rust up, just std lib or do we have a web crate we like?

Sounds good! I’ll try working on this! 🙂