With a working computer, it’s time to figure out what I should actually do.
By day, I’m a mild-mannered (sometimes) C# dev. .NET Core is new and shiny, but I’m already playing with ASP.NET Core and MVC to build a web service, so there’s less to learn if I go a similar route on my own time.
Step 0: The Developer’s Toys
Since I’m starting to set up the computer from scratch, I get my pick of tooling.
Version control today is done with git, and since Rust lives on github and VS Code has built-in git integration, that goes on too. I don’t get to play with this at work beyond trivial local one-offs, so this is another good thing to learn.
Rust itself is installed via rustup, which installs the compiler as well as cargo, the package manager and build/test system. Cargo is also extensible with extra commands, such as one for automatically formatting source files (
cargo fmt) and one for expanding macros (
cargo expand, which helps figure out compilation errors, since the error diagnostics within macros is still lacking). On Windows, it also needs a linker, so I pulled in the Visual C++ build tools as well.
Step 0.5: Finding a Project
The Rust community has a weekly newsletter that lists projects looking for people to contribute on issues. The drawback is that the easy ones tend to get attention pretty quickly, so I had to hop around github until I found something: cargo wants to throw out its hand-rolled error library for the community-developed error_chain library. I already used this in my toy project at work, so I’m not going in completely blind.
Step 1: Still Not Getting Started
Before I can actually contribute, I need to sign up with github, and then volunteer to work the issue. With that social stuff out of the way, it’s time to get the source.
First order of business: in github, fork the main cargo repository into my own github account. From there, it’s off to the command line.
git clone my online repo, and then jump through some hoops (
git remote add upstream +
git fetch upstream +
git merge upstream/master) to make sure that I don’t fall behind as I’m working my changes. Now I can update directly from the main repository instead of having to mess with my github fork (for now).
As demanded by modern custom, I next create a new branch (
git branch) for my development, and switch over (
git checkout). After all this, I’m finally ready to start writing code…