eunomia-bpf / bpftime

Userspace eBPF runtime for Observability, Network & General Extensions Framework
https://eunomia.dev/bpftime/
MIT License
789 stars 74 forks source link

[FEATURE] Add ability to package all-in-one static library #232

Closed Officeyutong closed 4 months ago

Officeyutong commented 7 months ago

Add ability to package all bpftime static library archives into a single archive.

Reference: https://github.com/WasmEdge/WasmEdge/blob/f5cf26c66e4bbb9bca00497fce5c814aac7d56fa/lib/api/CMakeLists.txt#L39

Hint:

sinduku commented 7 months ago

hi @Officeyutong @yunwei37 would like to take a crack at this, could you please assign this to me

yunwei37 commented 7 months ago

OK! Thanks!

Officeyutong commented 6 months ago

hi @Officeyutong @yunwei37 would like to take a crack at this, could you please assign this to me

Hi, how's going on now?

hp77-creator commented 6 months ago

Folks, Can I try this? @Officeyutong @yunwei37 ?

Officeyutong commented 6 months ago

Reference

Sure!

hp77-creator commented 6 months ago

hey @Officeyutong need a bit of guidance here, I checked out the function created in the CMake file that you linked in the first comment, I just have a question, where shall we make the archives? should it be at each add_library level since we have multiple sub-directories and libraries or should it be just at the vm or runtime level?

Officeyutong commented 6 months ago

hey @Officeyutong need a bit of guidance here, I checked out the function created in the CMake file that you linked in the first comment, I just have a question, where shall we make the archives? should it be at each add_library level since we have multiple sub-directories and libraries or should it be just at the vm or runtime level?

The purpose is to pack an archive so that if a user want to use bpftime, he just need to link that archive and the standard library. So we need to pack the following libraries:

hp77-creator commented 5 months ago

So, we should also have an option to package these libraries or should we mandate it? Like this: https://github.com/WasmEdge/WasmEdge/blob/f5cf26c66e4bbb9bca00497fce5c814aac7d56fa/lib/api/CMakeLists.txt#L144 https://github.com/WasmEdge/WasmEdge/blob/f5cf26c66e4bbb9bca00497fce5c814aac7d56fa/lib/api/CMakeLists.txt#L159

Officeyutong commented 5 months ago

So, we should also have an option to package these libraries or should we mandate it? Like this: https://github.com/WasmEdge/WasmEdge/blob/f5cf26c66e4bbb9bca00497fce5c814aac7d56fa/lib/api/CMakeLists.txt#L144 https://github.com/WasmEdge/WasmEdge/blob/f5cf26c66e4bbb9bca00497fce5c814aac7d56fa/lib/api/CMakeLists.txt#L159

We should have an option like BPFTIME_BUILD_STATIC_LIB, if enabled, a target named bpftime_static should be added, which includes all object files that we need