Skip to content

Commit e893c0a

Browse files
committed
chore: build extension with rust v2 rewrite
1 parent ad8c0cb commit e893c0a

28 files changed

+30
-1930
lines changed

.github/workflows/MainDistributionPipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ concurrency:
1414
jobs:
1515
duckdb-stable-build:
1616
name: Build extension binaries
17-
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@6a7a4f24c5999355ab36c0a6835baf891fc9d522
17+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.3.2
1818
with:
19-
ci_tools_version: 1f00107ca1eaf1691049907296a8aa796d054e6b
20-
duckdb_version: ad1273222186d28b4b351736ed88101044bbe97b
19+
ci_tools_version: v1.3.2
20+
duckdb_version: v1.3.2
2121
extension_name: vortex
2222
exclude_archs: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64_mingw;windows_amd64;linux_arm64"
2323
extra_toolchains: "rust"

.gitmodules

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@
88
branch = main
99
[submodule "duckdb"]
1010
path = duckdb
11-
url = https://github.com/spiraldb/duckdb.git
12-
[submodule "vcpkg"]
13-
path = vcpkg
14-
url = [email protected]:microsoft/vcpkg.git
11+
url = https://github.com/duckdb/duckdb.git

CMakeLists.txt

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ project(${TARGET_NAME}_project)
66
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
77
set(CMAKE_CXX_STANDARD 17)
88

9-
# Allow C++20 designator syntax in C++17
10-
add_compile_options(-Wno-c++20-designator)
11-
129
include(FetchContent)
1310
FetchContent_Declare(
1411
Corrosion
@@ -18,44 +15,39 @@ FetchContent_Declare(
1815

1916
FetchContent_MakeAvailable(Corrosion)
2017

21-
find_package(Catch2 CONFIG REQUIRED)
22-
find_package(Protobuf CONFIG REQUIRED)
23-
2418
if (APPLE)
2519
find_library(SECURITY_FRAMEWORK Security)
20+
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
2621
endif ()
2722

2823
corrosion_import_crate(MANIFEST_PATH vortex/Cargo.toml
2924
CRATES vortex-ffi
30-
FEATURES duckdb mimalloc
25+
FEATURES mimalloc
3126
CRATE_TYPES staticlib
3227
FLAGS --crate-type=staticlib
3328
)
3429

35-
set(EXTENSION_NAME ${TARGET_NAME}_extension)
36-
set(EXTENSION_SOURCES src/vortex_extension.cpp src/vortex_expr.cpp src/vortex_write.cpp src/vortex_scan.cpp)
37-
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
30+
corrosion_import_crate(MANIFEST_PATH vortex/Cargo.toml
31+
CRATES vortex-duckdb
32+
CRATE_TYPES staticlib
33+
FLAGS --crate-type=staticlib
34+
)
3835

39-
# Generate C++ code from .proto files.
40-
file(GLOB PROTO_FILES "vortex/vortex-proto/proto/*.proto")
41-
set(PROTO_GEN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gen)
42-
file(MAKE_DIRECTORY ${PROTO_GEN_DIR})
43-
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${PROTO_FILES} PROTOC_OUT_DIR ${PROTO_GEN_DIR})
36+
include_directories(src/include vortex/vortex-duckdb/include)
4437

45-
include_directories(src/include ${PROTO_GEN_DIR} vortex/vortex-ffi/cinclude)
38+
set(EXTENSION_NAME ${TARGET_NAME}_extension)
39+
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
4640

47-
build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES} ${PROTO_SRCS})
48-
set(PARAMETERS "-warnings")
49-
build_loadable_extension(${TARGET_NAME} ${PARAMETERS} ${EXTENSION_SOURCES} ${PROTO_SRCS})
41+
build_static_extension(${TARGET_NAME} src/vortex_extension.cpp)
42+
build_loadable_extension(${TARGET_NAME} -warnings src/vortex_extension.cpp)
5043

5144
target_link_libraries(${EXTENSION_NAME}
45+
vortex_duckdb-static
5246
vortex_ffi-static
53-
protobuf::libprotobuf
5447
${SECURITY_FRAMEWORK}
48+
${CORE_FOUNDATION_FRAMEWORK}
5549
)
5650

57-
add_subdirectory(test)
58-
5951
install(
6052
TARGETS ${EXTENSION_NAME}
6153
EXPORT "${DUCKDB_EXPORT_SET}"

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
33
EXT_NAME=vortex_duckdb
44
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
55
EXT_FLAGS=-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0
6-
7-
export OVERRIDE_GIT_DESCRIBE=v1.3.2
86
export MACOSX_DEPLOYMENT_TARGET=12.0
9-
export VCPKG_FEATURE_FLAGS=-binarycaching
10-
export VCPKG_OSX_DEPLOYMENT_TARGET=12.0
11-
export VCPKG_TOOLCHAIN_PATH := ${PROJ_DIR}vcpkg/scripts/buildsystems/vcpkg.cmake
127

138
# This is not needed on macOS, we don't see a tls error on load there.
149
ifeq ($(shell uname), Linux)

src/include/vortex.hpp

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/include/vortex_common.hpp

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/include/vortex_error.hpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/include/vortex_expr.hpp

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/include/vortex_extension.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#pragma once
2-
31
#include "duckdb.hpp"
42

5-
// The entry point class API can't be scoped to the vortex namespace.
6-
73
class VortexExtension : public duckdb::Extension {
84
public:
95
void Load(duckdb::DuckDB &db) override;

0 commit comments

Comments
 (0)