4paradigm / 4paradigm/OpenMLDB

duplicate static library link

未关闭
#1,385 8 条评论 0 个 reaction 已指派 2 人 已被 @aceforeverd 认领 在 GitHub 查看
bug build
主要语言
C++
星标
1.7k
派生
331
平均合并
12 天 12 小时
30 天内合并 PR
1

描述

## 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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。