4paradigm / 4paradigm/OpenMLDB

duplicate static library link

Đang mở
#1,385 8 bình luận 0 reaction 2 người được giao Được @aceforeverd nhận Xem trên GitHub
bug build
Ngôn ngữ chính
C++
Star
1.7k
Fork
331
Merge trung bình
12 ngày 12 giờ
Pull request đã merge (30 ngày)
1

Mô tả

## Expected Behavior
static lib should be linked only one time.

## Current Behavior
Some static libs are linked multiple times.
in [`src/sdk/CMakeLists.txt`](https://github.com/4paradigm/OpenMLDB/blob/2f85d12cd8dadd3a1ec822e1f591632341f3b23f/src/sdk/CMakeLists.txt#L52)

`set(SDK_LIBS openmldb_sdk openmldb_catalog client zk_client schema openmldb_flags openmldb_codec openmldb_proto base hybridse_sdk zookeeper_mt ${VM_LIBS} ${LLVM_LIBS} ${BRPC_LIBS} ${ZETASQL_LIBS}) `

where `${VM_LIBS} ${LLVM_LIBS} ${BRPC_LIBS} ${ZETASQL_LIBS} ` are not necessary and already linked by `hybridse_sdk`.

It may cause unexpected fault if we link multiple times. see [here](https://github.com/4paradigm/OpenMLDB/runs/5425348767?check_suite_focus=true)

## Possible Solution

It is not obvious what will happen if we link a static lib multiple times. We have to figure it out what are the correct way to do this.

I believe there are other places where there are duplicate links except the `SDK_LIBS`. But it for now does not trigger any error or unexpected crash.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

The issue points to src/sdk/CMakeLists.txt line 52 where SDK_LIBS includes duplicate static libraries. First, examine the CMakeLists.txt to understand the library dependencies, particularly how hybridse_sdk includes VM_LIBS, LLVM_LIBS, BRPC_LIBS, and ZETASQL_LIBS. Then, search for other duplicate links in the codebase. Test the build after removing the duplicates to ensure no linking errors occur.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
cmake, cpp
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
40/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.