You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running cargo inside a sandbox that rejects access to ~/.cargo/credentials, cargo build fails. I prefer to run VScode in a sandbox and not give it access to confidential files such as ~/.cargo/credentials. cargo build really shouldn't need access to my credentials, so this seems like it should be avoidable.
Steps
Change permissions such that ~/.cargo/credentials is unreadable
Do some cargo action that does not require credentials
You get: error: Permission denied (os error 13)
The error message is quite bad as it doesn't even say which file is affected! I had to use strace to determine that (which was hard because strace is blocked in the sandbox...)
The error message is quite bad as it doesn't even say which file is affected
Unfortunately, the Display impl of std errors doesn't output the file name but this opaque error msg. Not sure if there is an upstream discussion about it.
Load credentials only when needed
Credentials are always loaded, even if these are not used. If
access to confidential files such as credentials is not given,
`cargo build` fails despite not using credentials.
Fixes#7624.
Problem
When running cargo inside a sandbox that rejects access to ~/.cargo/credentials,
cargo build
fails. I prefer to run VScode in a sandbox and not give it access to confidential files such as ~/.cargo/credentials.cargo build
really shouldn't need access to my credentials, so this seems like it should be avoidable.Steps
error: Permission denied (os error 13)
The error message is quite bad as it doesn't even say which file is affected! I had to usestrace
to determine that (which was hard because strace is blocked in the sandbox...)Possible Solution(s)
Only read credentials when needed, i.e., in
cargo publish
.Notes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: