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

rustup doc permission problems (Ubuntu/Firefox) #61796

Closed
kfrncs opened this issue Jun 13, 2019 · 7 comments
Closed

rustup doc permission problems (Ubuntu/Firefox) #61796

kfrncs opened this issue Jun 13, 2019 · 7 comments

Comments

@kfrncs
Copy link

kfrncs commented Jun 13, 2019

This appears in Firefox when I run rustup docs:

Access to the file was denied

The file at /home/ken/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc/rust/html/index.html is not readable.

It may have been removed, moved, or file permissions may be preventing access.

I had tried a bunch of stuff to give myself permission, but running cat /home/ken/blahblah/index.html works. There is a record of some troubleshooting here, but to no avail.

Hope we can find a solution, thanks in advance for your time.

version info:

rustc 1.37.0-nightly (2887008e0 2019-06-12)
binary: rustc
commit-hash: 2887008e0ce0824be4e0e9562c22ea397b165c97
commit-date: 2019-06-12
host: x86_64-unknown-linux-gnu
release: 1.37.0-nightly
LLVM version: 8.0
@Mark-Simulacrum
Copy link
Member

I suspect this is not a bug with Rust/rustup, but can't be sure -- without more information though I don't think we can do anything to help here. I would try to continue asking on stack overflow or perhaps try to reach out on Discord (#wg-rustup may be helpful).

If there's some actionable bug we can fix here please let us know and we'd be happy to reopen!

@genIterator
Copy link

genIterator commented Jan 4, 2022

Hello everyone,
@Mark-Simulacrum
the issue is directly related to firefox being provided as snap package now in Ubuntu. You can check that the snap package provides access to the home folder using the "snap connections firefox" command. However, as described here access to the home folder does not include access to hidden files like ".rust". Therefore the docs cannot be opened, no matter the file permissions.
I see three possible solutions:

  1. rust needs to change the path to the documentation, so snap packages are able to open it again
  2. Firefox Snap developers need to add the personal-files interface, as described here
  3. (maybe) users could get around the issue using hardlinks, as described here

@glts
Copy link

glts commented Sep 3, 2022

This issue is likely to get more exposure now with the .1 release of Ubuntu LTS 22.04.

Anybody who installs Rust on plain Ubuntu now will not be able to view local documentation with rustup doc --book or rustup doc --std.

@anthonygedeon
Copy link

A temporary solution for people who just wanna get the docs up and running locally:

  1. cd into $HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust
  2. execute python -m http.server

And now you can view the docs locally. It works on Firefox as well

@makoConstruct
Copy link

makoConstruct commented Dec 27, 2022

Huh. Honestly,

  1. Most users shouldn't install a web browser into a sandboxed environment, web browsers are themselves a very good sandbox. (And personally I think snap is actively making things worse here, it's introducing yet another obstacle to progress in the web by preventing what's (eventually) supposed to be a very broad-reaching safe system interface for cross-platform applications from having full access to the system.)

@KevinKelley
Copy link

A temporary solution for people who just wanna get the docs up and running locally:

  1. cd into $HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust
  2. execute python -m http.server

And now you can view the docs locally. It works on Firefox as well

thanks for this; it's the only method working so far for me. New install on ZorinOS (ubuntu 22.04 based), according to instructions from rust.org, and I'm getting that same error in the browser (chromium) with rustup doc --book
...docs generate fine, way down in .rustup/, but somehow not accessible in browser. python server works fine tho

@seralekseenko
Copy link

Another easy way to open documentation locally is to change the default browser. For example, on Chrome or Edge. But they must be installed outside of snap.

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

No branches or pull requests

8 participants