Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change DuckDB to static linking #3370

Merged
merged 17 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/build-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,12 @@ jobs:
run: docker stop kuzu-x86

build-mac-extensions-arm64:
runs-on: macos-14
runs-on: self-hosted-mac-arm
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
brew install duckdb openssl@3

- name: Build precompiled extensions
run: make extension-release LTO=1 NUM_THREADS=$(nproc)
run: env OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@3/3.3.0 make extension-release LTO=1 NUM_THREADS=$(sysctl -n hw.logicalcpu)
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CMAKE_OSX_ARCHITECTURES: "arm64"
Expand All @@ -133,7 +129,7 @@ jobs:
- uses: actions/checkout@v3

- name: Build precompiled extensions
run: make extension-release LTO=1 NUM_THREADS=$(nproc)
run: make extension-release LTO=1 NUM_THREADS=$(sysctl -n hw.logicalcpu)
env:
MACOSX_DEPLOYMENT_TARGET: 11.0
CMAKE_OSX_ARCHITECTURES: "x86_64"
Expand Down
10 changes: 10 additions & 0 deletions extension/duckdb_scanner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Address sanitizer may change the ABI, so we use dynamic linking
# if it's enabled.
if(${ENABLE_ADDRESS_SANITIZER})
set(DuckDB_USE_STATIC_LIBS OFF)
else()
set(DuckDB_USE_STATIC_LIBS ON)
endif()
find_package(DuckDB REQUIRED)
if(NOT WIN32)
find_library(DuckDB_STATIC REQUIRED NAMES libduckdb_static.a)
endif()

include_directories(
${PROJECT_SOURCE_DIR}/src/include
Expand Down
8 changes: 7 additions & 1 deletion extension/httpfs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
SET(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
SET(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
SET(OPENSSL_USE_STATIC_LIBS TRUE)
# Address sanitizer may change the ABI, so we use dynamic linking
# if it's enabled.
if(${ENABLE_ADDRESS_SANITIZER})
SET(OPENSSL_USE_STATIC_LIBS FALSE)
else()
SET(OPENSSL_USE_STATIC_LIBS TRUE)
endif()

find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
Expand Down
10 changes: 10 additions & 0 deletions extension/postgres_scanner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Address sanitizer may change the ABI, so we use dynamic linking
# if it's enabled.
if(${ENABLE_ADDRESS_SANITIZER})
set(DuckDB_USE_STATIC_LIBS OFF)
else()
set(DuckDB_USE_STATIC_LIBS ON)
endif()
find_package(DuckDB REQUIRED)
if(NOT WIN32)
find_library(DuckDB_STATIC REQUIRED NAMES libduckdb_static.a)
endif()

add_library(postgres_scanner
SHARED
Expand Down
Loading