Hi everyone! I am looking to contribute to the pro...
# contributions
p
Hi everyone! I am looking to contribute to the project. I have basic knowledge of C++. Could anyone please list out some books, resources etc that i should first go through before delving into the project?
k
👋 Can you please tell how familiar you are with cmake? And what OS your development environment is in?
I can help you get started based on that @Peka
p
I have a basic idea of cmake and have used it before. I am on Ubuntu
@Kishore Nallan
k
That's great. The first milestone will be getting Typesense to compile locally on your machine. Typesense has quite a few dependencies, some of which are just managed at the system level, while others are built by the CMake (I kinda gave up using Cmake to manage dependencies). This Dockerfile is used by Typesense to build release builds, so you can just follow this to install the dependencies on Ubuntu: https://github.com/typesense/typesense/blob/single-index-concurrency/docker/development.Dockerfile
(Be mindful of that specific branch, that's the development branch right now so contains latest updates, and is not yet merged to
master
)
Once those dependencies are installed, you can now build Typesense like this: https://github.com/typesense/typesense/blob/single-index-concurrency/docker-build.sh#L24
Let me once your dev environment is setup and we can pick a small feature to ship 🙂
✅ 1
p
sure!
My dev environment is ready! What shall i start with?
k
Excellent, https://github.com/typesense/typesense/issues/328 should be a simple one to start with. This is where we process the fields: https://github.com/typesense/typesense/blob/single-index-concurrency/include/field.h#L197 We need to add a check for field name duplication in that function. The function already does other validations, so you can see how to return an error, which will be automatically handled by higher layers to send back to the API. The error code like "400" follow HTTP status code, which is "Bad Request" in the case of 400. Once you have a basic skeleton, you can try testing it on the API, and if that works I can then explain about adding a test for this.
👀 1
Also, the linking time on Linux might be long @Peka because we always link with
-static-libgcc -static-libstdc++
-- might have to add a flag for dev builds to not do that. For e.g. the Apple target does not statically link to those like the Linux target here: https://github.com/typesense/typesense/blob/single-index-concurrency/CMakeLists.txt#L156
@Peka any help needed here?
p
Yes actually! I think i had not set up my environment correctly earlier. Now that i am redoing it again, i am facing an error. Installed the dependencies but building Typesense shows error. If you'd please take a look, that'd be great!
k
The docker-build.sh script builds Typesense via Docker. If you have setup the local env, you should not run that directly but only the cmake and make commands inside it.
Or run
build.sh
which is without Docker.
👀 1