3 ms·
Not clear why Docker and "make" should be involved, except that he likes them. Cargo and git can do the job. A build usually produces a single executable, so "p
by Animats 2y ago
Not clear why Docker and "make" should be involved, except that he likes them. Cargo and git can do the job. A build usually produces a single executable, so "packaging" isn't that much of an issue.
There's much that could be said on this subject. How much should be made visible via "mod.rs" and "lib.rs" files? How much lock granularity is appropriate? Should projects be composed of loosely coupled crates? How much should be global? Anything?
How do you deal with the problem that if A owns B, B can't reference A?
How do you deal with breaking changes to low-level public crates?
The article doesn't say much about any of that. A good article on this subject would be helpful.
- IshKebab 2y agoI thought it explained Docker and Make pretty well, but to reiterate: You can use a Dockerfile to provide a Dev container. If you aren't familiar with those it basically lets IDEs open your project inside a Docker image without you having to faff around with Docker. This can give you a reproducible dev environment and make getting dependencies easier for new devs. You don't need it if your only dependency is Rust, but that may not be the case for larger projects. E.g. I have one that needs OCaml, and that is an absolute nightmare to install (worse than Python!) so I made a Dev container that had it preinstalled. He suggests Make so that you have common commands written down in a place where people actually run them (i.e. not a README where they are likely to rot). This helps new contributors discover how to do common tasks. This isn't using Make as a build system, just as a command runner. You could equally use Just or even shell scripts if you really hate Windows users... and yourself. Hope that helps!
- trueismywork 2y agoIf you need containers to build, then you need containers to deploy. While containers are good for getting devs started with development, they should not be the only dev/testing environment.
- jeroenhd 2y ago> If you need containers to build, then you need containers to deploy That's not true. I've seen plenty of projects that set up a complex build pipeline made up of scripting languages and wrappers that are a pain to install, but the final product doesn't need any of that to run. For instance, NodeJS web projects can require all manner of transpilers, minimisers, and what have you, but the end result is often a few large text files that will run in any browser if just served as static files. If you use containers to build, you may as well use containers to deploy, but you don't need to deploy using containers at all. Just copy the compiled end product out of your dev container.
- IshKebab 2y agoNobody is suggesting that.