Build setup opinion question. Let's say I wanted ...
# community-support
j
Build setup opinion question. Let's say I wanted to build a super efficient agent for a Java process that combines java metrics with system metrics I've collected using eBPF using JNI. To get the eBPF part to build, it has to be built in a Linux environment. Would you configure the entire environment to build inside a docker container? Or would you just have the eBPF part built there, b/c most of the time you aren't changing eBPF and incremental builds can be leveraged to avoid firing up docker unnecessarily? I lean towards the latter, trying to figure out how I'd set up my gradle build for it. I can do a thing with
Exec
task, but that feels a little brittle and I've tried to avoid it in the past. Curious if folks have done this before and what you recommend
c
it could go either way. the monorepo (build Java code + native bits) is helpful for tightly coupled / frequently changing components; the artifact approach (publish a versioned artifact for the native code, bundle that as Java component is built) can be fine as well, with more overhead for updating dependencies.
j
I'm definitely leaning towards a single repo - with the ebpf / JNI bits in a subproject so I can take advantage of incremental compilation. My question is more about figuring out what mechanism is used to do the build. I could simply say "this has to be done in linux" and provide a docker compose file to do the build, or I could say it works anywhere, and have a Gradle task that calls docker and uses a Volume mount to make the artifact available locally
I think I realized the answer - since the tests will only run in Linux I'll just require linux for the entire project and provide a docker compose to build / test it
👍 1