microsoft / rust-for-dotnet-devs

Rust for C#/.NET Developers
https://microsoft.github.io/rust-for-dotnet-devs/latest/
Other
353 stars 51 forks source link

Add devcontainer.json with required dependencies #28

Closed EliiseS closed 1 year ago

EliiseS commented 1 year ago

As a new user, I'd like to easily be able to run mdbook without having to install it and rust on my computer.

If you've not used Dev Containers you can find more info at Developing inside a Container using Visual Studio Code Remote Development.

atifaziz commented 1 year ago

As a new user, I'd like to easily be able to run mdbook without having to install it and rust on my computer.

A user doesn't need to install Rust. One can just download the pre-compiled binaries from the project's releases page on GitHub. Rust is only needed if someone wishes to build mdBook from sources.

EliiseS commented 1 year ago

Ah, well, that was not clear from the mdbook install page :)

Either way, for the devcontainer, wouldn't we rather have rust anyways?

atifaziz commented 1 year ago

Either way, for the devcontainer, wouldn't we rather have rust anyways?

In the Getting Started section, we already call out the Rust dev container the reader can use so not sure it makes sense to duplicate/maintain another here. What might make sense still, is to facilitate running mdBook, so we could offer a dev container where it's already installed and ready to run. The user can also preview the published version while working on something that might touch several sections. It would avoid someone (especially a first-time contributor) needing to find the (right) release, download, chmod +x, and so on.

EliiseS commented 1 year ago

One thing to consider, is that they already have to run this repo either way in codespaces or locally. Having it here would leave the option for someone to use this repo to try out rust as well, instead of being required to create their own repo or use the playground.

In the K8s workshop I run, I usually have them fork the repo and work inside of their fork. The devcontainer for the repo has everything needed to run the workshop. This also has an added benefit that, I as a maintainer, can just run it myself easily too. See: https://github.com/benc-uk/kube-workshop.

It's also fine if you don't want to have in here, no problem, just my two cents 😄

atifaziz commented 1 year ago

The things is, the Playground is simplest to start with and doesn't even require any familiarity with Cargo and the Rust toolchain. You just write the Rust code and run it. If someone is heading for the dev container, the assumption is that they want to do deeper exploration and will need some VS Code extensions to really light up the environment. That all said, we might need Rust in the dev container anyway to be able to run mdbook test when issue #11 is addressed. Meanwhile, perhaps we can just start with mdbook to help contributors. We can debate the utility of a dev container for readers as a separate issue.