Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Rust Remote Container /usr/local/cargo Ownership Issue #1606

Closed
andar1an opened this issue Aug 31, 2022 · 5 comments
Closed

Rust Remote Container /usr/local/cargo Ownership Issue #1606

andar1an opened this issue Aug 31, 2022 · 5 comments

Comments

@andar1an
Copy link

/usr/local/cargo may require recursive vscode user ownership to be able to save new crates into the directory. I get a Spurious Network Error if vscode is not the user. I just manually ran chown -R vscode:rustlang /usr/local/cargo to bypass issue.

  • VSCode Version: 1.70.2
  • Local OS Version: Windows_NT x64 10.0.22000
  • Reproduces in: Remote - Containers - have not tried codespaces
  • Name of Dev Container Definition with Issue: Rust

Steps to Reproduce:

  1. Set up a Remote Container using available scripts and dockerfiles: https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/rust
  2. Use a project that requires a crate such as rand: https://crates.io/crates/rand
  3. Build project. Spurious Network Error may result due to a lack of ownership of /usr/local/cargo
@bamurtaugh
Copy link
Member

bamurtaugh commented Aug 31, 2022

Thanks for opening an issue!

Our team has been actively working on an updated plan for community contributions and this repo moving forward, which we've now outlined in this issue: #1589. This includes moving to new repos for images (https://github.com/devcontainers/images) and Features (https://github.com/devcontainers/features), and we anticipate to have a similar repo and process for templates/definitions.

Do you have a fix in mind? If so, please feel free to open a PR on the new Rust image or Rust Feature, or you can open an issue on this topic in either repo. Let me know if you have any questions, thank you!

@andar1an
Copy link
Author

andar1an commented Sep 1, 2022

I do have a fix in mind, and it would just be to run a post create command in docker or docker-compose file to have the vscode user take recursive ownership of /usr/local/cargo. However, I have not had time to play around to see if there are better options yet (I have noticed an image on Docker Hub which I have not seen before). I am also not sure if it was by design that the root user was meant to remain as the owner (potentially for hardening reasons?). I imagine it depends on the use case (e.g. dev vs prod).

@bamurtaugh
Copy link
Member

cc @joshspicer @edgonmsft @samruddhikhandale if you have any thoughts on the ownership topic for the Rust image or template.

@andar1an
Copy link
Author

The rust image that you shared is awesome! It even adds target for wasm, and compiles trunk and hyper, etc. I have had to add wasm stuff myself in the past. Just need to test to see if the issue I had still exists (hopeful it does not). I will close this issue if it works. To automatically format on save, I believe nightly build of Rust is needed still. Is that possible here?

@andar1an
Copy link
Author

All seems to be good now! Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants