vector
vector copied to clipboard
Document dev environment specs in CONTRIBUTING.md
I've had a couple of contributors ask what the minimum dev environment specs are to work on Vector since they cannot compile Vector on their machines. We should document this in the CONTRIBUTING.md file to help with contributor onboarding.
- [ ] Document the minimum CPU, memory, and disk requirements.
- [ ] Document the idea CPU, memory, and disk requirements.
- [ ] Document any other tips for reducing the dev iteration cycle. Like flags used to reduce compile time, etc.
RAM: I'd consider 8GB a bare minimum, though doing any kind of integration testing with the Java-based systems (ex Elasticsearch or localstack) is likely to be difficult. The choice of development environment is important as well, as Eclipse with plugins will need a lot more RAM than simpler tools. I'd recommend a realistic minimum of 16GB, and 24GB is better. I have 32GB and rarely hit swap with Vector development.
CPU: More cores are always better for full builds. However, for development, most time is spent rebuilding, which is largely single threaded, so core speed is more important. So, on the AMD side, a Ryzen 5 3600XT will likely be better during rebuild cycles than a Ryzen 9 3900.
Disk: SSDs are recommended over magnetic drives due to the size of the artifacts created during builds. The target directory can exceed 64GB if many different build options are used, so plan disk size accordingly.
On the last point, building with --no-default-features --features X cuts down the rebuild time by a large factor. Also, using the lld linker can drop the final link time to 1/3 to 1/4 of stock GNU bfd ld on Linux. Unfortunately, doing this requires changing a core Vector cargo config file, so dealing with it can be a bit tricky.
diff --git a/.cargo/config b/.cargo/config
--- a/.cargo/config
+++ b/.cargo/config
@@ -2,4 +2,4 @@
rustflags = ["-C", "link-args=-rdynamic"]
[target.x86_64-unknown-linux-gnu]
-rustflags = ["-C", "link-args=-rdynamic"]
+rustflags = ["-C", "link-args=-rdynamic", "-C", "link-arg=-fuse-ld=lld"]
I tried make test which take more than 12Gb of ram, so running tests with specific features set is definitely recommended.